aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/typesetting/pdftk/legacy.nix
blob: 5caafa054cf941cef28775ee2857be87599b34db (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
{ fetchurl, stdenv, gcj, unzip }:

stdenv.mkDerivation {
  name = "pdftk-2.02";

  src = fetchurl {
    url = "https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip";
    sha256 = "1hdq6zm2dx2f9h7bjrp6a1hfa1ywgkwydp14i2sszjiszljnm3qi";
  };

  nativeBuildInputs = [ gcj unzip ];

  hardeningDisable = [ "fortify" "format" ];

  preBuild = ''
    cd pdftk
    sed -e 's@/usr/bin/@@g' -i Makefile.*
    NIX_ENFORCE_PURITY= \
      make \
      LIBGCJ="${gcj.cc}/share/java/libgcj-${gcj.cc.version}.jar" \
      GCJ=gcj GCJH=gcjh GJAR=gjar \
      -iC ../java all
  '';

  # Makefile.Debian has almost fitting defaults
  makeFlags = [ "-f" "Makefile.Debian" "VERSUFF=" ];

  installPhase = ''
    mkdir -p $out/bin $out/share/man/man1
    cp pdftk $out/bin
    cp ../pdftk.1 $out/share/man/man1
  '';


  meta = {
    description = "Simple tool for doing everyday things with PDF documents";
    homepage = "https://www.pdflabs.com/tools/pdftk-server/";
    license = stdenv.lib.licenses.gpl2;
    maintainers = with stdenv.lib.maintainers; [raskin];
    platforms = with stdenv.lib.platforms; linux;
    broken = true; # Broken on Hydra since 2020-08-24
  };
}