archrelease: copy trunk to extra-x86_64
[arch-packages.git] / ghostscript / trunk / PKGBUILD
blob09337bb42dafcc42bdfbd9b17e1dbdd9e2d1d059
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
3 pkgbase=ghostscript
4 pkgname=(ghostscript ghostxps ghostpcl)
5 pkgver=9.55.0
6 pkgrel=4
7 pkgdesc="An interpreter for the PostScript language"
8 url="https://www.ghostscript.com/"
9 arch=('x86_64')
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')
14 options=('debug')
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         fix-gx_default_copy_alpha.patch::"https://git.ghostscript.com/?p=ghostpdl.git;a=patch;h=d9d8db23e862707795e76ea8f8cdcf7434b2df65")
20 sha512sums=('d23864be1548ce7c7ae61398f52c34c5485dfe74e78bf7ef16c8fa5690e2ea857cc9795409a70feda5ff78c27b3c2bbc0e0710d190763fca77137ee9c56a0fed'
21             'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d'
22             '94a63b2d33cf1412bfba75d4cab31c5d6f00846b2e608ad82200ff0d55a11bb80d827c12d4edd1f38cef029cae6cdcd5e39cd98791a17bf356119ba8f74fd0a9')
24 ### update jbig2dec first! ###
26 ### make sure to rebuild core/groff on version updates - https://bugs.archlinux.org/task/67751 ###
28 prepare() {
29   cd ghostpdl-${pkgver}
31   # *** remove after final decision ***
32   # new in 9.54.0: 
33   # https://www.ghostscript.com/doc/9.54.0/News.htm
35   # 1) inclusion of the tesseract/leptonica sources for OCR capabilities
36   # at the moment we do not support linking with tesseract/leptonica shared libraries. 
37   # As is normal with such included libraries, deleting those directories and (re)running
38   # configure (on Unix like systems) will automatically build without the OCR functionality.
39   # increases package size ghostpcl 2.7->4.9MB | ghostscript 18->23MB | ghostxps 2,7->4.9MB
40   # https://www.ghostscript.com/doc/9.54.0/VectorDevices.htm#UseOCR - 
41   # this doesn't seem to be worth to keep enabled until linking with shared libs is supported
42   rm -r tesseract leptonica
44   # 2) new directory addition in the source tree: "extract/". 
45   # It contains the implementation for the writing of docx format files used by the
46   # new "docxwrite" device. This is *not* a "thirdparty library". 
47   # For distribution package maintainers, if you want your packaged Ghostscript to include
48   # the "docxwrite" device, do not delete this directory.
49   # ^ this one doesn't affect package size - so let's keep it
51   # force it to use system-libs
52   rm -r cups/libs expat ijs jbig2dec jpeg lcms2mt libpng openjpeg tiff zlib
53   # using tree freetype because of https://bugs.archlinux.org/task/56849
54   # lcms2mt is the new lcms2 fork aimed to replace lcms2 in a thread safe way
55   
56   # http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=40dc5b409c6262b18b4bf5386b5482ead4c511e3
57   # libs link unwanted to libgpdl that isn't installed
58   rm -rf gpdl
60   # https://bugs.ghostscript.com/show_bug.cgi?id=704405
61   sed -i "s/gscms_transformm_color_const/gscms_transform_color_const/" base/gsicc_lcms2.c
63   # Debian: # allow the build timestamp to be externally set
64   patch -Np1 -i ../2010_add_build_timestamp_setting.patch
66   # Fix build of asymptote
67   patch -Np1 -i ../fix-gx_default_copy_alpha.patch
70 build() {
71   cd ghostpdl-${pkgver}
72   ./configure --prefix=/usr \
73               --enable-dynamic \
74               --with-ijs \
75               --with-jbig2dec \
76               --with-x \
77               --with-drivers=ALL \
78               --with-fontpath=/usr/share/fonts/gsfonts \
79               --enable-fontconfig \
80               --enable-freetype \
81               --enable-openjpeg \
82               --with-system-libtiff \
83               --with-libpaper \
84               --disable-compile-inits #--help # needed for linking with system-zlib
85   make
88 package_ghostscript() {
89   optdepends=('texlive-core:      needed for dvipdf'
90               'gtk3:              needed for gsx')
92   cd ghostpdl-${pkgver}
93   make DESTDIR="${pkgdir}"  install-gs install-so-gs
94   # replace statically linked gs binary with symlink to dynamically linked gsc
95   rm -v "${pkgdir}"/usr/bin/gs
96   ln -s gsc "${pkgdir}"/usr/bin/gs
98   # remove unwanted localized manpages
99   rm -rv "${pkgdir}"/usr/share/man/de
101   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
104 package_ghostxps() {
105   pkgdesc="${pkgdesc/PostScript/XPS document}"
106   depends=("ghostscript=${pkgver}-${pkgrel}")
108   cd ghostpdl-${pkgver}
109   make DESTDIR="${pkgdir}" install-gxps install-so-gxps
110   rm -r "${pkgdir}"/usr/include
111   
112   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
114   # fix file conflict - FS#70238
115   rm -r "${pkgdir}"/usr/lib/libgxps.so
118 package_ghostpcl() {
119   pkgdesc="${pkgdesc/PostScript/PCL 6}"
120   depends=("ghostscript=${pkgver}-${pkgrel}")
122   cd ghostpdl-${pkgver}
123   make DESTDIR="${pkgdir}" install-gpcl6 install-so-gpcl6
124   rm -r "${pkgdir}"/usr/include
126   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE