Merge pull request #143994 from Stunkymonkey/ocaml-pname

This commit is contained in:
Sandro 2021-11-13 13:30:16 +01:00 committed by GitHub
commit 594fa6aea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 29 additions and 23 deletions

View file

@ -1,6 +1,6 @@
{ lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }: { lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }:
{ name, version, nativeBuildInputs ? [], { pname ? args.name, version, nativeBuildInputs ? [],
createFindlibDestdir ? true, createFindlibDestdir ? true,
dontStrip ? true, dontStrip ? true,
minimumSupportedOcamlVersion ? null, minimumSupportedOcamlVersion ? null,
@ -17,13 +17,13 @@ in
lib.versionOlder minimumSupportedOcamlVersion ocaml.version; lib.versionOlder minimumSupportedOcamlVersion ocaml.version;
stdenv.mkDerivation (args // { stdenv.mkDerivation (args // {
name = "ocaml-${name}-${version}"; name = "ocaml-${pname}-${version}";
nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ] ++ nativeBuildInputs; nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ] ++ nativeBuildInputs;
setupHook = if setupHook == null && hasSharedObjects setupHook = if setupHook == null && hasSharedObjects
then writeText "setupHook.sh" '' 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; else setupHook;

View file

@ -5,7 +5,7 @@ then throw "bin_prot-112.24.00 is not available for OCaml ${ocaml.version}"
else else
buildOcaml rec { buildOcaml rec {
name = "bin_prot"; pname = "bin_prot";
version = "112.24.00"; version = "112.24.00";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -1,7 +1,7 @@
{lib, buildOcaml, fetchurl, type_conv}: {lib, buildOcaml, fetchurl, type_conv}:
buildOcaml rec { buildOcaml rec {
name = "comparelib"; pname = "comparelib";
version = "113.00.00"; version = "113.00.00";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -5,7 +5,7 @@ then throw "estring is not available for OCaml ${ocaml.version}"
else else
buildOcaml rec { buildOcaml rec {
name = "estring"; pname = "estring";
version = "1.3"; version = "1.3";
src = fetchurl { src = fetchurl {

View file

@ -6,7 +6,7 @@ else
buildOcaml rec { buildOcaml rec {
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";
name = "faillib"; pname = "faillib";
version = "111.17.00"; version = "111.17.00";
src = fetchurl { src = fetchurl {

View file

@ -2,7 +2,7 @@
buildOcaml rec { buildOcaml rec {
version = "112.35.00"; version = "112.35.00";
name = "herelib"; pname = "herelib";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -1,14 +1,14 @@
{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } : { buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } :
{ name, version ? "113.33.03", buildInputs ? [], { pname, version ? "113.33.03", buildInputs ? [],
hash ? "", hash ? "",
minimumSupportedOcamlVersion ? "4.02", ... minimumSupportedOcamlVersion ? "4.02", ...
}@args: }@args:
buildOcaml (args // { buildOcaml (args // {
inherit name version minimumSupportedOcamlVersion; inherit pname version minimumSupportedOcamlVersion;
src = fetchurl { src = fetchurl {
url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz"; url = "https://github.com/janestreet/${pname}/archive/${version}.tar.gz";
sha256 = hash; sha256 = hash;
}; };
@ -20,10 +20,16 @@ buildOcaml (args // {
dontAddStaticConfigureFlags = true; dontAddStaticConfigureFlags = true;
configurePlatforms = []; 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
'';
}) })

View file

@ -1,13 +1,13 @@
{ lib, buildOcaml, fetchurl, ocaml_oasis, opaline }: { lib, buildOcaml, fetchurl, ocaml_oasis, opaline }:
buildOcaml rec { buildOcaml rec {
name = "js-build-tools"; pname = "js-build-tools";
version = "113.33.06"; version = "113.33.06";
minimumSupportedOcamlVersion = "4.02"; minimumSupportedOcamlVersion = "4.02";
src = fetchurl { 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"; sha256 = "1nvgyp4gsnlnpix3li6kr90b12iin5ihichv298p03i6h2809dia";
}; };
@ -19,7 +19,7 @@ buildOcaml rec {
dontAddStaticConfigureFlags = true; dontAddStaticConfigureFlags = true;
configurePlatforms = []; configurePlatforms = [];
configurePhase = "./configure --prefix $prefix"; 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 ]; patches = [ ./js-build-tools-darwin.patch ];

View file

@ -1,7 +1,7 @@
{lib, buildOcaml, fetchurl, type_conv, pa_ounit}: {lib, buildOcaml, fetchurl, type_conv, pa_ounit}:
buildOcaml rec { buildOcaml rec {
name = "pa_bench"; pname = "pa_bench";
version = "113.00.00"; version = "113.00.00";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -5,7 +5,7 @@ then throw "pa_ounit is not available for OCaml ${ocaml.version}"
else else
buildOcaml rec { buildOcaml rec {
name = "pa_ounit"; pname = "pa_ounit";
version = "113.00.00"; version = "113.00.00";
src = fetchurl { src = fetchurl {

View file

@ -1,7 +1,7 @@
{lib, buildOcaml, fetchurl}: {lib, buildOcaml, fetchurl}:
buildOcaml rec { buildOcaml rec {
name = "pipebang"; pname = "pipebang";
version = "113.00.00"; version = "113.00.00";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -3,7 +3,7 @@
buildOcaml rec { buildOcaml rec {
minimumSupportedOcamlVersion = "4.02"; minimumSupportedOcamlVersion = "4.02";
name = "type_conv"; pname = "type_conv";
version = "113.00.02"; version = "113.00.02";
src = fetchurl { src = fetchurl {

View file

@ -1,7 +1,7 @@
{ lib, buildOcaml, fetchFromGitHub, type_conv }: { lib, buildOcaml, fetchFromGitHub, type_conv }:
buildOcaml rec { buildOcaml rec {
name = "typerep"; pname = "typerep";
version = "112.24.00"; version = "112.24.00";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";

View file

@ -5,7 +5,7 @@ then throw "variantslib-109.15.03 is not available for OCaml ${ocaml.version}"
else else
buildOcaml rec { buildOcaml rec {
name = "variantslib"; pname = "variantslib";
version = "109.15.03"; version = "109.15.03";
minimumSupportedOcamlVersion = "4.00"; minimumSupportedOcamlVersion = "4.00";