summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/cpdf/default.nix
blob: 1d46ef2248ababa875d505e3b2611867e3ef7f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  lib,
  stdenv,
  fetchFromGitHub,
  ocaml,
  findlib,
  camlpdf,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ocaml${ocaml.version}-cpdf";
  version = "2.9.2";

  src = fetchFromGitHub {
    owner = "johnwhitington";
    repo = "cpdf-source";
    tag = "v${finalAttrs.version}";
    hash = "sha256-uhgriPA/y5nElQjbNtzx8CJ8O6ZORKCJAzXYrIOWd60=";
  };

  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/
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "PDF Command Line Tools";
    homepage = "https://www.coherentpdf.com/";
    changelog = "https://github.com/johnwhitington/cpdf-source/blob/${finalAttrs.src.rev}/Changes.txt";
    license = lib.licenses.agpl3Only;
    maintainers = with lib.maintainers; [ vbgl ];
    teams = with lib.teams; [ ngi ];
    mainProgram = "cpdf";
    inherit (ocaml.meta) platforms;
    broken = lib.versionOlder ocaml.version "4.10";
  };
})