nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
if lib.versionOlder ocaml.version "4.10"
then throw "cpdf is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-cpdf";
version = "2.5";
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";
};
nativeBuildInputs = [ ocaml findlib ];
buildInputs = [ ncurses ];
propagatedBuildInputs = [ camlpdf ];
strictDeps = true;
preInstall = ''
mkdir -p $OCAMLFIND_DESTDIR
mkdir -p $out/bin
cp cpdf $out/bin
mkdir -p $out/share/
cp -r doc $out/share
cp cpdfmanual.pdf $out/share/doc/cpdf/
'';
meta = with lib; {
description = "PDF Command Line Tools";
homepage = "https://www.coherentpdf.com/";
2018-07-08 21:11:19 +00:00
license = licenses.unfree;
maintainers = [ maintainers.vbgl ];
mainProgram = "cpdf";
inherit (ocaml.meta) platforms;
};
}