aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-01 12:48:59 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-01 12:48:59 +0000
commit7afc497e0be5bad2931d88174031d3a56a58cc25 (patch)
treef2e4dfd8d462fc2b26426a9f879ce89d18c6af27 /main
parent9829a12686899b9540c08b1db1d531df70ba247c (diff)
downloadaports-7afc497e0be5bad2931d88174031d3a56a58cc25.tar.bz2
aports-7afc497e0be5bad2931d88174031d3a56a58cc25.tar.xz
main/ghostscript: upgrade to 9.16
Diffstat (limited to 'main')
-rw-r--r--main/ghostscript/APKBUILD35
-rw-r--r--main/ghostscript/fix-sprintf.patch65
-rw-r--r--main/ghostscript/ghostscript-system-openjpeg2.patch60
-rw-r--r--main/ghostscript/ghostscript-system-zlib.patch21
-rw-r--r--main/ghostscript/ghostscript-wrf-snprintf.patch22
5 files changed, 195 insertions, 8 deletions
diff --git a/main/ghostscript/APKBUILD b/main/ghostscript/APKBUILD
index 23ea78ed24..894993a52d 100644
--- a/main/ghostscript/APKBUILD
+++ b/main/ghostscript/APKBUILD
@@ -1,17 +1,22 @@
# Contributor: Cameron Banta <cbanta@gmail.com>
# Maintainer: Cameron Banta <cbanta@gmail.com>
pkgname=ghostscript
-pkgver=9.15
-pkgrel=1
+pkgver=9.16
+pkgrel=0
pkgdesc="An interpreter for the PostScript language and for PDF"
url="http://ghostscript.com/"
arch="all"
license="GPL3"
makedepends="autoconf automake libjpeg-turbo-dev libpng-dev jasper-dev expat-dev
zlib-dev tiff-dev freetype-dev libiconv-dev lcms2-dev gtk+3.0-dev
- cups-dev libtool"
+ cups-dev libtool jbig2dec-dev openjpeg-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-gtk"
-source="http://downloads.ghostscript.com/public/$pkgname-$pkgver.tar.gz"
+source="http://downloads.ghostscript.com/public/$pkgname-$pkgver.tar.gz
+ ghostscript-system-zlib.patch
+ ghostscript-system-openjpeg2.patch
+ ghostscript-wrf-snprintf.patch
+ fix-sprintf.patch
+ "
_builddir="$srcdir/ghostscript-$pkgver"
prepare() {
@@ -23,7 +28,8 @@ prepare() {
done
# force it to use system-libs
- rm -rf jpeg libpng zlib jasper expat tiff lcms2 cups/libs
+ rm -r jpeg libpng zlib expat tiff lcms2 cups/libs jbig2dec \
+ freetype openjpeg || return 1
# fix parallel builds
sed -i -e 's/ECHO_XE/ECHOGS_XE/g' \
@@ -59,6 +65,7 @@ build(){
--infodir=/usr/share/info \
--docdir=/usr/share/doc/"$pkgname" \
--enable-dynamic \
+ --disable-static \
--with-system-libtiff \
--with-ijs \
--with-jbig2dec \
@@ -103,6 +110,18 @@ gtk() {
mv "$pkgdir"/usr/bin/gsx "$subpkgdir"/usr/bin/
}
-md5sums="5a78ab0990ff6ec3a103576bc8777c46 ghostscript-9.15.tar.gz"
-sha256sums="27f11e4fe5b89857ae745687281d1e4daf9681edc858a3f7e8e77ef09609777a ghostscript-9.15.tar.gz"
-sha512sums="cbe28eb35cfc41f10546f1ad4c19926b1a270d5dad1fa1e5c3747cbc3e12cf84827c1da6e9a25338d798b7524a63d47775c3eb62449904ddc233c65ec753ed5e ghostscript-9.15.tar.gz"
+md5sums="829319325bbdb83f5c81379a8f86f38f ghostscript-9.16.tar.gz
+c180cac458c6ab7bcd319fe092abb9cd ghostscript-system-zlib.patch
+7bc12888cccf6d2827d0ff012813220f ghostscript-system-openjpeg2.patch
+f5129f6cc01a3d593cf02fe1ef94cbe8 ghostscript-wrf-snprintf.patch
+ed14fa288463e08e1e6074a5d1ebbcbb fix-sprintf.patch"
+sha256sums="746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d ghostscript-9.16.tar.gz
+bcbd4154fc186b3564fa6140d57117f243a5d703823c03443434c09aeef20684 ghostscript-system-zlib.patch
+0d029c98b2149715b63d2eae9634eca0d427bf77e713dd355854412fc92b35ac ghostscript-system-openjpeg2.patch
+3ca8f75d743aae7f2baa109a2a9217c33867c13e88e0ddbc96dc9be39157ae72 ghostscript-wrf-snprintf.patch
+3051dff937ab9ced9f88b36384400b10bc9cdb39b2abd3ece8f4c41a0246874e fix-sprintf.patch"
+sha512sums="cd7da12f55379f7d388bd2573a307426da230a2220766a7138ab49990fb34343801a6d5e76ba0f4d6c97a5871359658ca043fcc700242b02f30de30a15b2847f ghostscript-9.16.tar.gz
+6449fe3594d2b61aa4a96762a91db847242dbbb407c6743af8a5db0f7f18bb82df3c89e974e6b23deecaaf7b6bf1fb6930713cbe6229ec3d8b26dd65115893a8 ghostscript-system-zlib.patch
+f874540fc53f85a3587253aaf8a29fc7792590938daf7f44e573cbbdac258b39db8baccce9569737c5c1a0a3816c6a8ff55b97f60dbefbba0c1729fd202d0ddd ghostscript-system-openjpeg2.patch
+86f30dd61c4ee87e1cf72686da4ee6d0dd89100e122279c038dd7cb813a72b95d170ca2ae8cf6a10f2a01b18e49c704dc6aca5cbb5253886908332a90b7a7c2b ghostscript-wrf-snprintf.patch
+300712709ec75f728c703f6a2a5abd992b7c2137df81cc1dd4f6e96c690077e0d5a4afd0e06ce55660061911ddfbf1e68d7020ec3e5f2124602133a10451ec42 fix-sprintf.patch"
diff --git a/main/ghostscript/fix-sprintf.patch b/main/ghostscript/fix-sprintf.patch
new file mode 100644
index 0000000000..a37303ef6c
--- /dev/null
+++ b/main/ghostscript/fix-sprintf.patch
@@ -0,0 +1,65 @@
+--- ./cups/gdevcups.c.orig
++++ ./cups/gdevcups.c
+@@ -1042,7 +1042,7 @@
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsInteger%d", i);
++ snprintf(name, sizeof(name), "cupsInteger%d", i);
+ if ((code = param_write_int(plist, strdup(name),
+ (int *)(cups->header.cupsInteger + i))) < 0)
+ return (code);
+@@ -1050,7 +1050,7 @@
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsReal%d", i);
++ snprintf(name, sizeof(name), "cupsReal%d", i);
+ if ((code = param_write_float(plist, strdup(name),
+ cups->header.cupsReal + i)) < 0)
+ return (code);
+@@ -1058,7 +1058,7 @@
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsString%d", i);
++ snprintf(name, sizeof(name), "cupsString%d", i);
+ param_string_from_transient_string(s, cups->header.cupsString[i]);
+ if ((code = param_write_string(plist, strdup(name), &s)) < 0)
+ return (code);
+@@ -3184,19 +3184,19 @@
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsInteger%d", i);
++ snprintf(name, sizeof(name), "cupsInteger%d", i);
+ intoption(cupsInteger[i],strdup(name), unsigned)
+ }
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsReal%d", i);
++ snprintf(name, sizeof(name), "cupsReal%d", i);
+ floatoption(cupsReal[i], strdup(name))
+ }
+
+ for (i = 0; i < 16; i ++)
+ {
+- sprintf(name, "cupsString%d", i);
++ snprintf(name, sizeof(name), "cupsString%d", i);
+ stringoption(cupsString[i], strdup(name))
+ }
+
+@@ -4271,10 +4271,10 @@
+ */
+
+ if (pdev->HWResolution[0] != pdev->HWResolution[1])
+- sprintf(resolution, "%.0fx%.0fdpi", pdev->HWResolution[0],
++ snprintf(resolution, sizeof(resolution), "%.0fx%.0fdpi", pdev->HWResolution[0],
+ pdev->HWResolution[1]);
+ else
+- sprintf(resolution, "%.0fdpi", pdev->HWResolution[0]);
++ snprintf(resolution, sizeof(resolution), "%.0fdpi", pdev->HWResolution[0]);
+
+ for (i = 0, profile = cups->PPD->profiles;
+ i < cups->PPD->num_profiles;
diff --git a/main/ghostscript/ghostscript-system-openjpeg2.patch b/main/ghostscript/ghostscript-system-openjpeg2.patch
new file mode 100644
index 0000000000..51185224f0
--- /dev/null
+++ b/main/ghostscript/ghostscript-system-openjpeg2.patch
@@ -0,0 +1,60 @@
+diff -up ghostscript-9.16/base/openjpeg.mak.system-openjpeg2 ghostscript-9.16/base/openjpeg.mak
+--- ghostscript-9.16/base/openjpeg.mak.system-openjpeg2 2015-03-30 09:21:24.000000000 +0100
++++ ghostscript-9.16/base/openjpeg.mak 2015-03-30 17:05:55.160034798 +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:
+@@ -105,7 +106,7 @@ $(OPEN_JPEG_GEN)openjpeg.dev : $(TOP_MAK
+ # external link .dev
+ $(OPEN_JPEG_GEN)openjpeg_1.dev : $(TOP_MAKEFILES) $(OPEN_JPEG_MAK) $(ECHOGS_XE) \
+ $(MAKEDIRS)
+- $(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.16/configure.ac.system-openjpeg2 ghostscript-9.16/configure.ac
+--- ghostscript-9.16/configure.ac.system-openjpeg2 2015-03-30 09:21:24.000000000 +0100
++++ ghostscript-9.16/configure.ac 2015-03-30 17:05:08.563193858 +0100
+@@ -1531,6 +1531,17 @@ if test "x$JPX_DECODER" = "x"; then
+ JPXDEVS='$(PSD)jpx.dev'
+ else
+ AC_MSG_RESULT([no])
++ AC_MSG_CHECKING([for system OpenJPEG library])
++ 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
+@@ -1539,6 +1550,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.16/Makefile.in.system-openjpeg2 ghostscript-9.16/Makefile.in
+--- ghostscript-9.16/Makefile.in.system-openjpeg2 2015-03-30 17:02:51.000000000 +0100
++++ ghostscript-9.16/Makefile.in 2015-03-30 17:05:08.563193858 +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/main/ghostscript/ghostscript-system-zlib.patch b/main/ghostscript/ghostscript-system-zlib.patch
new file mode 100644
index 0000000000..ef1e3ac17e
--- /dev/null
+++ b/main/ghostscript/ghostscript-system-zlib.patch
@@ -0,0 +1,21 @@
+diff -up ghostscript-9.16/devices/devs.mak.system-zlib ghostscript-9.16/devices/devs.mak
+--- ghostscript-9.16/devices/devs.mak.system-zlib 2015-03-30 17:47:57.931725800 +0100
++++ ghostscript-9.16/devices/devs.mak 2015-03-30 17:48:14.539673024 +0100
+@@ -1231,7 +1231,7 @@ $(libtiff_dev) $(MAKEDIRS)
+
+ $(DEVOBJ)gdevxps.$(OBJ) : $(DEVVECSRC)gdevxps.c $(gdevvec_h) \
+ $(string__h) $(stdio__h) $(libtiff_dev) $(gx_h) $(gserrors_h) \
+-$(gxpath_h) $(gzcpath_h) $(stream_h) $(zlib_h) \
++$(gxpath_h) $(gzcpath_h) $(stream_h) \
+ $(stdint__h) $(gdevtifs_h) $(gsicc_create_h) $(gsicc_cache_h) \
+ $(gximdecode_h) $(MAKEDIRS)
+ $(XPSDEVCC) $(I_)$(TI_)$(_I) $(GLO_)gdevxps.$(OBJ) $(C_) $(DEVVECSRC)gdevxps.c
+@@ -1683,7 +1683,7 @@ $(DD)pngalpha.dev : $(DEVS_MAK) $(libpng
+ fpng_=$(DEVOBJ)gdevfpng.$(OBJ) $(DEVOBJ)gdevpccm.$(OBJ)
+
+ $(DEVOBJ)gdevfpng_0.$(OBJ) : $(DEVSRC)gdevfpng.c\
+- $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(zlib_h) $(MAKEDIRS)
++ $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(MAKEDIRS)
+ $(CC_) $(I_)$(DEVI_) $(II)$(PI_)$(_I) $(PCF_) $(GLF_) $(DEVO_)gdevfpng_0.$(OBJ) $(C_) $(DEVSRC)gdevfpng.c
+
+ $(DEVOBJ)gdevfpng_1.$(OBJ) : $(DEVSRC)gdevfpng.c\
diff --git a/main/ghostscript/ghostscript-wrf-snprintf.patch b/main/ghostscript/ghostscript-wrf-snprintf.patch
new file mode 100644
index 0000000000..74d8c2a5c6
--- /dev/null
+++ b/main/ghostscript/ghostscript-wrf-snprintf.patch
@@ -0,0 +1,22 @@
+diff -up ghostscript-9.07/base/wrfont.c.wrf-snprintf ghostscript-9.07/base/wrfont.c
+--- ghostscript-9.07/base/wrfont.c.wrf-snprintf 2013-07-01 13:02:33.373244683 +0100
++++ ghostscript-9.07/base/wrfont.c 2013-07-01 13:04:55.022864299 +0100
+@@ -72,7 +72,8 @@ WRF_wfloat(WRF_output * a_output, double
+ {
+ char buffer[32];
+
+- gs_sprintf(buffer, "%f", a_float);
++ if (gs_snprintf(buffer, sizeof (buffer), "%f", a_float) >= sizeof (buffer))
++ abort();
+ WRF_wstring(a_output, buffer);
+ }
+
+@@ -81,6 +82,7 @@ WRF_wint(WRF_output * a_output, long a_i
+ {
+ char buffer[32];
+
+- gs_sprintf(buffer, "%ld", a_int);
++ if (gs_snprintf(buffer, sizeof (buffer), "%ld", a_int) >= sizeof (buffer))
++ abort();
+ WRF_wstring(a_output, buffer);
+ }