1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 ocaml,
6 findlib,
7}:
8
9if lib.versionOlder ocaml.version "4.10" then
10 throw "camlpdf is not available for OCaml ${ocaml.version}"
11else
12
13 stdenv.mkDerivation rec {
14 version = "2.8";
15 pname = "ocaml${ocaml.version}-camlpdf";
16
17 src = fetchFromGitHub {
18 owner = "johnwhitington";
19 repo = "camlpdf";
20 rev = "v${version}";
21 hash = "sha256-+SFuFqlrP0nwm199y0QFWYvlwD+Cbh0PHA5bmXIWdNk=";
22 };
23
24 nativeBuildInputs = [
25 ocaml
26 findlib
27 ];
28
29 strictDeps = true;
30
31 preInstall = ''
32 mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
33 '';
34
35 meta = with lib; {
36 description = "OCaml library for reading, writing and modifying PDF files";
37 homepage = "https://github.com/johnwhitington/camlpdf";
38 license = licenses.lgpl21Plus;
39 maintainers = with maintainers; [ vbgl ];
40 };
41 }