2019-09-23 20:55:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib }:
|
|
|
|
|
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
|
|
then throw "camlpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2014-11-16 08:42:55 +00:00
|
|
|
|
2014-12-31 11:21:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-23 20:55:47 +01:00
|
|
|
version = "2.3";
|
2017-01-20 06:36:44 +00:00
|
|
|
name = "ocaml${ocaml.version}-camlpdf-${version}";
|
2019-09-23 20:55:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "camlpdf";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1z8h6bjzmlscr6h6kdvzj8kspifb4n9dg7zi54z1cv2qi03kr8dk";
|
2014-11-16 08:42:55 +00:00
|
|
|
};
|
|
|
|
|
2019-09-23 20:55:47 +01:00
|
|
|
buildInputs = [ ocaml findlib ];
|
2014-11-16 08:42:55 +00:00
|
|
|
|
|
|
|
# Version number in META file is wrong
|
|
|
|
patchPhase = ''
|
|
|
|
patch -p 0 META <<EOF
|
|
|
|
3c3
|
|
|
|
< version="1.7.1"
|
|
|
|
---
|
2014-12-31 11:21:55 +00:00
|
|
|
> version="${version}"
|
2014-11-16 08:42:55 +00:00
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An OCaml library for reading, writing and modifying PDF files";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/johnwhitington/camlpdf";
|
2014-11-16 08:42:55 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [vbgl];
|
|
|
|
};
|
|
|
|
}
|