2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
|
|
|
|
|
|
|
|
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
|
|
|
|
"ocamlscript is not available for OCaml ${ocaml.version}"
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "ocaml${ocaml.version}-ocamlscript";
|
|
|
|
version = "3.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mjambon";
|
|
|
|
repo = "ocamlscript";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256:10xz8jknlmcgnf233nahd04q98ijnxpijhpvb8hl7sv94dgkvpql";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
propagatedBuildInputs = [ ocaml findlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [ ./Makefile.patch ];
|
|
|
|
|
|
|
|
buildFlags = [ "PREFIX=$(out)" ];
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
preInstall = "mkdir -p $out/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-03-30 09:31:56 +00:00
|
|
|
inherit (src.meta) homepage;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.boost;
|
2022-03-30 09:31:56 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Natively-compiled OCaml scripts";
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
};
|
|
|
|
}
|