2021-12-02 08:28:21 +00:00
|
|
|
{ lib
|
|
|
|
, avahi
|
|
|
|
, bc
|
|
|
|
, coreutils
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, dejavu_fonts
|
|
|
|
, fetchurl
|
|
|
|
, fontconfig
|
|
|
|
, gawk
|
|
|
|
, ghostscript
|
|
|
|
, gnugrep
|
|
|
|
, gnused
|
|
|
|
, ijs
|
|
|
|
, libjpeg
|
|
|
|
, liblouis
|
|
|
|
, libpng
|
|
|
|
, makeWrapper
|
|
|
|
, mupdf
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, poppler
|
|
|
|
, poppler_utils
|
|
|
|
, qpdf
|
|
|
|
, stdenv
|
|
|
|
, which
|
2021-12-02 08:30:27 +00:00
|
|
|
, withAvahi ? true
|
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
|
2021-12-02 08:28:21 +00:00
|
|
|
binPath = lib.makeBinPath [ bc coreutils gawk gnused gnugrep which ];
|
2016-01-13 16:07:59 +00:00
|
|
|
|
2021-12-02 08:28:21 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cups-filters";
|
2022-07-07 21:16:50 +00:00
|
|
|
version = "1.28.15";
|
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";
|
2022-07-07 21:16:50 +00:00
|
|
|
sha256 = "sha256-qQfsdp+7cu+/v5tUCyUKCOM7bjc6inw0P5hA+6TQR4s=";
|
2014-11-23 16:51:55 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 02:30:45 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2015-04-02 11:58:09 +00:00
|
|
|
|
2014-12-16 15:20:08 +00:00
|
|
|
buildInputs = [
|
2021-12-02 08:28:21 +00:00
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
fontconfig
|
|
|
|
ghostscript
|
|
|
|
ijs
|
|
|
|
libjpeg
|
2021-09-22 00:33:47 +00:00
|
|
|
liblouis # braille embosser support
|
2021-12-02 08:28:21 +00:00
|
|
|
libpng
|
|
|
|
mupdf
|
|
|
|
perl
|
|
|
|
poppler
|
|
|
|
poppler_utils
|
|
|
|
qpdf
|
2021-12-02 08:30:27 +00:00
|
|
|
] ++ lib.optionals withAvahi [ avahi ];
|
2014-11-23 16:51:55 +00:00
|
|
|
|
2015-07-21 18:53:55 +00:00
|
|
|
configureFlags = [
|
2021-10-02 17:16:33 +00:00
|
|
|
"--with-mutool-path=${mupdf}/bin/mutool"
|
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}"
|
2021-09-22 00:33:47 +00:00
|
|
|
"--with-test-font-path=${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf"
|
2021-10-02 17:16:33 +00:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
2021-12-02 08:30:27 +00:00
|
|
|
] ++ lib.optionals (!withAvahi) [ "--disable-avahi" ];
|
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;
|
2021-09-22 00:33:47 +00:00
|
|
|
doCheck = true;
|
2016-01-13 16:07:59 +00:00
|
|
|
|
2014-11-23 16:51:55 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters";
|
2014-11-23 16:51:55 +00:00
|
|
|
description = "Backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
2014-11-23 16:51:55 +00:00
|
|
|
};
|
|
|
|
}
|