2016-01-13 16:07:59 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, cups, poppler, poppler_utils, fontconfig
|
2018-07-21 00:44:44 +00:00
|
|
|
, libjpeg, libpng, perl, ijs, qpdf, dbus, avahi
|
2017-05-24 09:40:16 +00:00
|
|
|
, makeWrapper, coreutils, gnused, bc, gawk, gnugrep, which, ghostscript
|
|
|
|
, mupdf
|
2016-01-13 16:07:59 +00:00
|
|
|
}:
|
2014-11-23 16:51:55 +00:00
|
|
|
|
2016-01-13 16:07:59 +00:00
|
|
|
let
|
2016-04-13 12:53:51 +00:00
|
|
|
binPath = stdenv.lib.makeBinPath [ coreutils gnused bc gawk gnugrep which ];
|
2016-01-13 16:07:59 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cups-filters";
|
2019-11-25 22:14:11 +00:00
|
|
|
version = "1.25.12";
|
2014-11-23 16:51:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://openprinting.org/download/cups-filters/${pname}-${version}.tar.xz";
|
2019-11-25 22:14:11 +00:00
|
|
|
sha256 = "1kv25011iyzvd33n5zmmn1z2p6pzk26hmmw6qvjjnx8p3sp7raqn";
|
2014-11-23 16:51:55 +00:00
|
|
|
};
|
|
|
|
|
2016-01-13 16:07:59 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
2015-04-02 11:58:09 +00:00
|
|
|
|
2014-12-16 15:20:08 +00:00
|
|
|
buildInputs = [
|
2016-01-13 16:07:59 +00:00
|
|
|
cups poppler poppler_utils fontconfig libjpeg libpng perl
|
2017-05-24 09:40:16 +00:00
|
|
|
ijs qpdf dbus avahi ghostscript mupdf
|
2014-11-23 16:51:55 +00:00
|
|
|
];
|
|
|
|
|
2015-07-21 18:53:55 +00:00
|
|
|
configureFlags = [
|
2018-11-12 17:09:10 +00:00
|
|
|
# TODO(Profpatsch): mupdf support
|
2015-07-21 18:53:55 +00:00
|
|
|
"--with-pdftops=pdftops"
|
2017-06-12 09:19:40 +00:00
|
|
|
"--with-pdftops-path=${poppler_utils}/bin/pdftops"
|
2018-11-12 17:09:10 +00:00
|
|
|
"--with-gs-path=${ghostscript}/bin/gs"
|
|
|
|
"--with-pdftocairo-path=${poppler_utils}/bin/pdftocairo"
|
|
|
|
"--with-ippfind-path=${cups}/bin/ippfind"
|
2015-07-21 18:53:55 +00:00
|
|
|
"--enable-imagefilters"
|
|
|
|
"--with-rcdir=no"
|
|
|
|
"--with-shell=${stdenv.shell}"
|
2016-01-13 16:07:59 +00:00
|
|
|
"--with-test-font-path=/path-does-not-exist"
|
2015-07-21 18:53:55 +00:00
|
|
|
];
|
2014-12-16 15:20:08 +00:00
|
|
|
|
2016-01-13 16:07:59 +00:00
|
|
|
makeFlags = [ "CUPS_SERVERBIN=$(out)/lib/cups" "CUPS_DATADIR=$(out)/share/cups" "CUPS_SERVERROOT=$(out)/etc/cups" ];
|
2014-11-23 16:51:55 +00:00
|
|
|
|
2014-12-16 15:20:08 +00:00
|
|
|
postConfigure =
|
|
|
|
''
|
2014-12-16 17:15:52 +00:00
|
|
|
# Ensure that bannertopdf can find the PDF templates in
|
|
|
|
# $out. (By default, it assumes that cups and cups-filters are
|
|
|
|
# installed in the same prefix.)
|
2016-08-23 01:33:36 +00:00
|
|
|
substituteInPlace config.h --replace ${cups.out}/share/cups/data $out/share/cups/data
|
2014-12-16 17:15:52 +00:00
|
|
|
|
|
|
|
# Ensure that gstoraster can find gs in $PATH.
|
|
|
|
substituteInPlace filter/gstoraster.c --replace execve execvpe
|
2017-05-24 09:40:16 +00:00
|
|
|
|
|
|
|
# Patch shebangs of generated build scripts
|
|
|
|
patchShebangs filter
|
2014-12-16 15:20:08 +00:00
|
|
|
'';
|
|
|
|
|
2014-12-16 15:41:35 +00:00
|
|
|
postInstall =
|
|
|
|
''
|
2016-01-13 16:07:59 +00:00
|
|
|
for i in $out/lib/cups/filter/*; do
|
|
|
|
wrapProgram "$i" --prefix PATH ':' ${binPath}
|
2014-12-16 15:41:35 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2016-01-13 16:07:59 +00:00
|
|
|
enableParallelBuilding = true;
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # fails 4 out of 6 tests
|
2016-01-13 16:07:59 +00:00
|
|
|
|
2014-11-23 16:51:55 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters;
|
|
|
|
description = "Backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|