2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.02"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "ocaml${ocaml.version}-ocp-ocamlres";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "0.4";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OCamlPro";
|
|
|
|
repo = "ocp-ocamlres";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
|
|
|
buildInputs = [ astring pprint ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
createFindlibDestdir = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
installFlags = [ "BINDIR=$(out)/bin" ];
|
|
|
|
preInstall = "mkdir -p $out/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = {
|
|
|
|
description = "A simple tool and library to embed files and directories inside OCaml executables";
|
|
|
|
license = lib.licenses.lgpl3Plus;
|
|
|
|
homepage = "https://www.typerex.org/ocp-ocamlres.html";
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|