summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-01-17 03:29:56 +0300
committerNikolay Amiantov <ab@fmap.me>2016-01-17 15:50:40 +0300
commita8b3e686d0f1c4fe4a8836f7cbd79639fe34fede (patch)
tree08de19871bd6ffc1e55c572f2a5d86958bc9d8d5 /pkgs/misc
parentfbd3ad83e513e394698e71c0371ffc712a6da79f (diff)
downloadnixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar.gz
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar.bz2
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar.lz
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar.xz
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.tar.zst
nixlib-a8b3e686d0f1c4fe4a8836f7cbd79639fe34fede.zip
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.
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/drivers/gutenprint/default.nix91
1 files changed, 27 insertions, 64 deletions
diff --git a/pkgs/misc/drivers/gutenprint/default.nix b/pkgs/misc/drivers/gutenprint/default.nix
index 98776c0c42b0..5be7f5ecff4d 100644
--- a/pkgs/misc/drivers/gutenprint/default.nix
+++ b/pkgs/misc/drivers/gutenprint/default.nix
@@ -1,78 +1,41 @@
 # this package was called gimp-print in the past
-{ fetchurl, stdenv, pkgconfig, composableDerivation, cups
-, libtiff, libpng, makeWrapper, openssl, gimp }:
+{ stdenv, lib, fetchurl, pkgconfig
+, ijs, makeWrapper
+, gimp2Support ? true, gimp
+, cupsSupport ? true, cups, libusb, perl
+}:
 
-let
-   version = "5.2.10";
-   inherit (composableDerivation) edf wwf;
-in
-
-composableDerivation.composableDerivation {} {
-  name = "gutenprint-${version}";
+stdenv.mkDerivation rec {
+  name = "gutenprint-5.2.11";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gimp-print/gutenprint-${version}.tar.bz2";
-    sha256 = "0n8f6vpadnagrp6yib3mca1c3lgwl4vmma16s44riyrd84mka7s3";
+    url = "mirror://sourceforge/gimp-print/${name}.tar.bz2";
+    sha256 = "1yadw96rgp1z0jv1wxrz6cds36nb693w3xlv596xw9r5w394r8y1";
   };
 
-  # gimp, gui is still not working (TODO)
-  buildInputs = [ makeWrapper openssl pkgconfig ];
+  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
+  ];
 
-  configureFlags = ["--enable-static-genppd"];
-  NIX_CFLAGS_COMPILE="-include stdio.h";
-  
-  #preConfigure = ''
-  #  configureFlags="--with-cups=$out/usr-cups $configureFlags"
-  #'';
-  
-  /*
-     is this recommended? without it this warning is printed:
+  enableParallelBuilding = true;
 
-            ***WARNING: Use of --disable-static-genppd or --disable-static
-                        when building CUPS is very dangerous.  The build may
-                        fail when building the PPD files, or may *SILENTLY*
-                        build incorrect PPD files or cause other problems.
-                        Please review the README and release notes carefully!
-  */
+  # Testing is very, very long.
+  # doCheck = true;
 
-  installPhase = ''
-    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
-  '';
+  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 = { 
+  meta = with stdenv.lib; {
     description = "Ghostscript and cups printer drivers";
     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;
-  };
-
 }