From 18019242c4e527f7140f92336061562b8cfb50fb Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sat, 12 Feb 2011 13:00:37 -0300 Subject: ghostscript-libre-9.01-1 --- libre/ghostscript-libre/PKGBUILD | 83 +++++--- .../ghostscript-gdevcups-691733.patch | 107 ++++++++++ libre/ghostscript-libre/gs_bug691759and691760.diff | 215 +++++++++++++++++++++ libre/ghostscript-libre/svn_rev11948.diff | 16 ++ 4 files changed, 392 insertions(+), 29 deletions(-) create mode 100644 libre/ghostscript-libre/ghostscript-gdevcups-691733.patch create mode 100644 libre/ghostscript-libre/gs_bug691759and691760.diff create mode 100644 libre/ghostscript-libre/svn_rev11948.diff (limited to 'libre/ghostscript-libre') diff --git a/libre/ghostscript-libre/PKGBUILD b/libre/ghostscript-libre/PKGBUILD index ada545c8e..254358ed4 100644 --- a/libre/ghostscript-libre/PKGBUILD +++ b/libre/ghostscript-libre/PKGBUILD @@ -3,60 +3,81 @@ # Maintainer (Parabola): xihh pkgname=ghostscript-libre -pkgver=9.00 -pkgrel=3 +pkgver=9.01 +pkgrel=1 pkgdesc="An interpreter for the PostScript language without non-free files" arch=('i686' 'x86_64') license=('GPL3') #non free files removed -depends=('libxext' 'libxt' 'libcups>=1.4.2-3' 'fontconfig>=2.8.0' 'gnutls>=2.8.5' 'cairo>=1.8.8-2' - 'jasper>=1.900.1-4' 'zlib' 'libpng>=1.4.0' 'libjpeg>=8') -makedepends=('automake' 'autoconf' 'gtk2>=2.18.6') -optdepends=('texlive-core: dvipdf' - 'gtk2: gsx') +depends=('libxt' 'libcups' 'fontconfig' 'jasper' 'zlib' 'libpng' 'libjpeg' 'libtiff') +makedepends=('gtk2' 'gnutls') +optdepends=('texlive-core: needed for dvipdf' + 'gtk2: needed for gsx') conflicts=('ghostscript') replaces=('ghostscript-lrpng' 'ghostscript') -provides=('ghostscript-lprng' "ghostscript=${pkgver}") +provides=('ghostscript-lprng' "ghostscript") url="http://www.ghostscript.com/" -source=(http://ghostscript.com/releases/ghostscript-${pkgver}.tar.xz +source=(http://ghostscript.com/releases/ghostscript-${pkgver}.tar.bz2 ghostscript-fPIC.patch - ghostscript-system-jasper.patch) + ghostscript-system-jasper.patch + svn_rev11948.diff + ghostscript-gdevcups-691733.patch + gs_bug691759and691760.diff) options=('!libtool' '!makeflags') -md5sums=('1ca5f245677f78f573e6490bdb40702f' +md5sums=('9824d6a21ad8b4a831f67601959f1181' '766d44c47c693f96941b658e360c1277' - '03e27cd02471ab3b642c344fa06b623e') + '03e27cd02471ab3b642c344fa06b623e' + '78f2b9c2d6a5a60891b2d8b593a15b00' + 'e459d4cf897bdb54fefbba9d57bd2fa2' + '21841b0ea5bd67cf4b68ba64c5d5755b') build() { cd ${srcdir}/ghostscript-${pkgver} # force it to use system-libs - rm -rf jpeg libpng zlib jasper expat + rm -rf jpeg libpng zlib jasper expat tiff # delete non-free packages - grep -l "are not altered" Resource/CMap/* | xargs rm -f + grep -l "are not altered" Resource/CMap/* | xargs rm -fv + # fix build with systems jasper - patch -Np1 -i ${srcdir}/ghostscript-system-jasper.patch || return 1 +# patch -Np1 -i ${srcdir}/ghostscript-system-jasper.patch - if [ "$CARCH" = "x86_64" ]; then - patch -Np1 -i ${srcdir}/ghostscript-fPIC.patch || return 1 - fi +# if [ "$CARCH" = "x86_64" ]; then +# patch -Np1 -i ${srcdir}/ghostscript-fPIC.patch +# fi + # part of https://bugs.archlinux.org/task/22006 - http://bugs.ghostscript.com/show_bug.cgi?id=691831 +# patch -Np2 -i ${srcdir}/svn_rev11948.diff + # upstream fix for http://bugs.ghostscript.com/show_bug.cgi?id=691733 / part of https://bugs.archlinux.org/task/21388 + # patch taken from Fedora RawHide master +# patch -Np1 -i ${srcdir}/ghostscript-gdevcups-691733.patch + # patch for http://bugs.ghostscript.com/show_bug.cgi?id=691760 and http://bugs.ghostscript.com/show_bug.cgi?id=691759 / part of https://bugs.archlinux.org/task/21388 +# patch -Np2 -i ${srcdir}/gs_bug691759and691760.diff + +# ./autogen.sh + ./configure --prefix=/usr \ + --enable-dynamic \ + --with-ijs \ + --with-jbig2dec \ + --with-omni \ + --with-x \ + --with-drivers=ALL\ + --with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \ + --disable-compile-inits # needed for linking with system-zlib + make + # Build IJS cd ${srcdir}/ghostscript-${pkgver}/ijs ./autogen.sh ./configure --prefix=/usr --enable-shared --disable-static - make || return 1 - make -j1 DESTDIR=${pkgdir} install || return 1 + make +} - cd .. - ./autogen.sh - ./configure --prefix=/usr --enable-dynamic --with-ijs \ - --with-jbig2dec --with-omni --with-x --with-drivers=ALL\ - --with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \ - --disable-compile-inits # needed for linking with system-zlib - make || return 1 - make -j1 DESTDIR=${pkgdir} \ +package() { + cd ${srcdir}/ghostscript-${pkgver} + make DESTDIR=${pkgdir} \ cups_serverroot=${pkgdir}/etc/cups \ cups_serverbin=${pkgdir}/usr/lib/cups install soinstall - # install a missing doc files # http://bugs.archlinux.org/task/18023 + # install missing doc files # http://bugs.archlinux.org/task/18023 install -m 644 ${srcdir}/ghostscript-${pkgver}/doc/{Ps2ps2.htm,gs-vms.hlp,gsdoc.el,pscet_status.txt} ${pkgdir}/usr/share/ghostscript/$pkgver/doc/ mkdir -p ${pkgdir}/usr/share/licenses/${pkgname} @@ -64,4 +85,8 @@ build() { # remove unwanted localized man-pages rm -rf $pkgdir/usr/share/man/[^man1]* + + # install IJS + cd ${srcdir}/ghostscript-${pkgver}/ijs + make DESTDIR=${pkgdir} install } diff --git a/libre/ghostscript-libre/ghostscript-gdevcups-691733.patch b/libre/ghostscript-libre/ghostscript-gdevcups-691733.patch new file mode 100644 index 000000000..2f93f2e44 --- /dev/null +++ b/libre/ghostscript-libre/ghostscript-gdevcups-691733.patch @@ -0,0 +1,107 @@ +diff -up ghostscript-9.00/cups/gdevcups.c.gdevcups-691733 ghostscript-9.00/cups/gdevcups.c +--- ghostscript-9.00/cups/gdevcups.c.gdevcups-691733 2011-01-10 16:48:57.381703112 +0000 ++++ ghostscript-9.00/cups/gdevcups.c 2011-01-10 16:52:02.021813786 +0000 +@@ -2898,11 +2898,12 @@ cups_put_params(gx_device *pdev, /* + int margins_set; /* Were the margins set? */ + int size_set; /* Was the size set? */ + int color_set; /* Were the color attrs set? */ +- gdev_prn_space_params sp; /* Space parameter data */ ++ gdev_prn_space_params sp_old; /* Space parameter data */ + int width, /* New width of page */ + height, /* New height of page */ + width_old = 0, /* Previous width of page */ + height_old = 0; /* Previous height of page */ ++ bool transp_old = 0; /* Previous transparency usage state */ + ppd_attr_t *backside = NULL, + *backsiderequiresflippedmargins = NULL; + float swap; +@@ -2996,11 +2997,23 @@ cups_put_params(gx_device *pdev, /* + } \ + } + ++ sp_old = ((gx_device_printer *)pdev)->space_params; ++ width_old = pdev->width; ++ height_old = pdev->height; ++ transp_old = cups->page_uses_transparency; + size_set = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 || + param_read_float_array(plist, "PageSize", &arrayval) == 0; + margins_set = param_read_float_array(plist, "Margins", &arrayval) == 0; + color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 || + param_read_int(plist, "cupsBitsPerColor", &intval) == 0; ++ /* We set the old dimensions to 1 if we have a color depth change, so ++ that memory reallocation gets forced. This is perhaps not the correct ++ approach to prevent crashes like in bug 690435. We keep it for the ++ time being until we decide finally */ ++ if (color_set) { ++ width_old = 1; ++ height_old = 1; ++ } + /* We also recompute page size and margins if we simply get onto a new + page without necessarily having a page size change in the PostScript + code, as for some printers margins have to be flipped on the back sides of +@@ -3081,9 +3094,9 @@ cups_put_params(gx_device *pdev, /* + stringoption(cupsPageSizeName, "cupsPageSizeName"); + #endif /* CUPS_RASTER_SYNCv1 */ + +- if ((code = param_read_string(plist, "cups->Profile", &stringval)) < 0) ++ if ((code = param_read_string(plist, "cupsProfile", &stringval)) < 0) + { +- param_signal_error(plist, "cups->Profile", code); ++ param_signal_error(plist, "cupsProfile", code); + return (code); + } + else if (code == 0) +@@ -3096,7 +3109,7 @@ cups_put_params(gx_device *pdev, /* + + cups_set_color_info(pdev); + +- /* ++ /* + * Then process standard page device options... + */ + +@@ -3404,17 +3417,6 @@ cups_put_params(gx_device *pdev, /* + * does not keep track of the margins in the bitmap size... + */ + +- /* We set the old dimensions to -1 if we have a color depth change, so +- that memory reallocation gets forced. This is perhaps not the correct +- approach to preven crashes like in bug 690435. We keep it for the +- time being until we decide finally */ +- if (color_set) { +- width_old = -1; +- height_old = -1; +- } else { +- width_old = pdev->width; +- height_old = pdev->height; +- } + if (cups->landscape) + { + width = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) * +@@ -3457,11 +3459,10 @@ cups_put_params(gx_device *pdev, /* + pdev->MediaSize[0], pdev->MediaSize[1], width, height); + #endif /* DEBUG */ + +- sp = ((gx_device_printer *)pdev)->space_params; +- +- if ((code = gdev_prn_maybe_realloc_memory((gx_device_printer *)pdev, &sp, ++ if ((code = gdev_prn_maybe_realloc_memory((gx_device_printer *)pdev, ++ &sp_old, + width_old, height_old, +- cups->page_uses_transparency)) ++ transp_old)) + < 0) + return (code); + #ifdef DEBUG +@@ -3642,6 +3643,10 @@ cups_set_color_info(gx_device *pdev) /* + cups->header.cupsBitsPerPixel = cups->header.cupsBitsPerColor; + cups->color_info.depth = cups->header.cupsBitsPerPixel; + cups->color_info.num_components = 1; ++ cups->color_info.dither_grays = 1L << cups->header.cupsBitsPerColor; ++ cups->color_info.dither_colors = 1L << cups->header.cupsBitsPerColor; ++ cups->color_info.max_gray = cups->color_info.dither_grays - 1; ++ cups->color_info.max_color = cups->color_info.dither_grays - 1; + break; + + case CUPS_CSPACE_CMY : + diff --git a/libre/ghostscript-libre/gs_bug691759and691760.diff b/libre/ghostscript-libre/gs_bug691759and691760.diff new file mode 100644 index 000000000..ca394427a --- /dev/null +++ b/libre/ghostscript-libre/gs_bug691759and691760.diff @@ -0,0 +1,215 @@ +Modified: trunk/gs/base/gdevnfwd.c +=================================================================== +--- trunk/gs/base/gdevnfwd.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gdevnfwd.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -1117,3 +1117,29 @@ + { + return 0; + } ++ ++bool ++fwd_uses_fwd_cmap_procs(gx_device * dev) ++{ ++ const gx_cm_color_map_procs *pprocs; ++ ++ pprocs = dev_proc(dev, get_color_mapping_procs)(dev); ++ if (pprocs == &FwdDevice_cm_map_procs) { ++ return true; ++ } ++ return false; ++} ++ ++const gx_cm_color_map_procs* ++fwd_get_target_cmap_procs(gx_device * dev) ++{ ++ const gx_cm_color_map_procs *pprocs; ++ gx_device_forward * const fdev = (gx_device_forward *)dev; ++ gx_device * const tdev = fdev->target; ++ ++ pprocs = dev_proc(tdev, get_color_mapping_procs(tdev)); ++ while (pprocs == &FwdDevice_cm_map_procs) { ++ pprocs = fwd_get_target_cmap_procs(tdev); ++ } ++ return pprocs; ++} +\ No newline at end of file + +Modified: trunk/gs/base/gdevp14.c +=================================================================== +--- trunk/gs/base/gdevp14.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gdevp14.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -900,7 +900,11 @@ + nos->parent_color_info_procs->num_components, 1, + false, false, true, tos->planestride, + tos->rowstride, num_rows, num_cols); +- /* Transform the data */ ++ /* Transform the data. Since the pdf14 device should be ++ using RGB, CMYK or Gray buffers, this transform ++ does not need to worry about the cmap procs of ++ the target device. Those are handled when we do ++ the pdf14 put image operation */ + gscms_transform_color_buffer(icc_link, &input_buff_desc, + &output_buff_desc, tos->data, + new_data_buf); + +Modified: trunk/gs/base/gxcmap.c +=================================================================== +--- trunk/gs/base/gxcmap.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gxcmap.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -31,6 +31,7 @@ + #include "gsicc_manage.h" + #include "gdevdevn.h" + #include "gsicc_cache.h" ++#include "gscms.h" + + /* Structure descriptor */ + public_st_device_color(); +@@ -1744,3 +1745,37 @@ + + } + } ++ ++bool ++gx_device_uses_std_cmap_procs(gx_device * dev) ++{ ++ const gx_cm_color_map_procs *pprocs; ++ ++ if (dev->device_icc_profile != NULL) { ++ pprocs = dev_proc(dev, get_color_mapping_procs)(dev); ++ /* Check if they are forwarding procs */ ++ if (fwd_uses_fwd_cmap_procs(dev)) { ++ pprocs = fwd_get_target_cmap_procs(dev); ++ } ++ switch(dev->device_icc_profile->data_cs) { ++ case gsGRAY: ++ if (pprocs == &DeviceGray_procs) { ++ return true; ++ } ++ break; ++ case gsRGB: ++ if (pprocs == &DeviceRGB_procs) { ++ return true; ++ } ++ break; ++ case gsCMYK: ++ if (pprocs == &DeviceCMYK_procs) { ++ return true; ++ } ++ break; ++ default: ++ break; ++ } ++ } ++ return false; ++} + +Modified: trunk/gs/base/gxcmap.h +=================================================================== +--- trunk/gs/base/gxcmap.h 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gxcmap.h 2011-01-07 04:49:42 UTC (rev 12005) +@@ -284,5 +284,11 @@ + * [0,1] + */ + frac gx_unit_frac(float fvalue); ++/* Determine if the device is using the standard color mapping procs. In ++ such a case, we can make use of the faster icc color conversions for ++ images */ ++bool gx_device_uses_std_cmap_procs(gx_device * dev); ++bool fwd_uses_fwd_cmap_procs(gx_device * dev); ++const gx_cm_color_map_procs* fwd_get_target_cmap_procs(gx_device * dev); + + #endif /* gxcmap_INCLUDED */ + +Modified: trunk/gs/base/gxi12bit.c +=================================================================== +--- trunk/gs/base/gxi12bit.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gxi12bit.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -113,6 +113,8 @@ + irender_proc_t + gs_image_class_2_fracs(gx_image_enum * penum) + { ++ bool std_cmap_procs; ++ + if (penum->bps > 8) { + if (penum->use_mask_color) { + /* Convert color mask values to fracs. */ +@@ -122,9 +124,14 @@ + penum->mask_color.values[i] = + bits2frac(penum->mask_color.values[i], 12); + } ++ /* If the device has some unique color mapping procs due to its color space, ++ then we will need to use those and go through pixel by pixel instead ++ of blasting through buffers. This is true for example with many of ++ the color spaces for CUPs */ ++ std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev); + if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN && + penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color || +- penum->bps != 16 || ++ penum->bps != 16 || !std_cmap_procs || + gs_color_space_get_index(penum->pcs) == gs_color_space_index_DevicePixel) { + /* DevicePixel color space used in mask from 3x type. Basically + a simple color space that just is scaled to the device bit + +Modified: trunk/gs/base/gxicolor.c +=================================================================== +--- trunk/gs/base/gxicolor.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gxicolor.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -97,6 +97,8 @@ + irender_proc_t + gs_image_class_4_color(gx_image_enum * penum) + { ++ bool std_cmap_procs; ++ + if (penum->use_mask_color) { + /* + * Scale the mask colors to match the scaling of each sample to +@@ -128,8 +130,14 @@ + penum->mask_color.mask = 0; + penum->mask_color.test = ~0; + } ++ /* If the device has some unique color mapping procs due to its color space, ++ then we will need to use those and go through pixel by pixel instead ++ of blasting through buffers. This is true for example with many of ++ the color spaces for CUPs */ ++ std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev); + if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN && +- penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color ) { ++ penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color || ++ !std_cmap_procs) { + return &image_render_color_DeviceN; + } else { + /* Set up the link now */ + +Modified: trunk/gs/base/gxiscale.c +=================================================================== +--- trunk/gs/base/gxiscale.c 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/gxiscale.c 2011-01-07 04:49:42 UTC (rev 12005) +@@ -104,6 +104,13 @@ + != penum->dev->color_info.num_components) { + use_icc = false; + } ++ /* If the device has some unique color mapping procs due to its color space, ++ then we will need to use those and go through pixel by pixel instead ++ of blasting through buffers. This is true for example with many of ++ the color spaces for CUPs */ ++ if(!gx_device_uses_std_cmap_procs(penum->dev)) { ++ use_icc = false; ++ } + /* + * USE_CONSERVATIVE_INTERPOLATION_RULES is normally NOT defined since + * the MITCHELL digital filter seems OK as long as we are going out to + +Modified: trunk/gs/base/lib.mak +=================================================================== +--- trunk/gs/base/lib.mak 2011-01-06 23:48:14 UTC (rev 12004) ++++ trunk/gs/base/lib.mak 2011-01-07 04:49:42 UTC (rev 12005) +@@ -602,7 +602,7 @@ + $(gxalpha_h) $(gxcspace_h) $(gxfarith_h) $(gxfrac_h)\ + $(gxdcconv_h) $(gxdevice_h) $(gxcmap_h) $(gsnamecl_h) $(gxlum_h)\ + $(gzstate_h) $(gxdither_h) $(gxcdevn_h) $(string__h)\ +- $(gsicc_manage_h) $(gdevdevn_h) $(gsicc_cache_h) ++ $(gsicc_manage_h) $(gdevdevn_h) $(gsicc_cache_h) $(gscms_h) + $(GLCC) $(GLO_)gxcmap.$(OBJ) $(C_) $(GLSRC)gxcmap.c + + $(GLOBJ)gxcpath.$(OBJ) : $(GLSRC)gxcpath.c $(GXERR)\ + diff --git a/libre/ghostscript-libre/svn_rev11948.diff b/libre/ghostscript-libre/svn_rev11948.diff new file mode 100644 index 000000000..92abb0d98 --- /dev/null +++ b/libre/ghostscript-libre/svn_rev11948.diff @@ -0,0 +1,16 @@ +Modified: trunk/gs/base/gximag3x.c +=================================================================== +--- trunk/gs/base/gximag3x.c 2010-12-10 19:50:53 UTC (rev 11947) ++++ trunk/gs/base/gximag3x.c 2010-12-11 23:02:25 UTC (rev 11948) +@@ -241,7 +241,9 @@ + const gs_image3x_mask_t *pixm = + (i == 0 ? &pim->Opacity : &pim->Shape); + +- *(gs_data_image_t *)&mask[i].image = pixm->MaskDict; ++ /* Use memcpy because direct assignment breaks ANSI aliasing */ ++ /* rules and causes SEGV with gcc 4.5.1 */ ++ memcpy(&mask[i].image, &pixm->MaskDict, sizeof(pixm->MaskDict)); + mask[i].image.type = type1; + mask[i].image.BitsPerComponent = pixm->MaskDict.BitsPerComponent; + } + -- cgit v1.2.3-54-g00ecf