treewide: use ocaml.version (#19192)
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
{stdenv, fetchurl, makeWrapper, gcc, ocaml, ncurses}:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
pname = "camlidl";
|
||||
version = "1.05";
|
||||
webpage = "http://caml.inria.fr/pub/old_caml_site/camlidl/";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "${pname}-${version}";
|
||||
version = "1.05";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://caml.inria.fr/pub/old_caml_site/distrib/bazar-ocaml/${pname}-${version}.tar.gz";
|
||||
@@ -19,13 +18,13 @@ stdenv.mkDerivation {
|
||||
preBuild = ''
|
||||
mv config/Makefile.unix config/Makefile
|
||||
substituteInPlace config/Makefile --replace BINDIR=/usr/local/bin BINDIR=$out
|
||||
substituteInPlace config/Makefile --replace OCAMLLIB=/usr/local/lib/ocaml OCAMLLIB=$out/lib/ocaml/${ocaml_version}/site-lib/camlidl
|
||||
substituteInPlace config/Makefile --replace OCAMLLIB=/usr/local/lib/ocaml OCAMLLIB=$out/lib/ocaml/${ocaml.version}/site-lib/camlidl
|
||||
substituteInPlace config/Makefile --replace CPP=/lib/cpp CPP=${gcc}/bin/cpp
|
||||
mkdir -p $out/lib/ocaml/${ocaml_version}/site-lib/camlidl/caml
|
||||
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/camlidl/caml
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
cat >$out/lib/ocaml/${ocaml_version}/site-lib/camlidl/META <<EOF
|
||||
cat >$out/lib/ocaml/${ocaml.version}/site-lib/camlidl/META <<EOF
|
||||
# Courtesy of GODI
|
||||
description = "Stub generator"
|
||||
version = "${version}"
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
{stdenv, fetchzip, which, ocaml, ocamlbuild}:
|
||||
let
|
||||
ocaml_version = (stdenv.lib.getVersion ocaml);
|
||||
version = "4.03+1";
|
||||
|
||||
in
|
||||
|
||||
assert stdenv.lib.versionAtLeast ocaml_version "4.02";
|
||||
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "camlp4-${version}";
|
||||
version = "4.03+1";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
|
||||
sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq";
|
||||
@@ -21,14 +18,14 @@ stdenv.mkDerivation {
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(
|
||||
--bindir=$out/bin
|
||||
--libdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
substituteInPlace camlp4/META.in \
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml_version}/site-lib/camlp4
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
|
||||
'';
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
{stdenv, fetchzip, which, ocaml}:
|
||||
let
|
||||
ocaml_version = (stdenv.lib.getVersion ocaml);
|
||||
|
||||
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "camlp4-${version}";
|
||||
version = "4.02+6";
|
||||
|
||||
in
|
||||
|
||||
assert stdenv.lib.versionAtLeast ocaml_version "4.02";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "camlp4-${version}";
|
||||
src = fetchzip {
|
||||
url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
|
||||
sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj";
|
||||
@@ -21,14 +18,14 @@ stdenv.mkDerivation {
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(
|
||||
--bindir=$out/bin
|
||||
--libdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
substituteInPlace camlp4/META.in \
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml_version}/site-lib/camlp4
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
|
||||
'';
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
{stdenv, fetchurl, ocaml, transitional ? false}:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
pname = "camlp5";
|
||||
version = "5.15";
|
||||
webpage = http://pauillac.inria.fr/~ddr/camlp5/;
|
||||
metafile = ./META;
|
||||
in
|
||||
|
||||
assert !stdenv.lib.versionOlder "4.00" ocaml_version;
|
||||
assert !stdenv.lib.versionOlder "4.00" ocaml.version;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
name = "${pname}${if transitional then "_transitional" else ""}-${version}";
|
||||
version = "5.15";
|
||||
|
||||
src = fetchurl {
|
||||
url = "${webpage}/distrib/src/${pname}-${version}.tgz";
|
||||
@@ -24,11 +23,11 @@ stdenv.mkDerivation {
|
||||
prefixKey = "-prefix ";
|
||||
|
||||
preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") +
|
||||
" --libdir $out/lib/ocaml/${ocaml_version}/site-lib)";
|
||||
" --libdir $out/lib/ocaml/${ocaml.version}/site-lib)";
|
||||
|
||||
buildFlags = "world.opt";
|
||||
|
||||
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml_version}/site-lib/camlp5/META";
|
||||
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml.version}/site-lib/camlp5/META";
|
||||
|
||||
meta = {
|
||||
description = "Preprocessor-pretty-printer for OCaml";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{stdenv, fetchurl, ocaml, transitional ? false}:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
metafile = ./META;
|
||||
in
|
||||
|
||||
@@ -19,11 +18,11 @@ stdenv.mkDerivation {
|
||||
prefixKey = "-prefix ";
|
||||
|
||||
preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") +
|
||||
" --libdir $out/lib/ocaml/${ocaml_version}/site-lib)";
|
||||
" --libdir $out/lib/ocaml/${ocaml.version}/site-lib)";
|
||||
|
||||
buildFlags = "world.opt";
|
||||
|
||||
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml_version}/site-lib/camlp5/META";
|
||||
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml.version}/site-lib/camlp5/META";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Preprocessor-pretty-printer for OCaml";
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
{stdenv, fetchurl, m4, ncurses, ocaml, writeText}:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ocaml-findlib-${version}";
|
||||
version = "1.6.1";
|
||||
@@ -23,7 +19,7 @@ stdenv.mkDerivation rec {
|
||||
configureFlagsArray=(
|
||||
-bindir $out/bin
|
||||
-mandir $out/share/man
|
||||
-sitelib $out/lib/ocaml/${ocaml_version}/site-lib
|
||||
-sitelib $out/lib/ocaml/${ocaml.version}/site-lib
|
||||
-config $out/etc/findlib.conf
|
||||
)
|
||||
'';
|
||||
@@ -35,10 +31,10 @@ stdenv.mkDerivation rec {
|
||||
|
||||
setupHook = writeText "setupHook.sh" ''
|
||||
addOCamlPath () {
|
||||
if test -d "''$1/lib/ocaml/${ocaml_version}/site-lib"; then
|
||||
export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/"
|
||||
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then
|
||||
export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/"
|
||||
fi
|
||||
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml_version}/site-lib/"
|
||||
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/"
|
||||
if test -n "$createFindlibDestdir"; then
|
||||
mkdir -p $OCAMLFIND_DESTDIR
|
||||
fi
|
||||
|
||||
@@ -8,7 +8,6 @@ assert versionAtLeast (getVersion ocpIndent) "1.4.2";
|
||||
|
||||
let
|
||||
version = "1.1.4";
|
||||
ocaml_version = getVersion ocaml;
|
||||
srcs = {
|
||||
"4.03.0" = {
|
||||
rev = "${version}-4.03";
|
||||
@@ -27,7 +26,7 @@ let
|
||||
src = fetchFromGitHub ({
|
||||
owner = "OCamlPro";
|
||||
repo = "ocp-index";
|
||||
} // srcs."${ocaml_version}");
|
||||
} // srcs."${ocaml.version}");
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
||||
Reference in New Issue
Block a user