Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, ocaml, findlib }: 2 3lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08") 4 "ocamlscript is not available for OCaml ${ocaml.version}" 5 6stdenv.mkDerivation rec { 7 pname = "ocaml${ocaml.version}-ocamlscript"; 8 version = "3.0.0"; 9 src = fetchFromGitHub { 10 owner = "mjambon"; 11 repo = "ocamlscript"; 12 rev = "v${version}"; 13 sha256 = "sha256:10xz8jknlmcgnf233nahd04q98ijnxpijhpvb8hl7sv94dgkvpql"; 14 }; 15 16 nativeBuildInputs = [ ocaml findlib ]; 17 18 patches = [ ./Makefile.patch ]; 19 20 buildFlags = [ "PREFIX=$(out)" ]; 21 installFlags = [ "PREFIX=$(out)" ]; 22 23 preInstall = "mkdir -p $out/bin"; 24 createFindlibDestdir = true; 25 26 meta = with lib; { 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"; 33 }; 34}