about summary refs log tree commit diff
path: root/pkgs/applications/office/pdfmm/default.nix
blob: 08dd9eea9bbd66f3008fc4d009a837e8d3228845 (plain) (blame)
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
53
54
55
56
57
58
{ bash
, coreutils
, fetchFromGitHub
, ghostscript
, glibc
, gnome
, gnused
, lib
, resholve
, xorg
}:

resholve.mkDerivation rec {
  pname = "pdfmm";
  version = "unstable-2019-01-24";

  src = fetchFromGitHub {
    owner = "jpfleury";
    repo = pname;
    rev = "45ee7796659d23bb030bf06647f1af85e1d2b52d";
    hash = "sha256-TOISD/2g7MwnLrtpMnfr2Ln0IiwlJVNavWl4eh/uwN0=";
  };

  dontBuild = true;

  installPhase = ''
    install -Dm 0755 pdfmm $out/bin/pdfmm
  '';

  solutions.default = {
    scripts = [
      "bin/pdfmm"
    ];
    interpreter = "${bash}/bin/bash";
    inputs = [
      coreutils
      ghostscript
      glibc
      gnome.zenity
      gnused
      xorg.xmessage
    ];
    execer = [
      "cannot:${glibc.bin}/bin/locale"
      "cannot:${gnome.zenity}/bin/zenity"
      "cannot:${xorg.xmessage}/bin/xmessage"
    ];
    keep."$toutLu" = true;
  };

  meta = with lib; {
    description = "Graphical assistant to reduce the size of a PDF file";
    homepage = "https://github.com/jpfleury/pdfmm";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ urandom ];
    mainProgram = "pdfmm";
  };
}