aboutsummaryrefslogtreecommitdiffstats
path: root/main/ghostscript/APKBUILD
blob: 8891e55c4039b535cb675768ec2829ad1cfb7146 (plain)
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
# Contributor: Cameron Banta <cbanta@gmail.com>
# Maintainer: Cameron Banta <cbanta@gmail.com>
pkgname=ghostscript
pkgver=8.71
pkgrel=4
pkgdesc="An interpreter for the PostScript language and for PDF"
url="http://ghostscript.com/"
license="GPL"
makedepends="autoconf automake jpeg-dev libpng-dev jasper-dev expat-dev zlib-dev tiff-dev libiconv-dev"
subpackages="$pkgname-doc $pkgname-dev"
source="http://ghostscript.com/releases/$pkgname-$pkgver.tar.gz
	libpng14.patch
	ghostscript-system-jasper.patch"

prepare() {
	cd "$srcdir/$pkgname-$pkgver"

	# force it to use system-libs
	rm -rf jpeg libpng jasper expat tiff

	patch -Np1 -i "${srcdir}"/libpng14.patch || return 1

	# fix build with systems jasper
	patch -Np1 -i "${srcdir}"/ghostscript-system-jasper.patch || return 1

	# fix parallel builds
	sed -i -e 's/ECHO_XE/ECHOGS_XE/g' \
		-e 's/^\($(GLOBJ)md5.$(OBJ) :.*\)/\1 $(ECHOGS_XE)/' \
		base/lib.mak || return 1
	
	./autogen.sh \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--docdir=/usr/share/doc/"$pkgname" \
		--enable-dynamic \
		--with-system-libtiff \
		--without-ijs --without-x \
		--with-jbig2dec \
		--without-omni \
		--with-drivers=FILES \
		--with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \
		--disable-cups --disable-gtk --disable-cairo \
		--disable-compile-inits # needed for linking with system-zlib
}

build(){
	cd "$srcdir/$pkgname-$pkgver"
	make so all || return 1 
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make -j1 DESTDIR="${pkgdir}" install soinstall || return 1

	#create empty dir for future fonts
	mkdir -p "${pkgdir}"/usr/share/fonts/Type1

	# license and copying
	install -m644 -D "$srcdir/$pkgname-$pkgver/LICENSE" \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -m644 -D "$srcdir/$pkgname-$pkgver/doc/COPYING" \
		"$pkgdir/usr/share/licenses/$pkgname/COPYING"

	# make the doc and examples more alpine like 
	#	(the --docdir above doesn't seem to work so good)
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	mv "$pkgdir/usr/share/$pkgname/$pkgver/doc" "$pkgdir/usr/share/doc/$pkgname"
	mv "$pkgdir/usr/share/$pkgname/$pkgver/examples" "$pkgdir/usr/share/doc/$pkgname"
}

md5sums="51a522a5b4818bd3dc7c1c0e9dd22bad  ghostscript-8.71.tar.gz
be94ee357986f7f63d1b470da5bdc99e  libpng14.patch
03e27cd02471ab3b642c344fa06b623e  ghostscript-system-jasper.patch"