add an ocaml specific builder to the system
This commit is contained in:
parent
ae0e3c8974
commit
d814c50505
36
pkgs/build-support/ocaml/default.nix
Normal file
36
pkgs/build-support/ocaml/default.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ stdenv, writeText, ocaml, findlib, camlp4 }:
|
||||||
|
|
||||||
|
{ name, version, buildInputs ? [],
|
||||||
|
createFindlibDestdir ? true,
|
||||||
|
dontStrip ? true,
|
||||||
|
minimumSupportedOcamlVersion ? null,
|
||||||
|
hasSharedObjects ? false,
|
||||||
|
setupHook ? null,
|
||||||
|
meta ? {}, ...
|
||||||
|
}@args:
|
||||||
|
let
|
||||||
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||||
|
defaultMeta = {
|
||||||
|
platforms = ocaml.meta.platforms;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
assert minimumSupportedOcamlVersion != null ->
|
||||||
|
stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml_version;
|
||||||
|
|
||||||
|
stdenv.mkDerivation (args // {
|
||||||
|
name = "ocaml-${name}-${version}";
|
||||||
|
|
||||||
|
buildInputs = [ ocaml findlib camlp4 ] ++ buildInputs;
|
||||||
|
|
||||||
|
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}/"
|
||||||
|
''
|
||||||
|
else setupHook;
|
||||||
|
|
||||||
|
inherit ocaml_version;
|
||||||
|
inherit createFindlibDestdir;
|
||||||
|
inherit dontStrip;
|
||||||
|
|
||||||
|
meta = defaultMeta // meta;
|
||||||
|
})
|
@ -4039,6 +4039,7 @@ let
|
|||||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||||
in rec {
|
in rec {
|
||||||
inherit ocaml;
|
inherit ocaml;
|
||||||
|
buildOcaml = callPackage ../build-support/ocaml { };
|
||||||
|
|
||||||
acgtk = callPackage ../applications/science/logic/acgtk { };
|
acgtk = callPackage ../applications/science/logic/acgtk { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user