2021-01-17 02:30:45 +00:00
|
|
|
{ lib, stdenv, fetchpatch, fetchurl, pkg-config, perl, cups, dbus, enscript }:
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2011-06-15 12:40:58 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-08-12 21:00:21 +00:00
|
|
|
pname = "foomatic-filters";
|
|
|
|
version = "4.0.17";
|
2011-06-15 12:40:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-12 21:00:21 +00:00
|
|
|
url = "https://www.openprinting.org/download/foomatic/foomatic-filters-${version}.tar.gz";
|
2013-12-18 13:58:25 +00:00
|
|
|
sha256 = "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2";
|
2011-01-28 08:44:31 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 02:30:45 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = [ perl cups dbus enscript ];
|
2011-06-15 12:40:58 +00:00
|
|
|
|
2017-10-09 19:22:34 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2020-05-06 21:18:09 +00:00
|
|
|
name = "CVE-2015-8327+CVE-2015-8560.patch";
|
2019-10-04 10:42:21 +00:00
|
|
|
url = "https://salsa.debian.org/debian/foomatic-filters/raw/a3abbef2d2f8c7e62d2fe64f64afe294563fdf8f/debian/patches/0500-r7406_also_consider_the_back_tick_as_an_illegal_shell_escape_character.patch";
|
2017-10-09 19:22:34 +00:00
|
|
|
sha256 = "055nwi3sjf578nk40bqsch3wx8m2h65hdih0wmxflb6l0hwkq4p4";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2011-06-15 12:40:58 +00:00
|
|
|
preConfigure =
|
|
|
|
''
|
2019-01-15 22:41:31 +00:00
|
|
|
substituteInPlace foomaticrip.c --replace /bin/bash ${stdenv.shell}
|
2011-06-15 12:40:58 +00:00
|
|
|
'';
|
2011-01-28 08:44:31 +00:00
|
|
|
|
2022-05-14 11:12:07 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: foomatic_rip-options.o:/build/foomatic-filters-4.0.17/options.c:49: multiple definition of
|
|
|
|
# `cupsfilter'; foomatic_rip-foomaticrip.o:/build/foomatic-filters-4.0.17/foomaticrip.c:158: first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-05-14 11:12:07 +00:00
|
|
|
|
2019-11-04 11:23:53 +00:00
|
|
|
installTargets = [ "install-cups" ];
|
2011-06-15 12:40:58 +00:00
|
|
|
|
2019-11-05 01:10:31 +00:00
|
|
|
installFlags = [
|
|
|
|
"CUPS_FILTERS=$(out)/lib/cups/filter"
|
|
|
|
"CUPS_BACKENDS=$(out)/lib/cups/backend"
|
|
|
|
];
|
2011-01-28 08:44:31 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Foomatic printing filters";
|
2021-01-15 13:21:58 +00:00
|
|
|
maintainers = [ lib.maintainers.raskin ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2011-01-28 08:44:31 +00:00
|
|
|
};
|
2011-06-15 12:40:58 +00:00
|
|
|
}
|