diff options
Diffstat (limited to 'user/gnu-ghostscript')
-rw-r--r-- | user/gnu-ghostscript/APKBUILD | 21 | ||||
-rw-r--r-- | user/gnu-ghostscript/do-not-use-sprintf.patch | 85 |
2 files changed, 99 insertions, 7 deletions
diff --git a/user/gnu-ghostscript/APKBUILD b/user/gnu-ghostscript/APKBUILD index 633582fb6..14ce2c5f6 100644 --- a/user/gnu-ghostscript/APKBUILD +++ b/user/gnu-ghostscript/APKBUILD @@ -2,19 +2,19 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=gnu-ghostscript pkgver=9.14.1 -pkgrel=0 +pkgrel=2 pkgdesc="PostScript utilities" url="https://www.gnu.org/software/ghostscript/" arch="all" license="AGPL-3.0+ WITH PDF-exception" depends="" -makedepends="dbus-dev fontconfig-dev freetype-dev lcms2-dev libice-dev +makedepends="cups-dev dbus-dev fontconfig-dev freetype-dev lcms2-dev libice-dev libjpeg-turbo-dev libpaper-dev libpng-dev libx11-dev libxext-dev libxt-dev tiff-dev zlib-dev" -subpackages="$pkgname-doc" -source="ftp://ftp.gnu.org/gnu/ghostscript/gnu-ghostscript-$pkgver.tar.xz" -sha512sums="658f6ae14b29965c7959b9bd1463760d7fb03b35251446fc37101dbe7ee2866c74a0803e22b2f4488be3221d026578be1d6be7b562ff240036134fbf83edabf9 gnu-ghostscript-9.14.1.tar.xz" -builddir="$srcdir/gnu-ghostscript-$pkgver" +subpackages="$pkgname-dev $pkgname-doc $pkgname-libs" +source="ftp://ftp.gnu.org/gnu/ghostscript/gnu-ghostscript-$pkgver.tar.xz + do-not-use-sprintf.patch + " build() { cd "$builddir" @@ -24,8 +24,11 @@ build() { --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ - --localstatedir=/var + --localstatedir=/var \ + --enable-dynamic \ + --with-system-libtiff make + make so } check() { @@ -36,5 +39,9 @@ check() { package() { cd "$builddir" make DESTDIR="$pkgdir" install + make DESTDIR="$pkgdir" soinstall + install -D -m644 base/*.h "$pkgdir"/usr/include/ghostscript } +sha512sums="658f6ae14b29965c7959b9bd1463760d7fb03b35251446fc37101dbe7ee2866c74a0803e22b2f4488be3221d026578be1d6be7b562ff240036134fbf83edabf9 gnu-ghostscript-9.14.1.tar.xz +1c4d79633ecece9f4de7a672f2888939be7d1e0ba24f3a66500fdfbb37e081e0f323a5efa0d1547fed51206e5a95d3b0659c0ea845d0bc333f281dfb88fcc040 do-not-use-sprintf.patch" diff --git a/user/gnu-ghostscript/do-not-use-sprintf.patch b/user/gnu-ghostscript/do-not-use-sprintf.patch new file mode 100644 index 000000000..e0e84b4fe --- /dev/null +++ b/user/gnu-ghostscript/do-not-use-sprintf.patch @@ -0,0 +1,85 @@ +--- gnu-ghostscript-9.14.1/base/mkromfs.c.old 2014-07-02 14:46:25.000000000 +0000 ++++ gnu-ghostscript-9.14.1/base/mkromfs.c 2019-01-14 19:08:34.441981516 +0000 +@@ -1937,7 +1937,7 @@ + for (i = 0; i < len; ++i) { + int c = str[i]; + +- sprintf(linebuf, ++ snprintf(linebuf, sizeof(linebuf), + (c < 32 || c >= 127 ? "%d," : + c == '\'' || c == '\\' ? "'\\%c'," : "'%c',"), + c); +@@ -2228,7 +2228,7 @@ + char line[LINE_SIZE + 1]; + + while ((rl(in, line, LINE_SIZE), line[0])) { +- sprintf(linebuf, "%s", line ); ++ snprintf(linebuf, sizeof(linebuf), "%s", line ); + wl(linebuf); + } + mergefile(os_prefix, inname, in, config, false); +--- gnu-ghostscript-9.14.1/cups/gdevcups.c.old 2014-07-02 15:13:25.000000000 +0000 ++++ gnu-ghostscript-9.14.1/cups/gdevcups.c 2019-01-23 20:56:04.082290416 +0000 +@@ -1039,7 +1039,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); +@@ -1047,7 +1047,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); +@@ -1055,7 +1055,7 @@ + + for (i = 0; i < 16; i ++) + { +- sprintf(name, "cupsString%d", i); ++ snprintf(name, sizeof(name), "cupsString%d", i); + param_string_from_string(s, cups->header.cupsString[i]); + if ((code = param_write_string(plist, strdup(name), &s)) < 0) + return (code); +@@ -3166,19 +3166,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)) + } + +@@ -4247,10 +4247,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; |