From 4f91b6153586752888a86d114a60007b12fc2f05 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 3 Oct 2014 11:40:59 +0100 Subject: [PATCH] Use system openjpeg2 library so we can decode JPX (upstream bug #695557). --- ghostscript-system-openjpeg2.patch | 60 ++++++++++++++++++++++++++++++ ghostscript.spec | 11 +++++- 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 ghostscript-system-openjpeg2.patch diff --git a/ghostscript-system-openjpeg2.patch b/ghostscript-system-openjpeg2.patch new file mode 100644 index 0000000..d720006 --- /dev/null +++ b/ghostscript-system-openjpeg2.patch @@ -0,0 +1,60 @@ +diff -up ghostscript-9.15/base/openjpeg.mak.system-openjpeg2 ghostscript-9.15/base/openjpeg.mak +--- ghostscript-9.15/base/openjpeg.mak.system-openjpeg2 2014-10-03 11:20:42.769715997 +0100 ++++ ghostscript-9.15/base/openjpeg.mak 2014-10-03 11:22:17.823232154 +0100 +@@ -16,6 +16,7 @@ + # makefile for Luratech lwf_jp2 library code. + # Users of this makefile must define the following: + # SHARE_JPX - whether to compile in or link to the library ++# SHARE_JPX_LIB - name of external library to link to + # JPXSRCDIR - the library source directory + # + # gs.mak and friends define the following: +@@ -103,7 +104,7 @@ $(OPEN_JPEG_GEN)openjpeg.dev : $(TOP_MAK + + # external link .dev + $(OPEN_JPEG_GEN)openjpeg_1.dev : $(TOP_MAKEFILES) $(OPEN_JPEG_MAK) $(ECHOGS_XE) +- $(SETMOD) $(OPEN_JPEG_GEN)openjpeg_1 -lib lib_openjpeg ++ $(SETMOD) $(OPEN_JPEG_GEN)openjpeg_1 -lib $(SHARE_JPX_LIB) + + # compile our own .dev + $(OPEN_JPEG_GEN)openjpeg_0.dev : $(TOP_MAKEFILES) $(OPEN_JPEG_MAK) $(ECHOGS_XE) $(open_jpeg_OBJS) +diff -up ghostscript-9.15/configure.ac.system-openjpeg2 ghostscript-9.15/configure.ac +--- ghostscript-9.15/configure.ac.system-openjpeg2 2014-09-22 11:17:33.000000000 +0100 ++++ ghostscript-9.15/configure.ac 2014-10-03 11:27:55.783067332 +0100 +@@ -1492,6 +1492,17 @@ if test "x$JPX_DECODER" = "x"; then + JPXDEVS='$(PSD)jpx.dev' + else + AC_MSG_RESULT([no]) ++ AC_MSG_CHECKING([for system OpenJPEG library source]) ++ if $PKGCONFIG --exists libopenjp2; then ++ AC_MSG_RESULT(yes) ++ JPX_DECODER=openjpeg ++ SHARE_JPX=1 ++ SHARE_JPX_LIB="`$PKGCONFIG libopenjp2 --libs | sed -e 's,^-l,,'`" ++ JPX_AUTOCONF_CFLAGS="-DUSE_OPENJPEG_JP2 `$PKGCONFIG libopenjp2 --cflags`" ++ JPXDEVS='$(PSD)jpx.dev' ++ else ++ AC_MSG_RESULT(no) ++ fi + fi + fi + fi +@@ -1500,6 +1511,7 @@ AC_SUBST(JPX_DECODER) + AC_SUBST(JPX_AUTOCONF_CFLAGS) + AC_SUBST(JPXDIR) + AC_SUBST(SHARE_JPX) ++AC_SUBST(SHARE_JPX_LIB) + AC_SUBST(JPXDEVS) + + dnl check if we can/should build the gtk loader +diff -up ghostscript-9.15/Makefile.in.system-openjpeg2 ghostscript-9.15/Makefile.in +--- ghostscript-9.15/Makefile.in.system-openjpeg2 2014-10-03 11:29:52.808702801 +0100 ++++ ghostscript-9.15/Makefile.in 2014-10-03 11:30:02.997757576 +0100 +@@ -248,6 +248,7 @@ JBIG2_CFLAGS=@JBIG2_AUTOCONF_CFLAGS@ + # and source location and configuration flags for compiling in + JPX_LIB=@JPX_DECODER@ + SHARE_JPX=@SHARE_JPX@ ++SHARE_JPX_LIB=@SHARE_JPX_LIB@ + JPXSRCDIR=@JPXDIR@ + JPX_CFLAGS=@JPX_AUTOCONF_CFLAGS@ + diff --git a/ghostscript.spec b/ghostscript.spec index 8e38338..8633c36 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 1%{?dist} +Release: 2%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -28,6 +28,7 @@ Patch4: ghostscript-runlibfileifexists.patch Patch5: ghostscript-icc-missing-check.patch Patch6: ghostscript-Fontmap.local.patch Patch7: ghostscript-wrf-snprintf.patch +Patch8: ghostscript-system-openjpeg2.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -44,7 +45,7 @@ BuildRequires: jasper-devel BuildRequires: dbus-devel BuildRequires: poppler-data BuildRequires: lcms2-devel >= 2.4-5 -BuildRequires: openjpeg-devel +BuildRequires: openjpeg2-devel %{?_with_freetype:BuildRequires: freetype-devel} BuildRoot: %{_tmppath}/%{name}-%{gs_ver}-root @@ -122,6 +123,8 @@ rm -rf expat freetype icclib jasper jpeg jpegxr lcms lcms2 libpng openjpeg zlib # Use more caution when converting floats to strings (bug #980085). %patch7 -p1 -b .wrf-snprintf +%patch8 -p1 -b .system-openjpeg2 + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -313,6 +316,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Fri Oct 3 2014 Tim Waugh 9.15-2 +- Use system openjpeg2 library so we can decode JPX (upstream + bug #695557). + * Tue Sep 23 2014 Tim Waugh 9.15-1 - 9.15. No longer need iccprofiles-initdir, gs694154, crash, sys-zlib, or trio-g patches.