2009-08-28 00:32:13 +01:00
|
|
|
# this package was called gimp-print in the past
|
2021-01-17 02:30:45 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, pkg-config
|
2017-11-29 10:08:37 +00:00
|
|
|
, ijs, zlib
|
2016-02-26 14:14:21 +00:00
|
|
|
, gimp2Support ? false, gimp
|
2020-04-28 04:29:39 +01:00
|
|
|
, cupsSupport ? true, cups, libusb-compat-0_1, perl
|
2016-01-17 00:29:56 +00:00
|
|
|
}:
|
2009-08-28 00:32:13 +01:00
|
|
|
|
2016-01-17 00:29:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-12 03:37:53 +00:00
|
|
|
name = "gutenprint-5.3.4";
|
2009-08-28 00:32:13 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-01-17 00:29:56 +00:00
|
|
|
url = "mirror://sourceforge/gimp-print/${name}.tar.bz2";
|
2020-12-12 03:37:53 +00:00
|
|
|
sha256 = "0s0b14hjwvbxksq7af5v8z9g2rfqv9jdmxd9d81m57f5mh6rad0p";
|
2009-08-28 00:32:13 +01:00
|
|
|
};
|
|
|
|
|
2021-01-17 02:30:45 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2016-01-17 00:29:56 +00:00
|
|
|
buildInputs =
|
2017-11-29 10:08:37 +00:00
|
|
|
[ ijs zlib ]
|
2016-01-17 00:29:56 +00:00
|
|
|
++ lib.optionals gimp2Support [ gimp.gtk gimp ]
|
2020-04-28 04:29:39 +01:00
|
|
|
++ lib.optionals cupsSupport [ cups libusb-compat-0_1 perl ];
|
2016-01-17 00:29:56 +00:00
|
|
|
|
|
|
|
configureFlags = lib.optionals cupsSupport [
|
|
|
|
"--disable-static-genppd" # should be harmless on NixOS
|
|
|
|
];
|
2009-08-28 00:32:13 +01:00
|
|
|
|
2016-02-26 14:14:21 +00:00
|
|
|
# FIXME: hacky because we modify generated configure, but I haven't found a better way.
|
|
|
|
# makeFlags doesn't change this everywhere (e.g. in cups-genppdupdate).
|
|
|
|
preConfigure = lib.optionalString cupsSupport ''
|
|
|
|
sed -i \
|
|
|
|
-e "s,cups_conf_datadir=.*,cups_conf_datadir=\"$out/share/cups\",g" \
|
|
|
|
-e "s,cups_conf_serverbin=.*,cups_conf_serverbin=\"$out/lib/cups\",g" \
|
|
|
|
-e "s,cups_conf_serverroot=.*,cups_conf_serverroot=\"$out/etc/cups\",g" \
|
|
|
|
configure
|
|
|
|
'' + lib.optionalString gimp2Support ''
|
|
|
|
sed -i \
|
|
|
|
-e "s,gimp2_plug_indir=.*,gimp2_plug_indir=\"$out/lib/gimp/${gimp.majorVersion}\",g" \
|
|
|
|
configure
|
|
|
|
'';
|
|
|
|
|
2016-01-17 00:29:56 +00:00
|
|
|
enableParallelBuilding = true;
|
2009-08-28 00:32:13 +01:00
|
|
|
|
2016-01-17 00:29:56 +00:00
|
|
|
# Testing is very, very long.
|
|
|
|
# doCheck = true;
|
2009-08-28 00:32:13 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2009-08-28 00:32:13 +01:00
|
|
|
description = "Ghostscript and cups printer drivers";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://sourceforge.net/projects/gimp-print/";
|
2016-01-17 00:29:56 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2017-08-20 12:20:45 +01:00
|
|
|
isGutenprint = true;
|
2009-08-28 00:32:13 +01:00
|
|
|
};
|
|
|
|
}
|