summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix
blob: d084e7f8a62e3cdae0353fa94bae7f0ba6907645 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }:

if lib.versionOlder ocaml.version "4.02"
then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation rec {
  pname = "ocaml${ocaml.version}-ocp-ocamlres";
  version = "0.4";
  src = fetchFromGitHub {
    owner = "OCamlPro";
    repo = "ocp-ocamlres";
    rev = "v${version}";
    sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn";
  };

  nativeBuildInputs = [ ocaml findlib ];
  buildInputs = [ astring pprint ];

  strictDeps = true;

  createFindlibDestdir = true;

  installFlags = [ "BINDIR=$(out)/bin" ];
  preInstall = "mkdir -p $out/bin";

  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;
  };
}