Files
nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
T
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

51 lines
1.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
ocaml,
findlib,
camlpdf,
}:
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.8";
src = fetchFromGitHub {
owner = "johnwhitington";
repo = "cpdf-source";
rev = "v${version}";
hash = "sha256-DvTY5EQcvnL76RlQTcVqBiycqbCdGQCXzarSMH2P/pg=";
};
nativeBuildInputs = [
ocaml
findlib
];
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/";
license = licenses.agpl3Only;
maintainers = [ maintainers.vbgl ];
mainProgram = "cpdf";
inherit (ocaml.meta) platforms;
};
}