2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
|
2015-01-30 14:39:08 +00:00
|
|
|
|
2021-06-24 06:57:32 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.10"
|
|
|
|
then throw "cpdf is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2022-02-10 00:28:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml${ocaml.version}-cpdf";
|
|
|
|
version = "2.5";
|
2015-01-30 14:39:08 +00:00
|
|
|
|
2019-09-23 19:55:58 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "johnwhitington";
|
|
|
|
repo = "cpdf-source";
|
|
|
|
rev = "v${version}";
|
2022-02-01 16:30:06 +00:00
|
|
|
sha256 = "sha256:1qmx229nij7g6qmiacmyy4mcgx3k9509p4slahivshqm79d6wiwl";
|
2015-01-30 14:39:08 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
|
|
|
buildInputs = [ ncurses ];
|
2015-01-30 14:39:08 +00:00
|
|
|
propagatedBuildInputs = [ camlpdf ];
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-06-24 06:57:32 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR
|
2015-01-30 14:39:08 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.coherentpdf.com/";
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-30 14:39:08 +00:00
|
|
|
description = "PDF Command Line Tools";
|
2018-07-08 21:11:19 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2015-01-30 14:39:08 +00:00
|
|
|
};
|
|
|
|
}
|