2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
if lib.versionOlder ocaml.version "4.10"
|
2021-07-03 03:11:41 +00:00
|
|
|
then throw "cpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml${ocaml.version}-cpdf";
|
|
|
|
version = "2.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "cpdf-source";
|
|
|
|
rev = "v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256:1qmx229nij7g6qmiacmyy4mcgx3k9509p4slahivshqm79d6wiwl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
|
|
|
buildInputs = [ ncurses ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ camlpdf ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
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
|
|
|
description = "PDF Command Line Tools";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://www.coherentpdf.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "cpdf";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|