1 { lib, stdenv, fetchFromGitHub, ocaml, findlib }:
3 lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
4 "ocamlscript is not available for OCaml ${ocaml.version}"
6 stdenv.mkDerivation rec {
7 pname = "ocaml${ocaml.version}-ocamlscript";
9 src = fetchFromGitHub {
13 sha256 = "sha256:10xz8jknlmcgnf233nahd04q98ijnxpijhpvb8hl7sv94dgkvpql";
16 nativeBuildInputs = [ ocaml findlib ];
18 patches = [ ./Makefile.patch ];
20 buildFlags = [ "PREFIX=$(out)" ];
21 installFlags = [ "PREFIX=$(out)" ];
23 preInstall = "mkdir -p $out/bin";
24 createFindlibDestdir = true;
27 inherit (src.meta) homepage;
28 license = licenses.boost;
29 inherit (ocaml.meta) platforms;
30 description = "Natively-compiled OCaml scripts";
31 maintainers = [ maintainers.vbgl ];
32 mainProgram = "ocamlscript";