Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 ocaml, 6 findlib, 7 camlpdf, 8}: 9 10if lib.versionOlder ocaml.version "4.10" then 11 throw "cpdf is not available for OCaml ${ocaml.version}" 12else 13 14 stdenv.mkDerivation rec { 15 pname = "ocaml${ocaml.version}-cpdf"; 16 version = "2.8"; 17 18 src = fetchFromGitHub { 19 owner = "johnwhitington"; 20 repo = "cpdf-source"; 21 rev = "v${version}"; 22 hash = "sha256-DvTY5EQcvnL76RlQTcVqBiycqbCdGQCXzarSMH2P/pg="; 23 }; 24 25 nativeBuildInputs = [ 26 ocaml 27 findlib 28 ]; 29 propagatedBuildInputs = [ camlpdf ]; 30 31 strictDeps = true; 32 33 preInstall = '' 34 mkdir -p $OCAMLFIND_DESTDIR 35 mkdir -p $out/bin 36 cp cpdf $out/bin 37 mkdir -p $out/share/ 38 cp -r doc $out/share 39 cp cpdfmanual.pdf $out/share/doc/cpdf/ 40 ''; 41 42 meta = with lib; { 43 description = "PDF Command Line Tools"; 44 homepage = "https://www.coherentpdf.com/"; 45 license = licenses.agpl3Only; 46 maintainers = [ maintainers.vbgl ]; 47 mainProgram = "cpdf"; 48 inherit (ocaml.meta) platforms; 49 }; 50 }