Suggested edits

This commit is contained in:
Merlin Göttlinger 2019-08-07 06:51:36 +02:00
parent 961b83a99d
commit 6e6c1448fa
No known key found for this signature in database
GPG Key ID: F3DD4A06EDED86E5

View File

@ -1,11 +1,9 @@
{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild, camlp4 }:
{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }:
{ name, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; },
minimumOcamlVersion ? null,
createFindlibDestdir ? true,
dontStrip ? true,
hasSharedObjects ? false,
setupHook ? null,
...
}@args:
@ -13,9 +11,9 @@
stdenv.lib.versionOlder minimumOcamlVersion ocaml.version;
stdenv.mkDerivation (args // {
name = "ocaml-${name}-${version}";
name = "ocaml${ocaml.version}-${name}-${version}";
buildInputs = [ ocaml findlib ocamlbuild camlp4 ocaml_oasis ] ++ buildInputs;
buildInputs = [ ocaml findlib ocamlbuild ocaml_oasis ] ++ buildInputs;
inherit createFindlibDestdir;
inherit dontStrip;
@ -43,10 +41,4 @@ stdenv.mkDerivation (args // {
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;
})