gutenprint: 5.2.10 -> 5.2.11

Rework gutenprint derivation:

* Convert to regular stdenv.mkDerivation;
* Enable IJS driver;
* Fix cups-genppdupdate;
* Move things around to the proper directories;
* Enable parallel building;
* Clean from old hacks.
This commit is contained in:
Nikolay Amiantov 2016-01-17 03:29:56 +03:00
parent fbd3ad83e5
commit a8b3e686d0

View File

@ -1,78 +1,41 @@
# this package was called gimp-print in the past # this package was called gimp-print in the past
{ fetchurl, stdenv, pkgconfig, composableDerivation, cups { stdenv, lib, fetchurl, pkgconfig
, libtiff, libpng, makeWrapper, openssl, gimp }: , ijs, makeWrapper
, gimp2Support ? true, gimp
, cupsSupport ? true, cups, libusb, perl
}:
let stdenv.mkDerivation rec {
version = "5.2.10"; name = "gutenprint-5.2.11";
inherit (composableDerivation) edf wwf;
in
composableDerivation.composableDerivation {} {
name = "gutenprint-${version}";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/gimp-print/gutenprint-${version}.tar.bz2"; url = "mirror://sourceforge/gimp-print/${name}.tar.bz2";
sha256 = "0n8f6vpadnagrp6yib3mca1c3lgwl4vmma16s44riyrd84mka7s3"; sha256 = "1yadw96rgp1z0jv1wxrz6cds36nb693w3xlv596xw9r5w394r8y1";
}; };
# gimp, gui is still not working (TODO) nativeBuildInputs = [ makeWrapper pkgconfig ];
buildInputs = [ makeWrapper openssl pkgconfig ]; buildInputs =
[ ijs ]
++ lib.optionals gimp2Support [ gimp.gtk gimp ]
++ lib.optionals cupsSupport [ cups libusb perl ];
configureFlags = ["--enable-static-genppd"]; configureFlags = lib.optionals cupsSupport [
NIX_CFLAGS_COMPILE="-include stdio.h"; "--disable-static-genppd" # should be harmless on NixOS
];
#preConfigure = '' enableParallelBuilding = true;
# configureFlags="--with-cups=$out/usr-cups $configureFlags"
#'';
/* # Testing is very, very long.
is this recommended? without it this warning is printed: # doCheck = true;
***WARNING: Use of --disable-static-genppd or --disable-static installFlags =
when building CUPS is very dangerous. The build may lib.optionals cupsSupport [ "cups_conf_datadir=$(out)/share/cups" "cups_conf_serverbin=$(out)/lib/cups" "cups_conf_serverroot=$(out)/etc/cups" ]
fail when building the PPD files, or may *SILENTLY* ++ lib.optionals gimp2Support [ "gimp2_plug_indir=$(out)/${gimp.name}-plugins" ];
build incorrect PPD files or cause other problems.
Please review the README and release notes carefully!
*/
installPhase = '' meta = with stdenv.lib; {
eval "make install $installArgs"
mkdir -p $out/lib/cups
ln -s $out/filter $out/lib/cups/
wrapProgram $out/filter/rastertogutenprint.5.2 --prefix LD_LIBRARY_PATH : $out/lib
wrapProgram $out/sbin/cups-genppd.5.2 --prefix LD_LIBRARY_PATH : $out/lib
'';
meta = {
description = "Ghostscript and cups printer drivers"; description = "Ghostscript and cups printer drivers";
homepage = http://sourceforge.net/projects/gimp-print/; homepage = http://sourceforge.net/projects/gimp-print/;
license = "GPL"; license = licenses.gpl2;
}; platforms = platforms.linux;
mergeAttrBy = { installArgs = stdenv.lib.concat; };
# most interpreters aren't tested yet.. (see python for example how to do it)
flags =
wwf {
name = "gimp2";
enable = {
buildInputs = [gimp gimp.gtk];
installArgs = [ "gimp2_plug_indir=$out/${gimp.name}-plugins" ];
}; };
} }
// {
cups = {
set = {
buildInputs = [cups libtiff libpng ];
installArgs = [ "cups_conf_datadir=$out cups_conf_serverbin=$out cups_conf_serverroot=$out"];
};
};
}
;
cfg = {
gimp2Support = true;
cupsSupport = true;
};
}