tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
add an ocaml specific builder to the system
Eric Merritt
10 years ago
d814c505
ae0e3c89
+37
2 changed files
expand all
collapse all
unified
split
pkgs
build-support
ocaml
default.nix
top-level
all-packages.nix
+36
pkgs/build-support/ocaml/default.nix
···
1
1
+
{ stdenv, writeText, ocaml, findlib, camlp4 }:
2
2
+
3
3
+
{ name, version, buildInputs ? [],
4
4
+
createFindlibDestdir ? true,
5
5
+
dontStrip ? true,
6
6
+
minimumSupportedOcamlVersion ? null,
7
7
+
hasSharedObjects ? false,
8
8
+
setupHook ? null,
9
9
+
meta ? {}, ...
10
10
+
}@args:
11
11
+
let
12
12
+
ocaml_version = (builtins.parseDrvName ocaml.name).version;
13
13
+
defaultMeta = {
14
14
+
platforms = ocaml.meta.platforms;
15
15
+
};
16
16
+
in
17
17
+
assert minimumSupportedOcamlVersion != null ->
18
18
+
stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml_version;
19
19
+
20
20
+
stdenv.mkDerivation (args // {
21
21
+
name = "ocaml-${name}-${version}";
22
22
+
23
23
+
buildInputs = [ ocaml findlib camlp4 ] ++ buildInputs;
24
24
+
25
25
+
setupHook = if setupHook == null && hasSharedObjects
26
26
+
then writeText "setupHook.sh" ''
27
27
+
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/${name}/"
28
28
+
''
29
29
+
else setupHook;
30
30
+
31
31
+
inherit ocaml_version;
32
32
+
inherit createFindlibDestdir;
33
33
+
inherit dontStrip;
34
34
+
35
35
+
meta = defaultMeta // meta;
36
36
+
})
+1
pkgs/top-level/all-packages.nix
···
4039
4039
ocaml_version = (builtins.parseDrvName ocaml.name).version;
4040
4040
in rec {
4041
4041
inherit ocaml;
4042
4042
+
buildOcaml = callPackage ../build-support/ocaml { };
4042
4043
4043
4044
acgtk = callPackage ../applications/science/logic/acgtk { };
4044
4045