summary refs log tree commit diff
path: root/pkgs/misc/drivers/gutenprint/default.nix
blob: 5be7f5ecff4d114bf7d37f658986e109792224f3 (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
# this package was called gimp-print in the past
{ stdenv, lib, fetchurl, pkgconfig
, ijs, makeWrapper
, gimp2Support ? true, gimp
, cupsSupport ? true, cups, libusb, perl
}:

stdenv.mkDerivation rec {
  name = "gutenprint-5.2.11";

  src = fetchurl {
    url = "mirror://sourceforge/gimp-print/${name}.tar.bz2";
    sha256 = "1yadw96rgp1z0jv1wxrz6cds36nb693w3xlv596xw9r5w394r8y1";
  };

  nativeBuildInputs = [ makeWrapper pkgconfig ];
  buildInputs =
    [ ijs ]
    ++ lib.optionals gimp2Support [ gimp.gtk gimp ]
    ++ lib.optionals cupsSupport [ cups libusb perl ];

  configureFlags = lib.optionals cupsSupport [
    "--disable-static-genppd" # should be harmless on NixOS
  ];

  enableParallelBuilding = true;

  # Testing is very, very long.
  # doCheck = true;

  installFlags =
    lib.optionals cupsSupport [ "cups_conf_datadir=$(out)/share/cups" "cups_conf_serverbin=$(out)/lib/cups" "cups_conf_serverroot=$(out)/etc/cups" ]
    ++ lib.optionals gimp2Support [ "gimp2_plug_indir=$(out)/${gimp.name}-plugins" ];

  meta = with stdenv.lib; {
    description = "Ghostscript and cups printer drivers";
    homepage = http://sourceforge.net/projects/gimp-print/;
    license = licenses.gpl2;
    platforms = platforms.linux;
  };
}