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