2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.10"
|
|
|
|
then throw "cpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
let version = "2.5"; in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocaml${ocaml.version}-cpdf-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "cpdf-source";
|
|
|
|
rev = "v${version}";
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "sha256:0ps6d78i5mp1gcigxfp9rxmjr1k00nkr37vllhr0rdyph97w41s1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ncurses ];
|
|
|
|
propagatedBuildInputs = [ camlpdf ];
|
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp cpdf $out/bin
|
|
|
|
mkdir -p $out/share/
|
|
|
|
cp -r doc $out/share
|
|
|
|
cp cpdfmanual.pdf $out/share/doc/cpdf/
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.coherentpdf.com/";
|
|
|
|
platforms = ocaml.meta.platforms or [];
|
|
|
|
description = "PDF Command Line Tools";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
};
|
|
|
|
}
|