From e601787f7ef196994efd1af403c135682cc4c0a7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 31 Oct 2021 13:35:20 +0100 Subject: [PATCH] buildOcaml: rename name to pname --- pkgs/build-support/ocaml/default.nix | 6 +++--- .../ocaml-modules/bin_prot/default.nix | 2 +- .../ocaml-modules/comparelib/default.nix | 2 +- .../ocaml-modules/estring/default.nix | 2 +- .../ocaml-modules/faillib/default.nix | 2 +- .../ocaml-modules/herelib/default.nix | 2 +- .../janestreet/buildOcamlJane.nix | 18 ++++++++++++------ .../janestreet/js-build-tools.nix | 6 +++--- .../ocaml-modules/pa_bench/default.nix | 2 +- .../ocaml-modules/pa_ounit/default.nix | 2 +- .../ocaml-modules/pipebang/default.nix | 2 +- .../ocaml-modules/type_conv/112.01.01.nix | 2 +- .../ocaml-modules/typerep/default.nix | 2 +- .../ocaml-modules/variantslib/default.nix | 2 +- 14 files changed, 29 insertions(+), 23 deletions(-) diff --git a/pkgs/build-support/ocaml/default.nix b/pkgs/build-support/ocaml/default.nix index cd17eb688c2e..1fe99bb6320e 100644 --- a/pkgs/build-support/ocaml/default.nix +++ b/pkgs/build-support/ocaml/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }: -{ name, version, nativeBuildInputs ? [], +{ pname ? args.name, version, nativeBuildInputs ? [], createFindlibDestdir ? true, dontStrip ? true, minimumSupportedOcamlVersion ? null, @@ -17,13 +17,13 @@ in lib.versionOlder minimumSupportedOcamlVersion ocaml.version; stdenv.mkDerivation (args // { - name = "ocaml-${name}-${version}"; + name = "ocaml-${pname}-${version}"; nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ] ++ nativeBuildInputs; setupHook = if setupHook == null && hasSharedObjects then writeText "setupHook.sh" '' - export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${name}/" + export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${pname}/" '' else setupHook; diff --git a/pkgs/development/ocaml-modules/bin_prot/default.nix b/pkgs/development/ocaml-modules/bin_prot/default.nix index 50ef935aff6b..3aa7cf0ec134 100644 --- a/pkgs/development/ocaml-modules/bin_prot/default.nix +++ b/pkgs/development/ocaml-modules/bin_prot/default.nix @@ -5,7 +5,7 @@ then throw "bin_prot-112.24.00 is not available for OCaml ${ocaml.version}" else buildOcaml rec { - name = "bin_prot"; + pname = "bin_prot"; version = "112.24.00"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/comparelib/default.nix b/pkgs/development/ocaml-modules/comparelib/default.nix index addba7a4b349..a1371e4f4d5e 100644 --- a/pkgs/development/ocaml-modules/comparelib/default.nix +++ b/pkgs/development/ocaml-modules/comparelib/default.nix @@ -1,7 +1,7 @@ {lib, buildOcaml, fetchurl, type_conv}: buildOcaml rec { - name = "comparelib"; + pname = "comparelib"; version = "113.00.00"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/estring/default.nix b/pkgs/development/ocaml-modules/estring/default.nix index 7424d14220dc..c0cc3398763c 100644 --- a/pkgs/development/ocaml-modules/estring/default.nix +++ b/pkgs/development/ocaml-modules/estring/default.nix @@ -5,7 +5,7 @@ then throw "estring is not available for OCaml ${ocaml.version}" else buildOcaml rec { - name = "estring"; + pname = "estring"; version = "1.3"; src = fetchurl { diff --git a/pkgs/development/ocaml-modules/faillib/default.nix b/pkgs/development/ocaml-modules/faillib/default.nix index 63040fadda5d..e2d90e06bdb5 100644 --- a/pkgs/development/ocaml-modules/faillib/default.nix +++ b/pkgs/development/ocaml-modules/faillib/default.nix @@ -6,7 +6,7 @@ else buildOcaml rec { minimumSupportedOcamlVersion = "4.00"; - name = "faillib"; + pname = "faillib"; version = "111.17.00"; src = fetchurl { diff --git a/pkgs/development/ocaml-modules/herelib/default.nix b/pkgs/development/ocaml-modules/herelib/default.nix index c5223637a158..b6f05fc46af3 100644 --- a/pkgs/development/ocaml-modules/herelib/default.nix +++ b/pkgs/development/ocaml-modules/herelib/default.nix @@ -2,7 +2,7 @@ buildOcaml rec { version = "112.35.00"; - name = "herelib"; + pname = "herelib"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix index 62876e5eaf94..13fcdff39239 100644 --- a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix +++ b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix @@ -1,14 +1,14 @@ { buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } : -{ name, version ? "113.33.03", buildInputs ? [], +{ pname, version ? "113.33.03", buildInputs ? [], hash ? "", minimumSupportedOcamlVersion ? "4.02", ... }@args: buildOcaml (args // { - inherit name version minimumSupportedOcamlVersion; + inherit pname version minimumSupportedOcamlVersion; src = fetchurl { - url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz"; + url = "https://github.com/janestreet/${pname}/archive/${version}.tar.gz"; sha256 = hash; }; @@ -20,10 +20,16 @@ buildOcaml (args // { dontAddStaticConfigureFlags = true; configurePlatforms = []; - configurePhase = "./configure --prefix $out"; + configurePhase = '' + ./configure --prefix $out + ''; - buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make"; + buildPhase = '' + OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make + ''; - installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install"; + installPhase = '' + opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${pname}.install + ''; }) diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix index 2f68ee8230e7..4186b0649bad 100644 --- a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix +++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix @@ -1,13 +1,13 @@ { lib, buildOcaml, fetchurl, ocaml_oasis, opaline }: buildOcaml rec { - name = "js-build-tools"; + pname = "js-build-tools"; version = "113.33.06"; minimumSupportedOcamlVersion = "4.02"; src = fetchurl { - url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz"; + url = "https://github.com/janestreet/js-build-tools/archive/${version}.tar.gz"; sha256 = "1nvgyp4gsnlnpix3li6kr90b12iin5ihichv298p03i6h2809dia"; }; @@ -19,7 +19,7 @@ buildOcaml rec { dontAddStaticConfigureFlags = true; configurePlatforms = []; configurePhase = "./configure --prefix $prefix"; - installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install"; + installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR js-build-tools.install"; patches = [ ./js-build-tools-darwin.patch ]; diff --git a/pkgs/development/ocaml-modules/pa_bench/default.nix b/pkgs/development/ocaml-modules/pa_bench/default.nix index e5f9ac52067d..a2de553961a4 100644 --- a/pkgs/development/ocaml-modules/pa_bench/default.nix +++ b/pkgs/development/ocaml-modules/pa_bench/default.nix @@ -1,7 +1,7 @@ {lib, buildOcaml, fetchurl, type_conv, pa_ounit}: buildOcaml rec { - name = "pa_bench"; + pname = "pa_bench"; version = "113.00.00"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/pa_ounit/default.nix b/pkgs/development/ocaml-modules/pa_ounit/default.nix index 26d000042227..a9e49bab34a1 100644 --- a/pkgs/development/ocaml-modules/pa_ounit/default.nix +++ b/pkgs/development/ocaml-modules/pa_ounit/default.nix @@ -5,7 +5,7 @@ then throw "pa_ounit is not available for OCaml ${ocaml.version}" else buildOcaml rec { - name = "pa_ounit"; + pname = "pa_ounit"; version = "113.00.00"; src = fetchurl { diff --git a/pkgs/development/ocaml-modules/pipebang/default.nix b/pkgs/development/ocaml-modules/pipebang/default.nix index 36eb3fe54bbe..96cfc82bc2fb 100644 --- a/pkgs/development/ocaml-modules/pipebang/default.nix +++ b/pkgs/development/ocaml-modules/pipebang/default.nix @@ -1,7 +1,7 @@ {lib, buildOcaml, fetchurl}: buildOcaml rec { - name = "pipebang"; + pname = "pipebang"; version = "113.00.00"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/type_conv/112.01.01.nix b/pkgs/development/ocaml-modules/type_conv/112.01.01.nix index 3fa9042b0351..c71bfa00e7ef 100644 --- a/pkgs/development/ocaml-modules/type_conv/112.01.01.nix +++ b/pkgs/development/ocaml-modules/type_conv/112.01.01.nix @@ -3,7 +3,7 @@ buildOcaml rec { minimumSupportedOcamlVersion = "4.02"; - name = "type_conv"; + pname = "type_conv"; version = "113.00.02"; src = fetchurl { diff --git a/pkgs/development/ocaml-modules/typerep/default.nix b/pkgs/development/ocaml-modules/typerep/default.nix index 5a38bd708f7b..c51d28f9e19b 100644 --- a/pkgs/development/ocaml-modules/typerep/default.nix +++ b/pkgs/development/ocaml-modules/typerep/default.nix @@ -1,7 +1,7 @@ { lib, buildOcaml, fetchFromGitHub, type_conv }: buildOcaml rec { - name = "typerep"; + pname = "typerep"; version = "112.24.00"; minimumSupportedOcamlVersion = "4.00"; diff --git a/pkgs/development/ocaml-modules/variantslib/default.nix b/pkgs/development/ocaml-modules/variantslib/default.nix index aaddda3c11bc..25d379f51648 100644 --- a/pkgs/development/ocaml-modules/variantslib/default.nix +++ b/pkgs/development/ocaml-modules/variantslib/default.nix @@ -5,7 +5,7 @@ then throw "variantslib-109.15.03 is not available for OCaml ${ocaml.version}" else buildOcaml rec { - name = "variantslib"; + pname = "variantslib"; version = "109.15.03"; minimumSupportedOcamlVersion = "4.00";