This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 247
/
PKGBUILD
124 lines (99 loc) · 4.71 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Maintainer: AndyRTR <andyrtr@archlinux.org>
pkgbase=ghostscript
pkgname=(ghostscript ghostxps ghostpcl)
pkgver=9.56.1
pkgrel=1
pkgdesc="An interpreter for the PostScript language"
url="https://www.ghostscript.com/"
arch=('x86_64')
license=('AGPL3' 'custom')
depends=('libxt' 'libcups' 'fontconfig' 'zlib' 'libpng' 'libjpeg' 'jbig2dec'
'libtiff' 'lcms2' 'dbus' 'libpaper' 'ijs' 'openjpeg2' 'libidn')
makedepends=('gtk3' 'gnutls' 'glu' 'freeglut')
options=('debug')
# https://github.com/ArtifexSoftware/ghostpdl-downloads/releases
source=(https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver//./}/ghostpdl-${pkgver}.tar.xz
#https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/ghostpdl-${pkgver/.0//}/ghostpdl-${pkgver}.tar.xz
2010_add_build_timestamp_setting.patch)
sha512sums=('7eb3e6b8de83d0e31cc976151164326cdc110741eb2e9cddb59ab9590e15a6535659e50dea4feb643b9b3b6d90a26d01fe0326a400833e82b22f0091146151cc'
'cd7794ee4f28b11177021b950196385200b610127ed6cb94a45e3202b690b721a0dfcc0276ff39448d4dab64c1b31a76e6c323696a8315aad9edc22077f18a3d')
### update jbig2dec first! ###
prepare() {
cd ghostpdl-${pkgver}
# *** remove after final decision ***
# new in 9.54.0:
# https://www.ghostscript.com/doc/9.54.0/News.htm
# 1) inclusion of the tesseract/leptonica sources for OCR capabilities
# at the moment we do not support linking with tesseract/leptonica shared libraries.
# As is normal with such included libraries, deleting those directories and (re)running
# configure (on Unix like systems) will automatically build without the OCR functionality.
# increases package size ghostpcl 2.7->4.9MB | ghostscript 18->23MB | ghostxps 2,7->4.9MB
# https://www.ghostscript.com/doc/9.54.0/VectorDevices.htm#UseOCR -
# this doesn't seem to be worth to keep enabled until linking with shared libs is supported
rm -r tesseract leptonica
# 2) new directory addition in the source tree: "extract/".
# It contains the implementation for the writing of docx format files used by the
# new "docxwrite" device. This is *not* a "thirdparty library".
# For distribution package maintainers, if you want your packaged Ghostscript to include
# the "docxwrite" device, do not delete this directory.
# ^ this one doesn't affect package size - so let's keep it
# force it to use system-libs
rm -r cups/libs expat ijs jbig2dec jpeg lcms2mt libpng openjpeg tiff zlib
# using tree freetype because of https://bugs.archlinux.org/task/56849
# lcms2mt is the new lcms2 fork aimed to replace lcms2 in a thread safe way
# http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=40dc5b409c6262b18b4bf5386b5482ead4c511e3
# libs link unwanted to libgpdl that isn't installed
rm -rf gpdl
# https://bugs.ghostscript.com/show_bug.cgi?id=704405
sed -i "s/gscms_transformm_color_const/gscms_transform_color_const/" base/gsicc_lcms2.c
# Debian: # allow the build timestamp to be externally set
patch -Np1 -i ../2010_add_build_timestamp_setting.patch
}
build() {
cd ghostpdl-${pkgver}
./configure --prefix=/usr \
--enable-dynamic \
--with-ijs \
--with-jbig2dec \
--with-x \
--with-drivers=ALL \
--with-fontpath=/usr/share/fonts/gsfonts \
--without-versioned-path \
--enable-fontconfig \
--enable-freetype \
--enable-openjpeg \
--with-system-libtiff \
--with-libpaper \
--disable-compile-inits #--help # needed for linking with system-zlib
make
}
package_ghostscript() {
optdepends=('texlive-core: needed for dvipdf'
'gtk3: needed for gsx')
cd ghostpdl-${pkgver}
make DESTDIR="${pkgdir}" install-gs install-so-gs
# replace statically linked gs binary with symlink to dynamically linked gsc
rm -v "${pkgdir}"/usr/bin/gs
ln -s gsc "${pkgdir}"/usr/bin/gs
# remove unwanted localized manpages
rm -rv "${pkgdir}"/usr/share/man/de
install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
}
package_ghostxps() {
pkgdesc="${pkgdesc/PostScript/XPS document}"
depends=("ghostscript=${pkgver}-${pkgrel}")
cd ghostpdl-${pkgver}
make DESTDIR="${pkgdir}" install-gxps install-so-gxps
rm -r "${pkgdir}"/usr/include
# fix file conflict - FS#70238
rm -r "${pkgdir}"/usr/lib/libgxps.so
install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
}
package_ghostpcl() {
pkgdesc="${pkgdesc/PostScript/PCL 6}"
depends=("ghostscript=${pkgver}-${pkgrel}")
cd ghostpdl-${pkgver}
make DESTDIR="${pkgdir}" install-gpcl6 install-so-gpcl6
rm -r "${pkgdir}"/usr/include
install -Dt "${pkgdir}"/usr/share/licenses/${pkgname} -m644 LICENSE
}