OCaml 4.14.0 rebuild
[arch-packages.git] / ghostscript / trunk / PKGBUILD
bloba133ae2c1dfccca38ace015116da3b27cf838e99
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
3 pkgbase=ghostscript
4 pkgname=(ghostscript ghostxps ghostpcl)
5 pkgver=9.56.1
6 pkgrel=1
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 sha512sums=('7eb3e6b8de83d0e31cc976151164326cdc110741eb2e9cddb59ab9590e15a6535659e50dea4feb643b9b3b6d90a26d01fe0326a400833e82b22f0091146151cc'
20             'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d')
23 ### update jbig2dec first! ###
26 prepare() {
27   cd ghostpdl-${pkgver}
29   # *** remove after final decision ***
30   # new in 9.54.0: 
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
53   
54   # http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=40dc5b409c6262b18b4bf5386b5482ead4c511e3
55   # libs link unwanted to libgpdl that isn't installed
56   rm -rf gpdl
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
65 build() {
66   cd ghostpdl-${pkgver}
67   ./configure --prefix=/usr \
68               --enable-dynamic \
69               --with-ijs \
70               --with-jbig2dec \
71               --with-x \
72               --with-drivers=ALL \
73               --with-fontpath=/usr/share/fonts/gsfonts \
74               --without-versioned-path \
75               --enable-fontconfig \
76               --enable-freetype \
77               --enable-openjpeg \
78               --with-system-libtiff \
79               --with-libpaper \
80               --disable-compile-inits #--help # needed for linking with system-zlib
81   make
84 package_ghostscript() {
85   optdepends=('texlive-core:      needed for dvipdf'
86               'gtk3:              needed for gsx')
88   cd ghostpdl-${pkgver}
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
101 package_ghostxps() {
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
111   
112   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
115 package_ghostpcl() {
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