From c7d686002c53df8dda71aaf1b0ecb17497a19090 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 26 Mar 2014 12:21:25 +0000 Subject: [PATCH] 9.12 (bug #1080814). - Fix build when using system zlib. Resolves: rhbz#1080814 --- .gitignore | 1 + ghostscript-duplex.patch | 66 ---------------------------- ghostscript-gs694154.patch | 20 ++------- ghostscript-gs694809.patch | 37 ---------------- ghostscript-icc-missing-check.patch | 10 ++--- ghostscript-runlibfileifexists.patch | 16 +++---- ghostscript-sys-zlib.patch | 24 ++++++++++ ghostscript.spec | 20 ++++----- sources | 2 +- 9 files changed, 53 insertions(+), 143 deletions(-) delete mode 100644 ghostscript-duplex.patch delete mode 100644 ghostscript-gs694809.patch create mode 100644 ghostscript-sys-zlib.patch diff --git a/.gitignore b/.gitignore index ab84514..106f737 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ ghostscript-8.71.tar.xz /ghostscript-9.09.tar.bz2 /ghostscript-9.10.tar.bz2 /ghostscript-9.10-cleaned.tar.bz2 +/ghostscript-9.12-cleaned.tar.bz2 diff --git a/ghostscript-duplex.patch b/ghostscript-duplex.patch deleted file mode 100644 index cf261cf..0000000 --- a/ghostscript-duplex.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff -up ghostscript-9.10/devices/vector/opdfread.h.duplex ghostscript-9.10/devices/vector/opdfread.h ---- ghostscript-9.10/devices/vector/opdfread.h.duplex 2013-08-30 11:37:28.000000000 +0100 -+++ ghostscript-9.10/devices/vector/opdfread.h 2014-02-27 15:59:45.986847087 +0000 -@@ -734,10 +734,27 @@ const char *opdfread_ps [] = { - "0 0}ifelse\n", - "round cvi 2 index round cvi eq\n", - "exch round cvi 3 index round cvi eq and{\n", -+"//PDFR_DEBUG{(PageSize matches request) == flush}if\n", - "pop pop}{\n", -+"/MediaRequested where {\n", -+"//PDFR_DEBUG{(MediaRequested is true, check against new request) == flush}if\n", -+"/MediaRequested get aload pop\n", -+"round cvi 2 index round cvi eq\n", -+"exch round cvi 3 index round cvi eq and\n", -+"{//PDFR_DEBUG{(MediaRequested same as current request, ignore) == flush}if pop pop false}\n", -+"{//PDFR_DEBUG{(MediaRequested different to current request) == flush}if true}ifelse\n", -+"}{\n", -+"//PDFR_DEBUG{(No MediaRequested yet) == flush}if\n", -+"true\n", -+"}ifelse\n", -+"{\n", -+"//PDFR_DEBUG{(Setting pagesize) == flush}if\n", - "2 array astore\n", -+"dup /MediaRequested exch def\n", - "<< exch /PageSize exch >> setpagedevice\n", --"} ifelse\n", -+"/pagesave save def\n", -+"}if\n", -+"}ifelse\n", - "userdict/PDFR_InitialGS gstate put\n", - "setglobal\n", - "}if\n", -diff -up ghostscript-9.10/lib/opdfread.ps.duplex ghostscript-9.10/lib/opdfread.ps ---- ghostscript-9.10/lib/opdfread.ps.duplex 2013-08-30 11:37:28.000000000 +0100 -+++ ghostscript-9.10/lib/opdfread.ps 2014-02-27 15:59:45.987847093 +0000 -@@ -896,13 +896,27 @@ currentdict end readonly def - 0 0 % dummy page size values if not known - }ifelse - % bw bh px0 py0 bw bh bool bw bh Width Height -- round cvi 2 index round cvi % bw bh px0 py0 bw bh bool bw bh Width bool -+ round cvi 2 index round cvi eq % bw bh px0 py0 bw bh bool bw bh Width bool - exch round cvi 3 index round cvi eq and % bw bh px0 py0 bw bh bool bw bh bool - { % Page Size unchanged, do not emit setpagedevice - pop pop % bw bh px0 py0 bw bh bool - } { -- 2 array astore % bw bh px0 py0 bw bh bool [] -- << exch /PageSize exch >> setpagedevice % bw bh px0 py0 bw bh bool -+ /MediaRequested where { -+ % bw bh px0 py0 bw bh -+ /MediaRequested get aload pop % bw bh px0 py0 bw bh Width Height -+ round cvi 2 index round cvi eq % bw bh px0 py0 bw bh bool bw bh Width bool -+ exch round cvi 3 index round cvi eq and % bw bh px0 py0 bw bh bool bw bh bool -+ {pop pop false} % We already requested this media size, so don't re-request -+ {true} ifelse % Media request different to last request -+ } { -+ true % No stored media request, so apply setpagedevice -+ } ifelse -+ { -+ 2 array astore % bw bh px0 py0 bw bh bool [] -+ dup /MediaRequested exch def -+ << exch /PageSize exch >> setpagedevice % bw bh px0 py0 bw bh bool -+ /pagesave save def -+ } if - } ifelse - userdict /PDFR_InitialGS gstate put - setglobal % bw bh px0 py0 bw bh diff --git a/ghostscript-gs694154.patch b/ghostscript-gs694154.patch index 5ecf701..248aebb 100644 --- a/ghostscript-gs694154.patch +++ b/ghostscript-gs694154.patch @@ -1,7 +1,7 @@ -diff -up ghostscript-9.10/base/gsicc.c.gs694154 ghostscript-9.10/base/gsicc.c ---- ghostscript-9.10/base/gsicc.c.gs694154 2013-08-30 11:37:28.000000000 +0100 -+++ ghostscript-9.10/base/gsicc.c 2013-12-10 16:06:58.364001185 +0000 -@@ -354,6 +354,8 @@ gx_remap_ICC(const gs_client_color * pcc +diff -up ghostscript-9.12/base/gsicc.c.gs694154 ghostscript-9.12/base/gsicc.c +--- ghostscript-9.12/base/gsicc.c.gs694154 2014-03-25 08:52:16.000000000 +0000 ++++ ghostscript-9.12/base/gsicc.c 2014-03-26 11:32:31.406034840 +0000 +@@ -468,6 +468,8 @@ gx_remap_ICC_imagelab(const gs_client_co cmm_dev_profile_t *dev_profile; code = dev_proc(dev, get_profile)(dev, &dev_profile); @@ -10,15 +10,3 @@ diff -up ghostscript-9.10/base/gsicc.c.gs694154 ghostscript-9.10/base/gsicc.c num_des_comps = gsicc_get_device_profile_comps(dev_profile); rendering_params.black_point_comp = pis->blackptcomp; rendering_params.graphics_type_tag = dev->graphics_type_tag; -diff -up ghostscript-9.10/base/gsstate.c.gs694154 ghostscript-9.10/base/gsstate.c ---- ghostscript-9.10/base/gsstate.c.gs694154 2013-08-30 11:37:28.000000000 +0100 -+++ ghostscript-9.10/base/gsstate.c 2013-12-10 16:06:58.364001185 +0000 -@@ -708,7 +708,7 @@ gs_setoverprint(gs_state * pgs, bool ovp - } else { - dev_proc(dev, get_profile)(dev, &profile_struct); - } -- if (profile_struct->sim_overprint == false) return; -+ if (profile_struct != NULL && profile_struct->sim_overprint == false) return; - } - pgs->overprint = ovp; - if (prior_ovp != ovp) diff --git a/ghostscript-gs694809.patch b/ghostscript-gs694809.patch deleted file mode 100644 index 7db205d..0000000 --- a/ghostscript-gs694809.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up ghostscript-9.10/Resource/Init/pdf_draw.ps.gs694809 ghostscript-9.10/Resource/Init/pdf_draw.ps ---- ghostscript-9.10/Resource/Init/pdf_draw.ps.gs694809 2013-08-30 11:37:29.000000000 +0100 -+++ ghostscript-9.10/Resource/Init/pdf_draw.ps 2013-12-10 16:15:47.066351541 +0000 -@@ -2307,18 +2307,23 @@ end - % Stack: scalex scaley annot appearance true - % Stack: scalex scaley annot false - { -+ dup type /dicttype eq { - % Draw appearance - % Initialize graphic following "7.4.4 Appearance Streams" -- q graphicsbeginpage textbeginpage -- 1 index annotrect pop pop translate -- 3 index 3 index scale % Apply scale factors -- dup /BBox knownoget { -- 1 index /Matrix knownoget not { {1 0 0 1 0 0} } if -- .bbox_transform pop pop -- % Compensate for non-zero origin of BBox -- neg exch neg exch translate -- } if -- DoForm Q -+ q graphicsbeginpage textbeginpage -+ 1 index annotrect pop pop translate -+ 3 index 3 index scale % Apply scale factors -+ dup /BBox knownoget { -+ 1 index /Matrix knownoget not { {1 0 0 1 0 0} } if -+ .bbox_transform pop pop -+ % Compensate for non-zero origin of BBox -+ neg exch neg exch translate -+ } if -+ DoForm Q -+ } { -+ ( **** Annotation's appearance is not a dictionary.\n) -+ pdfformaterror -+ } ifelse - } if - } { - dup /MK knownoget { % mk diff --git a/ghostscript-icc-missing-check.patch b/ghostscript-icc-missing-check.patch index dc51e91..9b9109a 100644 --- a/ghostscript-icc-missing-check.patch +++ b/ghostscript-icc-missing-check.patch @@ -1,7 +1,7 @@ -diff -up ghostscript-9.08rc1/base/gsicc_manage.c.icc-missing-check ghostscript-9.08rc1/base/gsicc_manage.c ---- ghostscript-9.08rc1/base/gsicc_manage.c.icc-missing-check 2013-08-09 14:12:18.000000000 +0100 -+++ ghostscript-9.08rc1/base/gsicc_manage.c 2013-08-09 16:54:11.167695694 +0100 -@@ -599,6 +599,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t +diff -up ghostscript-9.12/base/gsicc_manage.c.icc-missing-check ghostscript-9.12/base/gsicc_manage.c +--- ghostscript-9.12/base/gsicc_manage.c.icc-missing-check 2014-03-26 11:31:11.296570797 +0000 ++++ ghostscript-9.12/base/gsicc_manage.c 2014-03-26 11:32:10.384912584 +0000 +@@ -613,6 +613,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t icc_profile = gsicc_profile_new(str, mem, curr_ptr, strlen(curr_ptr)); code = sfclose(str); @@ -9,4 +9,4 @@ diff -up ghostscript-9.08rc1/base/gsicc_manage.c.icc-missing-check ghostscript-9 + if (str != NULL && icc_profile != NULL) { gsicc_init_profile_info(icc_profile); cmm = gsCMM_DEFAULT; - /* Check if this object is a devicelink profile. + /* Check if this object is a devicelink profile. diff --git a/ghostscript-runlibfileifexists.patch b/ghostscript-runlibfileifexists.patch index 46068b8..03b731c 100644 --- a/ghostscript-runlibfileifexists.patch +++ b/ghostscript-runlibfileifexists.patch @@ -1,6 +1,6 @@ -diff -up ghostscript-9.08rc1/Resource/Init/gs_fonts.ps.runlibfileifexists ghostscript-9.08rc1/Resource/Init/gs_fonts.ps ---- ghostscript-9.08rc1/Resource/Init/gs_fonts.ps.runlibfileifexists 2013-08-09 14:12:18.000000000 +0100 -+++ ghostscript-9.08rc1/Resource/Init/gs_fonts.ps 2013-08-12 18:05:02.065802147 +0100 +diff -up ghostscript-9.12/Resource/Init/gs_fonts.ps.runlibfileifexists ghostscript-9.12/Resource/Init/gs_fonts.ps +--- ghostscript-9.12/Resource/Init/gs_fonts.ps.runlibfileifexists 2014-03-25 08:52:16.000000000 +0000 ++++ ghostscript-9.12/Resource/Init/gs_fonts.ps 2014-03-26 12:01:48.248748767 +0000 @@ -95,10 +95,19 @@ userdict /Fontmap .FontDirectory maxleng % stack: dict file fontname filename|aliasname 1 index type /stringtype eq @@ -24,10 +24,10 @@ diff -up ghostscript-9.08rc1/Resource/Init/gs_fonts.ps.runlibfileifexists ghosts } { % This is a real entry. % Read and pop tokens until a semicolon. -diff -up ghostscript-9.08rc1/Resource/Init/gs_init.ps.runlibfileifexists ghostscript-9.08rc1/Resource/Init/gs_init.ps ---- ghostscript-9.08rc1/Resource/Init/gs_init.ps.runlibfileifexists 2013-08-09 14:12:18.000000000 +0100 -+++ ghostscript-9.08rc1/Resource/Init/gs_init.ps 2013-08-12 18:05:02.065802147 +0100 -@@ -680,6 +680,14 @@ systemdict /internaldict dup .makeintern +diff -up ghostscript-9.12/Resource/Init/gs_init.ps.runlibfileifexists ghostscript-9.12/Resource/Init/gs_init.ps +--- ghostscript-9.12/Resource/Init/gs_init.ps.runlibfileifexists 2014-03-25 08:52:16.000000000 +0000 ++++ ghostscript-9.12/Resource/Init/gs_init.ps 2014-03-26 12:01:48.248748767 +0000 +@@ -681,6 +681,14 @@ systemdict /internaldict dup .makeintern { /undefinedfilename signalerror } ifelse } bind def @@ -42,7 +42,7 @@ diff -up ghostscript-9.08rc1/Resource/Init/gs_init.ps.runlibfileifexists ghostsc /selectdevice { finddevice setdevice .setdefaultscreen } bind def /signalerror % signalerror - -@@ -848,6 +856,7 @@ userdict /.currentresourcefile //null pu +@@ -849,6 +857,7 @@ userdict /.currentresourcefile //null pu } bind def % Temporarily substitute it for the real runlibfile. /.runlibfile /runlibfile load def diff --git a/ghostscript-sys-zlib.patch b/ghostscript-sys-zlib.patch new file mode 100644 index 0000000..d33895a --- /dev/null +++ b/ghostscript-sys-zlib.patch @@ -0,0 +1,24 @@ +diff -up ghostscript-9.12/configure.ac.sys-zlib ghostscript-9.12/configure.ac +--- ghostscript-9.12/configure.ac.sys-zlib 2014-03-26 11:48:54.983972222 +0000 ++++ ghostscript-9.12/configure.ac 2014-03-26 11:49:36.807230531 +0000 +@@ -854,7 +854,7 @@ AC_MSG_CHECKING([for local zlib source]) + dnl zlib is needed for language level 3, and libpng + # we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR) + # this seems a harmless default +-ZLIBDIR=src ++ZLIBDIR=$includedir + AUX_SHARED_ZLIB= + + if test -d $srcdir/zlib; then +diff -up ghostscript-9.12/configure.sys-zlib ghostscript-9.12/configure +--- ghostscript-9.12/configure.sys-zlib 2014-03-26 11:49:45.547284521 +0000 ++++ ghostscript-9.12/configure 2014-03-26 11:49:56.171350127 +0000 +@@ -6254,7 +6254,7 @@ fi + $as_echo_n "checking for local zlib source... " >&6; } + # we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR) + # this seems a harmless default +-ZLIBDIR=src ++ZLIBDIR=$includedir + AUX_SHARED_ZLIB= + + if test -d $srcdir/zlib; then diff --git a/ghostscript.spec b/ghostscript.spec index 5a9259c..7348d20 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -1,11 +1,11 @@ -%define gs_ver 9.10 -%define gs_dot_ver 9.10 +%define gs_ver 9.12 +%define gs_dot_ver 9.12 %{expand: %%define build_with_freetype %{?_with_freetype:1}%{!?_with_freetype:0}} Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 6%{?dist} +Release: 1%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -31,8 +31,7 @@ Patch7: ghostscript-iccprofiles-initdir.patch Patch8: ghostscript-gdevcups-debug-uninit.patch Patch9: ghostscript-wrf-snprintf.patch Patch10: ghostscript-gs694154.patch -Patch11: ghostscript-gs694809.patch -Patch12: ghostscript-duplex.patch +Patch11: ghostscript-sys-zlib.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -136,11 +135,8 @@ rm -rf expat freetype icclib jasper jpeg jpegxr lcms lcms2 libpng openjpeg zlib # Use upstream patch to fix gs segfault (bug #1036428). %patch10 -p1 -b .gs694154 -# Use upstream patch to fix gs segfault (bug #1039718). -%patch11 -p1 -b .gs694809 - -# Use upstream patch to fix duplex for some devices (bug #1068896). -%patch12 -p1 -b .duplex +# Fix build when using system zlib. +%patch11 -p1 -b .sys-zlib # Convert manual pages to UTF-8 from8859_1() { @@ -332,6 +328,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Wed Mar 26 2014 Tim Waugh 9.12-1 +- 9.12 (bug #1080814). +- Fix build when using system zlib. + * Thu Feb 27 2014 Tim Waugh 9.10-6 - Use upstream patch to fix duplex for some devices (bug #1068896). diff --git a/sources b/sources index e8a0c6f..625ca17 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 2fbae60417d42779f6488ab897dcaaf6 acro5-cmaps-2001.tar.gz dfc93dd2aaaf2b86d2fd55f654c13261 adobe-cmaps-200406.tar.gz -2ace0c86929e79dc722ec6151de77db1 ghostscript-9.10-cleaned.tar.bz2 +998c35f19f0351e6a27c526e1f969114 ghostscript-9.12-cleaned.tar.bz2