diff options
Diffstat (limited to 'patches/source/ghostscript')
-rw-r--r-- | patches/source/ghostscript/cidfmap | 118 | ||||
-rw-r--r-- | patches/source/ghostscript/ghostscript-pdf2dsc.patch | 12 | ||||
-rwxr-xr-x | patches/source/ghostscript/ghostscript.SlackBuild | 190 | ||||
-rw-r--r-- | patches/source/ghostscript/ghostscript.fix_black_page.diff | 99 | ||||
-rw-r--r-- | patches/source/ghostscript/slack-desc | 19 |
5 files changed, 438 insertions, 0 deletions
diff --git a/patches/source/ghostscript/cidfmap b/patches/source/ghostscript/cidfmap new file mode 100644 index 00000000..0303f66f --- /dev/null +++ b/patches/source/ghostscript/cidfmap @@ -0,0 +1,118 @@ +%! +% $Id: cidfmap 6300 2005-12-28 19:56:24Z giles $ +% This is a sample map file for CIDFont category. + +% +% The map is a set of records, which must use one of the two formats : +% +% 1. A substutution of a CIF font with another CID font : +% +% /substituted /original ; +% +% Where 'substituted' is a name being used in a document, +% 'original' is a name of an available resource. +% +% 2. A substutution of a CIF font with a True Type font : +% +% /substituted << /FileType /TrueType /Path (path) /SunfontID 1 /CSI [(ordering) supplement] >> ; +% +% Where 'substituted' is a name being used in a document, +% 'path' is a path to a True Type font file, +% 'ordering' is a value of Ordering required for CIDSystemInfo dictionary, +% 'supplement' is a value of Supplement required for CIDSystemInfo dictionary. +% +% Examples : +% +% /ShinGo-Bold /HeiseiKakuGo-W5 ; +% /Ryumin-Medium << /FileType /TrueType /Path (H:/AuxFiles/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ; +% + + +%% cidfmap.zh_CN (simplified Chinese ; zh_CN) +%% This font will produce better results than the wqy-zenhei.ttf that we use +%% to get out-of-the-box output. +%% If you install it, uncomment the line below and comment the one below that. +%/BousungEG-Light-GB << /FileType /TrueType /Path (uming.ttf) /CSI [(GB1) 4] >> ; +/BousungEG-Light-GB << /FileType /TrueType /Path (wqy-zenhei.ttf) /CSI [(GB1) 4] >> ; +%% This font will produce better results than the wqy-zenhei.ttf that we use +%% to get out-of-the-box output. +%% If you install it, uncomment the line below and comment the one below that. +%/GBZenKai-Medium << /FileType /TrueType /Path (ukai.ttf) /CSI [(GB1) 4] >> ; +/GBZenKai-Medium << /FileType /TrueType /Path (wqy-zenhei.ttf) /CSI [(GB1) 4] >> ; +/MSungGBK-Light << /FileType /TrueType /Path (wqy-zenhei.ttf) /CSI [(GB1) 4] >> ; +/MSung-Light /MSungGBK-Light ; +/MSung-Medium /GBZenKai-Medium ; +/MHei-Medium /BousungEG-Light-GB ; +/MKai-Medium /GBZenKai-Medium ; +/STSong-Light /BousungEG-Light-GB ; +/STFangsong-Light /BousungEG-Light-GB ; +/STHeiti-Regular /MSungGBK-Light ; +/STKaiti-Regular /GBZenKai-Medium ; +/Adobe-GB1 /BousungEG-Light-GB ; + +%% cidfmap.zh_TW (traditional Chinese ; zh_TW) +%% To use this example, install the missing uming.ttf and ukai.ttf fonts, and +%% uncomment everything in the block below. Also, fix the simplified Chinese +%% block as described above for "better output" so that there is no +%% interference (or comment the whole block out). +%/BousungEG-Light-GB << /FileType /TrueType /Path (uming.ttf) /CSI [(CNS1) 4] >> ; +%/ZenKai-Medium << /FileType /TrueType /Path (ukai.ttf) /CSI [(CNS1) 4] >> ; +%/ShanHeiSun-Light << /FileType /TrueType /Path (wqy-zenhei.ttf) /CSI [(CNS1) 4] >> ; +%/STSong-Light /BousungEG-Light-GB ; +%/STKaiti-Regular /ZenKai-Medium-GB ; +%/STFangsong-Light /BousungEG-Light ; +%/STHeiti-Regular /MHei-Medium ; +%/MSung-Light /BousungEG-Light-GB ; +%/MSung-Medium /ZenKai-Medium ; +%/MHei-Medium /ShanHeiSun-Light ; +%/MKai-Medium /ZenKai-Medium ; +%/Adobe-CNS1 /BousungEG-Light-GB ; + +%% cidfmap.ja +/Sazanami-Gothic << /FileType /TrueType /Path (sazanami-gothic.ttf) /CSI [(Japan1) 6] >> ; +/Sazanami-Gothic-Regular /Sazanami-Gothic ; +/Sazanami-Gothic-JaH << /FileType /TrueType /Path (sazanami-gothic.ttf) /CSI [(Japan2) 0] >> ; +/Sazanami-Gothic-Regular-JaH /Sazanami-Gothic-JaH ; +/Sazanami-Mincho << /FileType /TrueType /Path (sazanami-mincho.ttf) /CSI [(Japan1) 6] >> ; +/Sazanami-Mincho-Regular /Sazanami-Mincho ; +/Sazanami-Mincho-JaH << /FileType /TrueType /Path (sazanami-mincho.ttf) /CSI [(Japan2) 0] >> ; +/Sazanami-Mincho-Regular-JaH /Sazanami-Mincho-JaH ; +/Ryumin-Light /Sazanami-Mincho ; +/Ryumin-Light-H /Sazanami-Mincho ; +/GothicBBB-Medium /Sazanami-Gothic ; +/GothicBBB-Medium-V /Sazanami-Gothic ; +/HeiseiMin-W3 /Ryumin-Light ; +/HeiseiKakuGo-W5 /GothicBBB-Medium ; +/HeiseiMin-W3-Acro /Ryumin-Light ; +/HeiseiKaKuGo-W5-Acro /GothicBBB-Medium ; +/Kochi-Gothic /Sazanami-Gothic ; +/Kochi-Mincho /Sazanami-Mincho ; +/WadaMin-Regular /Sazanami-Mincho ; +/WadaMin-Bold /Sazanami-Mincho ; +/WadaGo-Regular /Sazanami-Gothic ; +/WadaGo-Bold /Sazanami-Gothic ; +/Adobe-Japan1 /Sazanami-Gothic ; +/Adobe-Japan2 /Sazanami-Gothic-JaH ; + +%% cidfmap.ko +%% To enable Korean printing support, install the fonts shown in the example +%% here and uncomment the block below: +%/Baekmuk-Batang << /FileType /TrueType /Path (batang.ttf) /CSI [(Korea1) 2] >> ; +%/Baekmuk-Batang-Regular /Baekmuk-Batang ; +%/Baekmuk-Dotum << /FileType /TrueType /Path (dotum.ttf) /CSI [(Korea1) 2] >> ; +%/Baekmuk-Dotum-Regular /Baekmuk-Dotum ; +%/Baekmuk-Gulim << /FileType /TrueType /Path (gulim.ttf) /CSI [(Korea1) 2] >> ; +%/Baekmuk-Gulim-Regular /Baekmuk-Gulim ; +%/Baekmuk-Headline << /FileType /TrueType /Path (hline.ttf) /CSI [(Korea1) 2] >> ; +%/Baekmuk-Headline-Regular /Baekmuk-Headline ; +%/Adobe-Korea1 /Baekmuk-Batang ; + +%/BousungEG-Light-GB << /FileType /TrueType /Path (uming.ttf) /CSI [(GB1) 4] >> ; +%/GBZenKai-Medium << /FileType /TrueType /Path (ukai.ttf) /CSI [(GB1) 4] >> ; +%/MSungGBK-Light /BousungEG-Light-GB ; +%/Adobe-GB1 /BousungEG-Light-GB ; + +%/ZenKai-Medium << /FileType /TrueType /Path (ukai.ttf) /CSI [(CNS1) 4] >> ; +%/ShanHeiSun-Light << /FileType /TrueType /Path (uming.ttf) /CSI [(CNS1) 4] >> ; +%/Adobe-CNS1 /ShanHeiSun-Light ; + diff --git a/patches/source/ghostscript/ghostscript-pdf2dsc.patch b/patches/source/ghostscript/ghostscript-pdf2dsc.patch new file mode 100644 index 00000000..31b6b544 --- /dev/null +++ b/patches/source/ghostscript/ghostscript-pdf2dsc.patch @@ -0,0 +1,12 @@ +diff -up ghostscript-8.71/lib/pdf2dsc.ps.pdf2dsc ghostscript-8.71/lib/pdf2dsc.ps +--- ghostscript-8.71/lib/pdf2dsc.ps.pdf2dsc 2010-02-20 15:50:51.287734970 +0000 ++++ ghostscript-8.71/lib/pdf2dsc.ps 2010-02-20 15:51:02.902609964 +0000 +@@ -116,7 +116,7 @@ systemdict /.setsafe known { .setsafe } + DSCfile PDFname write==only + ( \(r\) file { DELAYSAFER { .setsafe } if } stopped pop\n) puts + ( pdfopen begin\n) puts +- ( copy_trailer_attrs\n) puts ++ ( process_trailer_attrs\n) puts + (%%EndSetup\n) puts + + /.hasPageLabels false def % see "Page Labels" in the PDF Reference diff --git a/patches/source/ghostscript/ghostscript.SlackBuild b/patches/source/ghostscript/ghostscript.SlackBuild new file mode 100755 index 00000000..e3ce584f --- /dev/null +++ b/patches/source/ghostscript/ghostscript.SlackBuild @@ -0,0 +1,190 @@ +#!/bin/sh + +# Copyright 2006, 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PKGNAM=ghostscript +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-3_slack13.1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-${PKGNAM} +rm -rf $PKG +mkdir -p $TMP $PKG + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +cd $TMP +rm -rf ${PKGNAM}-${VERSION} +tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1 +cd ${PKGNAM}-$VERSION + +zcat $CWD/ghostscript-pdf2dsc.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/ghostscript.fix_black_page.diff.gz | patch -p1 --verbose || exit 1 + +## Regenerate ./configure: +#sh autogen.sh + +# Make sure ownerships and permissions are sane: +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Build/install IJS: +( cd ijs + if [ ! -r configure ]; then + sh autogen.sh + fi + CFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --program-prefix= \ + --program-suffix= \ + --build=$ARCH-slackware-linux + make || exit 1 + make install || exit 1 + make install DESTDIR=$PKG || exit 1 +) || exit 1 + +# Configure: +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --with-fontpath=/usr/share/fonts/TTF \ + --with-ijs \ + --disable-compile-inits \ + --enable-dynamic \ + --enable-cairo=no \ + --program-prefix= \ + --program-suffix= \ + --build=$ARCH-slackware-linux + +# Build and install: +make || exit 1 +make install DESTDIR=$PKG || exit 1 +make clean || exit 1 +make so || exit 1 +make soinstall DESTDIR=$PKG || exit 1 + +# Replace the default cidfmap with one containing additional +# support for CJK printing: + +if [ -r $PKG/usr/share/ghostscript/${VERSION}/Resource/Init/cidfmap ]; then + mv $PKG/usr/share/ghostscript/${VERSION}/Resource/Init/cidfmap $PKG/usr/share/ghostscript/${VERSION}/Resource/Init/cidfmap.default.ghostscript-${VERSION} + zcat $CWD/cidfmap.gz > $PKG/usr/share/ghostscript/${VERSION}/Resource/Init/cidfmap.new +fi + +# Strip binaries: +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +# Compress and link manpages, if any: +if [ -d $PKG/usr/man ]; then + ( cd $PKG/usr/man + for manpagedir in $(find . -type d -name "man*") ; do + ( cd $manpagedir + for eachpage in $( find . -type l -maxdepth 1) ; do + ln -s $( readlink $eachpage ).gz $eachpage.gz + rm $eachpage + done + gzip -9 *.* + ) + done + ) +fi + +# Compress info files, if any: +if [ -d $PKG/usr/info ]; then + ( cd $PKG/usr/info + rm -f dir + gzip -9 * + ) +fi + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +( cd doc + cp -a \ + COPYING ../LICENSE README \ + $PKG/usr/doc/${PKGNAM}-$VERSION +) +( cd $PKG/usr/doc/${PKGNAM}-$VERSION + ln -sf /usr/share/ghostscript/$VERSION/doc doc +) + +cd $TMP +cp -a ${PKGNAM}-${VERSION}/examples/cjk $PKG/usr/share/ghostscript/${VERSION}/examples/ + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat << EOF > $PKG/install/doinst.sh +#!/bin/sh +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config usr/share/ghostscript/${VERSION}/Resource/Init/cidfmap.new +EOF + +cd $PKG +/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz + diff --git a/patches/source/ghostscript/ghostscript.fix_black_page.diff b/patches/source/ghostscript/ghostscript.fix_black_page.diff new file mode 100644 index 00000000..afcbf473 --- /dev/null +++ b/patches/source/ghostscript/ghostscript.fix_black_page.diff @@ -0,0 +1,99 @@ +From 6d26e9b1c38d8c0f0ab4af42c513cb23f3ae1656 Mon Sep 17 00:00:00 2001 +From: till <till@a1074d23-0009-0410-80fe-cf8c14f379e6> +Date: Tue, 9 Mar 2010 16:35:06 +0000 +Subject: [PATCH] Fixes on CUPS Raster output device: + - Fixed memory reallocation on bitmap size change. Reallocation is not only + needed when dimendions and margins change, but also when the color depth + changes. Fixes bugs #691029 and #691108. + - Fixed arrayoption() macro in cups_put_params() function. Array values did + not get actually set in cups.header data structure. Bug only showed via + a compiler warning. + - Silenced compiler warning by presetting c0..c3 in cups_map_cmyk() to zero. + +git-svn-id: http://svn.ghostscript.com/ghostscript/trunk/gs@10890 a1074d23-0009-0410-80fe-cf8c14f379e6 +--- + cups/gdevcups.c | 32 +++++++++++++++++++++++--------- + 1 files changed, 23 insertions(+), 9 deletions(-) + +diff --git a/cups/gdevcups.c b/cups/gdevcups.c +index 551b806..4000abf 100644 +--- a/cups/gdevcups.c ++++ b/cups/gdevcups.c +@@ -975,7 +975,8 @@ cups_map_cmyk(gx_device *pdev, /* I - Device info */ + frac k, /* I - Black value */ + frac *out) /* O - Device colors */ + { +- int c0, c1, c2, c3; /* Temporary color values */ ++ int c0 = 0, c1 = 0, ++ c2 = 0, c3 = 0; /* Temporary color values */ + float rr, rg, rb, /* Real RGB colors */ + ciex, ciey, ciez, /* CIE XYZ colors */ + ciey_yn, /* Normalized luminance */ +@@ -2703,9 +2704,13 @@ cups_put_params(gx_device *pdev, /* I - Device info */ + int color_set; /* Were the color attrs set? */ + gdev_prn_space_params sp; /* Space parameter data */ + int width, /* New width of page */ +- height; /* New height of page */ ++ height, /* New height of page */ ++ colorspace, /* New color space */ ++ bitspercolor; /* New bits per color */ + static int width_old = 0, /* Previous width */ +- height_old = 0; /* Previous height */ ++ height_old = 0, /* Previous height */ ++ colorspace_old = 0,/* Previous color space */ ++ bitspercolor_old = 0;/* Previous bits per color */ + ppd_attr_t *backside = NULL, + *backsiderequiresflippedmargins = NULL; + float swap; +@@ -2800,9 +2805,10 @@ cups_put_params(gx_device *pdev, /* I - Device info */ + else if (code == 0) \ + { \ + dprintf1("DEBUG: Setting %s to", sname); \ +- for (i = 0; i < count; i ++) \ +- dprintf1(" %d", (unsigned)(arrayval.data[i])); \ +- cups->header.name[i] = (unsigned)arrayval.data[i]; \ ++ for (i = 0; i < count; i ++) { \ ++ dprintf1(" %d", (unsigned)(arrayval.data[i])); \ ++ cups->header.name[i] = (unsigned)(arrayval.data[i]); \ ++ } \ + dprintf("...\n"); \ + } + +@@ -3243,23 +3249,31 @@ cups_put_params(gx_device *pdev, /* I - Device info */ + } + #endif /* CUPS_RASTER_SYNCv1 */ + ++ colorspace = cups->header.cupsColorSpace; ++ bitspercolor = cups->header.cupsBitsPerColor; ++ + /* + * Don't reallocate memory unless the device has been opened... + * Also reallocate only if the size has actually changed... + */ + +- if (pdev->is_open && (width != width_old || height != height_old)) ++ if (pdev->is_open && ++ (width != width_old || height != height_old || ++ colorspace != colorspace_old || bitspercolor != bitspercolor_old)) + { + + width_old = width; + height_old = height; ++ colorspace_old = colorspace; ++ bitspercolor_old = bitspercolor; + + /* + * Device is open and size has changed, so reallocate... + */ + +- dprintf4("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n", +- pdev->MediaSize[0], pdev->MediaSize[1], width, height); ++ dprintf6("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels, color space: %d, bits per color: %d...\n", ++ pdev->MediaSize[0], pdev->MediaSize[1], width, height, ++ colorspace, bitspercolor); + + sp = ((gx_device_printer *)pdev)->space_params; + +-- +1.6.6.1 + diff --git a/patches/source/ghostscript/slack-desc b/patches/source/ghostscript/slack-desc new file mode 100644 index 00000000..1ac40827 --- /dev/null +++ b/patches/source/ghostscript/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +ghostscript: ghostscript (GPL Ghostscript) +ghostscript: +ghostscript: GPL Ghostscript is an interpreter of Adobe Systems' PostScript(tm) +ghostscript: and Portable Document Format (PDF) languages. Ghostscript is an +ghostscript: essential part of the printing subsystem, taking PostScript output +ghostscript: from applications and converting it into an appropriate printer or +ghostscript: display format. Ghostscript supports many printers directly, and +ghostscript: more are supported through add-on packages. +ghostscript: +ghostscript: +ghostscript: |