From 614e5a525ca8b31f562aeee43e1c9ca968576c71 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Jun 2011 12:40:58 +0000 Subject: [PATCH] * Clean up foomatic-filters. svn path=/nixpkgs/trunk/; revision=27470 --- .../misc/drivers/foomatic-filters/default.nix | 70 +++++++------------ 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/pkgs/misc/drivers/foomatic-filters/default.nix b/pkgs/misc/drivers/foomatic-filters/default.nix index 8ab451165e3a..867f4f440d54 100644 --- a/pkgs/misc/drivers/foomatic-filters/default.nix +++ b/pkgs/misc/drivers/foomatic-filters/default.nix @@ -1,54 +1,32 @@ -x@{builderDefsPackage - , perl, cups - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - []; +{ stdenv, fetchurl, perl, cups, coreutils, gnused }: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - baseName="foomatic-filters"; - version="4.0.6"; - name="${baseName}-${version}"; - url="http://www.openprinting.org/download/foomatic/${name}.tar.gz"; - hash="0wa9hlq7s99sh50kl6bj8j0vxrz7pcbwdnqs1yfjjhqshfh7hsav"; - }; -in -rec { - src = a.fetchurl { - url = sourceInfo.url; - sha256 = sourceInfo.hash; +stdenv.mkDerivation rec { + name = "foomatic-filters-4.0.6"; + + src = fetchurl { + url = "http://www.openprinting.org/download/foomatic/${name}.tar.gz"; + sha256 = "0wa9hlq7s99sh50kl6bj8j0vxrz7pcbwdnqs1yfjjhqshfh7hsav"; }; - inherit (sourceInfo) name version; - inherit buildInputs; + buildInputs = [ perl cups ]; - phaseNames = ["doConfigure" "fixPaths" "doMakeInstall"]; + preConfigure = + '' + substituteInPlace foomaticrip.c --replace /bin/bash /bin/sh + ''; + + installTargets = "install-cups"; + + installFlags = + '' + CUPS_FILTERS=$(out)/lib/cups/filter + CUPS_BACKENDS=$(out)/lib/cups/backend + ''; - fixPaths = a.fullDepEntry '' - sed -e "s@= .*/store/[^/]\+/lib/cups/filter@= $out/lib/cups/filter@" -i Makefile - sed -e "s@= .*/store/[^/]\+/lib/cups/backend@= $out/lib/cups/backend@" -i Makefile - sed -e "s@= /usr/@= $out/@" -i Makefile - sed -e "s@/bin/bash@/bin/sh@g" -i foomaticrip.c - '' ["doConfigure" "minInit"]; - meta = { description = "Foomatic printing filters"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; - license = a.lib.licenses.gpl2Plus; + maintainers = stdenv.lib.maintainers.raskin; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl2Plus; }; - passthru = { - updateInfo = { - downloadPage = "http://www.openprinting.org/download/foomatic/"; - }; - }; -}) x - +}