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
52 propagatedBuildInputs = [ solo5 ];
56 env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh
67 broken = true; # Not compatible with solo5 ≥ 0.7
68 description = "Freestanding OCaml runtime";
69 license = licenses.mit;
70 maintainers = [ maintainers.sternenseemann ];
71 homepage = "https://github.com/mirage/ocaml-freestanding";
72 platforms = builtins.map ({ arch, os }: "${arch}-${os}")
74 arch = [ "aarch64" "x86_64" ];
77 { arch = "x86_64"; os = "freebsd"; }
78 { arch = "x86_64"; os = "openbsd"; }