1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
4 pkgname=(ghostscript ghostxps ghostpcl)
7 pkgdesc="An interpreter for the PostScript language"
8 url="https://www.ghostscript.com/"
10 license=('AGPL3' 'custom')
11 depends=('libxt' 'libcups' 'fontconfig' 'zlib' 'libpng' 'libjpeg' 'jbig2dec'
12 'libtiff' 'lcms2' 'dbus' 'libpaper' 'ijs' 'openjpeg2' 'libidn')
13 makedepends=('gtk3' 'gnutls' 'glu' 'freeglut')
15 # https://github.com/ArtifexSoftware/ghostpdl-downloads/releases
16 source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver//./}/ghostpdl-${pkgver}.tar.xz
17 #https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/ghostpdl-${pkgver/.0//}/ghostpdl-${pkgver}.tar.xz
18 2010_add_build_timestamp_setting.patch)
19 sha512sums=('7eb3e6b8de83d0e31cc976151164326cdc110741eb2e9cddb59ab9590e15a6535659e50dea4feb643b9b3b6d90a26d01fe0326a400833e82b22f0091146151cc'
20 'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d')
23 ### update jbig2dec first! ###
29 # *** remove after final decision ***
31 # https://www.ghostscript.com/doc/9.54.0/News.htm
33 # 1) inclusion of the tesseract/leptonica sources for OCR capabilities
34 # at the moment we do not support linking with tesseract/leptonica shared libraries.
35 # As is normal with such included libraries, deleting those directories and (re)running
36 # configure (on Unix like systems) will automatically build without the OCR functionality.
37 # increases package size ghostpcl 2.7->4.9MB | ghostscript 18->23MB | ghostxps 2,7->4.9MB
38 # https://www.ghostscript.com/doc/9.54.0/VectorDevices.htm#UseOCR -
39 # this doesn't seem to be worth to keep enabled until linking with shared libs is supported
40 rm -r tesseract leptonica
42 # 2) new directory addition in the source tree: "extract/".
43 # It contains the implementation for the writing of docx format files used by the
44 # new "docxwrite" device. This is *not* a "thirdparty library".
45 # For distribution package maintainers, if you want your packaged Ghostscript to include
46 # the "docxwrite" device, do not delete this directory.
47 # ^ this one doesn't affect package size - so let's keep it
49 # force it to use system-libs
50 rm -r cups/libs expat ijs jbig2dec jpeg lcms2mt libpng openjpeg tiff zlib
51 # using tree freetype because of https://bugs.archlinux.org/task/56849
52 # lcms2mt is the new lcms2 fork aimed to replace lcms2 in a thread safe way
54 # http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=40dc5b409c6262b18b4bf5386b5482ead4c511e3
55 # libs link unwanted to libgpdl that isn't installed
58 # https://bugs.ghostscript.com/show_bug.cgi?id=704405
59 sed -i "s/gscms_transformm_color_const/gscms_transform_color_const/" base/gsicc_lcms2.c
61 # Debian: # allow the build timestamp to be externally set
62 patch -Np1 -i ../2010_add_build_timestamp_setting.patch
67 ./configure --prefix=/usr \
73 --with-fontpath=/usr/share/fonts/gsfonts \
74 --without-versioned-path \
78 --with-system-libtiff \
80 --disable-compile-inits #--help # needed for linking with system-zlib
84 package_ghostscript() {
85 optdepends=('texlive-core: needed for dvipdf'
86 'gtk3: needed for gsx')
89 make DESTDIR="${pkgdir}" install-gs install-so-gs
91 # replace statically linked gs binary with symlink to dynamically linked gsc
92 rm -v "${pkgdir}"/usr/bin/gs
93 ln -s gsc "${pkgdir}"/usr/bin/gs
95 # remove unwanted localized manpages
96 rm -rv "${pkgdir}"/usr/share/man/de
98 install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
102 pkgdesc="${pkgdesc/PostScript/XPS document}"
103 depends=("ghostscript=${pkgver}-${pkgrel}")
105 cd ghostpdl-${pkgver}
106 make DESTDIR="${pkgdir}" install-gxps install-so-gxps
107 rm -r "${pkgdir}"/usr/include
109 # fix file conflict - FS#70238
110 rm -r "${pkgdir}"/usr/lib/libgxps.so
112 install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
116 pkgdesc="${pkgdesc/PostScript/PCL 6}"
117 depends=("ghostscript=${pkgver}-${pkgrel}")
119 cd ghostpdl-${pkgver}
120 make DESTDIR="${pkgdir}" install-gpcl6 install-so-gpcl6
121 rm -r "${pkgdir}"/usr/include
123 install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE