1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 ocaml,
6 findlib,
7 astring,
8 pprint,
9}:
10
11if lib.versionOlder ocaml.version "4.02" then
12 throw "ocp-ocamlres is not available for OCaml ${ocaml.version}"
13else
14
15 stdenv.mkDerivation rec {
16 pname = "ocaml${ocaml.version}-ocp-ocamlres";
17 version = "0.4";
18 src = fetchFromGitHub {
19 owner = "OCamlPro";
20 repo = "ocp-ocamlres";
21 rev = "v${version}";
22 sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn";
23 };
24
25 nativeBuildInputs = [
26 ocaml
27 findlib
28 ];
29 buildInputs = [
30 astring
31 pprint
32 ];
33
34 strictDeps = true;
35
36 createFindlibDestdir = true;
37
38 installFlags = [ "BINDIR=$(out)/bin" ];
39 preInstall = "mkdir -p $out/bin";
40
41 meta = {
42 description = "Simple tool and library to embed files and directories inside OCaml executables";
43 homepage = "https://www.typerex.org/ocp-ocamlres.html";
44 license = lib.licenses.lgpl3Plus;
45 maintainers = [ lib.maintainers.vbgl ];
46 mainProgram = "ocp-ocamlres";
47 inherit (ocaml.meta) platforms;
48 };
49 }