archrelease: copy trunk to extra-x86_64
[arch-packages.git] / ghostscript / trunk / PKGBUILD
blob11e883b7c23c0fb17ba52ecd755fb08806125a26
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
3 pkgbase=ghostscript
4 pkgname=(ghostscript ghostxps ghostpcl)
5 pkgver=10.01.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' 'poppler-data')
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 # https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10010/SHA512SUMS
19 sha512sums=('a7c787ff4a8f9e7f7b0e2e659113527e422427a24ac856d63f2f7b864a93e43dd9cf0d1cd4cf44b44f82ba809a72a035e6a1f8f2bef5a9cb268c154dff3a67b1'
20             'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d')
22 ### update jbig2dec first! ###
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
56   
57   # Remove internal CMaps (CMaps from poppler-data are used instead)
58   rm -r Resource/CMap
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               --with-ijs \
68               --with-jbig2dec \
69               --with-x \
70               --with-drivers=ALL \
71               --with-fontpath=/usr/share/fonts/gsfonts \
72               --without-versioned-path \
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 so
82 package_ghostscript() {
83   optdepends=('texlive-core:      needed for dvipdf'
84               'gtk3:              needed for gsx')
86   cd ghostpdl-${pkgver}
87   make -j1 DESTDIR="${pkgdir}" soinstall
88   # split pkg cleanup
89   rm -v "${pkgdir}"/usr/bin/{gpcl6*,gxps*}
90   rm -v "${pkgdir}"/usr/lib/{libgpcl6*,libgxps.so*}
92   # gsc collides with gambit gambit-c
93   mv "${pkgdir}"/usr/bin/{gsc,gs}
94   ln -s gs "${pkgdir}"/usr/bin/ghostscript
95   ln -s /usr/share/man/man1/gs.1.gz "${pkgdir}"/usr/share/man/man1/ghostscript.1
97   # remove obsolete lpr bsd/Unix related files
98   rm -rv "${pkgdir}"/usr/bin/{lprsetup.sh,unix-lpr.sh}
100   # install the CMaps from poppler-data
101   ln -s /usr/share/poppler/cMap "${pkgdir}"/usr/share/ghostscript/Resource/CMap
103   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
106 package_ghostxps() {
107   pkgdesc="${pkgdesc/PostScript/XPS document}"
108   depends=("ghostscript=${pkgver}-${pkgrel}")
110   cd ghostpdl-${pkgver}
111   make DESTDIR="${pkgdir}" install-gxps install-so-gxps
112   rm -r "${pkgdir}"/usr/include
114   # fix file conflict - FS#70238
115   rm -r "${pkgdir}"/usr/lib/libgxps.so
116   
117   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
120 package_ghostpcl() {
121   pkgdesc="${pkgdesc/PostScript/PCL 6}"
122   depends=("ghostscript=${pkgver}-${pkgrel}")
124   cd ghostpdl-${pkgver}
125   make DESTDIR="${pkgdir}" install-gpcl6 install-so-gpcl6
126   rm -r "${pkgdir}"/usr/include
128   install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE