2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.10"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "camlpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "2.5";
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "ocaml${ocaml.version}-camlpdf";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "camlpdf";
|
|
|
|
rev = "v${version}";
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "sha256:1qmsa0xgi960y7r20mvf8hxiiml7l1908s4dm7nq262f19w51gsl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ which ocaml findlib ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An OCaml library for reading, writing and modifying PDF files";
|
|
|
|
homepage = "https://github.com/johnwhitington/camlpdf";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [vbgl];
|
|
|
|
};
|
|
|
|
}
|