From b364eac6bc63e11046b4e4ede316a7214dcfc65c Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 1 Jul 2013 17:22:16 +0100 Subject: [PATCH] Use correct colord device ID in gstoraster. --- ghostscript-cups-colord.patch | 29 +++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 ghostscript-cups-colord.patch diff --git a/ghostscript-cups-colord.patch b/ghostscript-cups-colord.patch new file mode 100644 index 0000000..9d3f4e0 --- /dev/null +++ b/ghostscript-cups-colord.patch @@ -0,0 +1,29 @@ +diff -up ghostscript-9.07/cups/gstoraster.c.cups-colord ghostscript-9.07/cups/gstoraster.c +--- ghostscript-9.07/cups/gstoraster.c.cups-colord 2013-07-01 17:06:10.977743028 +0100 ++++ ghostscript-9.07/cups/gstoraster.c 2013-07-01 17:18:36.597852666 +0100 +@@ -596,11 +596,21 @@ main (int argc, char **argv, char *envp[ + + qualifier = colord_get_qualifier_for_ppd (ppd); + if (qualifier != NULL) { ++ const char *env_printer = getenv("PRINTER"); ++ char *device_id; + +- fprintf(stderr, "DEBUG: PPD uses qualifier '%s.%s.%s'\n", +- qualifier[0], qualifier[1], qualifier[2]); +- icc_profile = colord_get_profile_for_device_id (getenv("PRINTER"), +- (const char**) qualifier); ++ if (env_printer) { ++ device_id = malloc (5 + strlen (env_printer) + 1); ++ if (device_id) { ++ strcpy (device_id, "cups-"); ++ strcpy (device_id + 5, env_printer); ++ fprintf(stderr, "DEBUG: PPD uses qualifier '%s.%s.%s'\n", ++ qualifier[0], qualifier[1], qualifier[2]); ++ icc_profile = colord_get_profile_for_device_id (device_id, ++ (const char**) qualifier); ++ free (device_id); ++ } ++ } + + /* fall back to the PPD */ + if (icc_profile == NULL) diff --git a/ghostscript.spec b/ghostscript.spec index 2cb9d6f..86622e5 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 7%{?dist} +Release: 8%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -29,6 +29,7 @@ Patch10: ghostscript-gs_sprintf.patch Patch11: ghostscript-pdfwrite-segfault.patch Patch12: ghostscript-strange-fonts.patch Patch13: ghostscript-wrf-snprintf.patch +Patch14: ghostscript-cups-colord.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -150,6 +151,9 @@ rm -rf expat freetype icclib jasper jpeg lcms2 libpng openjpeg zlib cups/libs # Use more caution when converting floats to strings (bug #980085). %patch13 -p1 -b .wrf-snprintf +# Use correct colord device ID in gstoraster. +%patch14 -p1 -b .cups-colord + # Remove pdfopt man pages which were mistakenly left in (bug #963882). rm man/{de/,}pdfopt.1 @@ -349,6 +353,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Mon Jul 1 2013 Tim Waugh 9.07-8 +- Use correct colord device ID in gstoraster. + * Mon Jul 1 2013 Tim Waugh 9.07-7 - Use more caution when converting floats to strings (bug #980085).