add an ocaml specific builder to the system

+37
+36
pkgs/build-support/ocaml/default.nix
···
··· 1 + { stdenv, writeText, ocaml, findlib, camlp4 }: 2 + 3 + { name, version, buildInputs ? [], 4 + createFindlibDestdir ? true, 5 + dontStrip ? true, 6 + minimumSupportedOcamlVersion ? null, 7 + hasSharedObjects ? false, 8 + setupHook ? null, 9 + meta ? {}, ... 10 + }@args: 11 + let 12 + ocaml_version = (builtins.parseDrvName ocaml.name).version; 13 + defaultMeta = { 14 + platforms = ocaml.meta.platforms; 15 + }; 16 + in 17 + assert minimumSupportedOcamlVersion != null -> 18 + stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml_version; 19 + 20 + stdenv.mkDerivation (args // { 21 + name = "ocaml-${name}-${version}"; 22 + 23 + buildInputs = [ ocaml findlib camlp4 ] ++ buildInputs; 24 + 25 + setupHook = if setupHook == null && hasSharedObjects 26 + then writeText "setupHook.sh" '' 27 + export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/${name}/" 28 + '' 29 + else setupHook; 30 + 31 + inherit ocaml_version; 32 + inherit createFindlibDestdir; 33 + inherit dontStrip; 34 + 35 + meta = defaultMeta // meta; 36 + })
+1
pkgs/top-level/all-packages.nix
··· 4039 ocaml_version = (builtins.parseDrvName ocaml.name).version; 4040 in rec { 4041 inherit ocaml; 4042 4043 acgtk = callPackage ../applications/science/logic/acgtk { }; 4044
··· 4039 ocaml_version = (builtins.parseDrvName ocaml.name).version; 4040 in rec { 4041 inherit ocaml; 4042 + buildOcaml = callPackage ../build-support/ocaml { }; 4043 4044 acgtk = callPackage ../applications/science/logic/acgtk { }; 4045