2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib }:
|
2019-09-23 21:55:47 +02:00
|
|
|
|
2022-04-25 22:35:24 +02:00
|
|
|
if lib.versionOlder ocaml.version "4.10"
|
2019-09-23 21:55:47 +02:00
|
|
|
then throw "camlpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2014-11-16 09:42:55 +01:00
|
|
|
|
2014-12-31 12:21:55 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-17 09:14:53 +01:00
|
|
|
version = "2.5";
|
2022-02-10 01:28:00 +01:00
|
|
|
pname = "ocaml${ocaml.version}-camlpdf";
|
|
|
|
|
2019-09-23 21:55:47 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "camlpdf";
|
|
|
|
rev = "v${version}";
|
2022-01-17 09:14:53 +01:00
|
|
|
sha256 = "sha256:1qmsa0xgi960y7r20mvf8hxiiml7l1908s4dm7nq262f19w51gsl";
|
2014-11-16 09:42:55 +01:00
|
|
|
};
|
|
|
|
|
2022-02-22 10:59:04 +01:00
|
|
|
nativeBuildInputs = [ which ocaml findlib ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2014-11-16 09:42:55 +01:00
|
|
|
|
2020-08-20 07:17:40 +02:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
|
|
|
|
'';
|
2014-11-16 09:42:55 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-11-16 09:42:55 +01:00
|
|
|
description = "An OCaml library for reading, writing and modifying PDF files";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/johnwhitington/camlpdf";
|
2014-11-16 09:42:55 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [vbgl];
|
|
|
|
};
|
|
|
|
}
|