10 # note: this is not technically an ocaml-module,
11 # but can be built with different compilers, so
12 # the ocamlPackages set is very useful.
15 pname = "ocaml-freestanding";
18 if lib.versionOlder ocaml.version "4.08"
19 then builtins.throw "${pname} is not available for OCaml ${ocaml.version}"
22 stdenv.mkDerivation rec {
23 name = "ocaml${ocaml.version}-${pname}-${version}";
27 src = fetchFromGitHub {
31 sha256 = "sha256:1mbyjzwcs64n7i3xkkyaxgl3r46drbl0gkqf3fqgm2kh3q03638l";
35 # get ocaml-src from the ocaml drv instead of via ocamlfind
36 mkdir -p "${src.name}/ocaml"
37 tar --strip-components=1 -xf ${ocaml.src} -C "${src.name}/ocaml"
42 ./configurable-binding.patch
50 propagatedBuildInputs = [ solo5 ];
54 env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh
65 description = "Freestanding OCaml runtime";
66 license = licenses.mit;
67 maintainers = [ maintainers.sternenseemann ];
68 homepage = "https://github.com/mirage/ocaml-freestanding";
69 platforms = builtins.map ({ arch, os }: "${arch}-${os}")
70 (cartesianProductOfSets {
71 arch = [ "aarch64" "x86_64" ];
74 { arch = "x86_64"; os = "freebsd"; }
75 { arch = "x86_64"; os = "openbsd"; }