Don't use buildOcaml
This commit is contained in:
parent
6ef367a5e8
commit
961b83a99d
|
@ -1,10 +1,24 @@
|
||||||
{ buildOcaml, ocaml_oasis }:
|
{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild, camlp4 }:
|
||||||
|
|
||||||
{ buildInputs ? [], ...
|
{ name, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; },
|
||||||
|
minimumOcamlVersion ? null,
|
||||||
|
createFindlibDestdir ? true,
|
||||||
|
dontStrip ? true,
|
||||||
|
hasSharedObjects ? false,
|
||||||
|
setupHook ? null,
|
||||||
|
...
|
||||||
}@args:
|
}@args:
|
||||||
|
|
||||||
buildOcaml (args // {
|
assert minimumOcamlVersion != null ->
|
||||||
buildInputs = [ ocaml_oasis ] ++ buildInputs;
|
stdenv.lib.versionOlder minimumOcamlVersion ocaml.version;
|
||||||
|
|
||||||
|
stdenv.mkDerivation (args // {
|
||||||
|
name = "ocaml-${name}-${version}";
|
||||||
|
|
||||||
|
buildInputs = [ ocaml findlib ocamlbuild camlp4 ocaml_oasis ] ++ buildInputs;
|
||||||
|
|
||||||
|
inherit createFindlibDestdir;
|
||||||
|
inherit dontStrip;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
@ -28,4 +42,11 @@ buildOcaml (args // {
|
||||||
prefix=$OCAMLFIND_DESTDIR ocaml setup.ml -install
|
prefix=$OCAMLFIND_DESTDIR ocaml setup.ml -install
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
setupHook = if setupHook == null && hasSharedObjects
|
||||||
|
then stdenv.writeText "setupHook.sh" ''
|
||||||
|
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${name}/"
|
||||||
|
''
|
||||||
|
else setupHook;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@ buildOasisPackage rec {
|
||||||
name = "tcslib";
|
name = "tcslib";
|
||||||
version = "0.3";
|
version = "0.3";
|
||||||
|
|
||||||
minimumSupportedOCamlVersion = "4.03.0";
|
minimumOCamlVersion = "4.03.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "tcsprojects";
|
owner = "tcsprojects";
|
||||||
|
|
|
@ -12,7 +12,7 @@ let
|
||||||
|
|
||||||
buildOcaml = callPackage ../build-support/ocaml { };
|
buildOcaml = callPackage ../build-support/ocaml { };
|
||||||
|
|
||||||
buildOasisPackage = callPackage ../build-support/ocaml/oasis.nix { buildOcaml = buildOcaml; };
|
buildOasisPackage = callPackage ../build-support/ocaml/oasis.nix { };
|
||||||
|
|
||||||
buildDunePackage = callPackage ../build-support/ocaml/dune.nix {};
|
buildDunePackage = callPackage ../build-support/ocaml/dune.nix {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue