aboutsummaryrefslogtreecommitdiffstats
path: root/main/poppler/APKBUILD
blob: 9a2c3bc308d85a7f2248963875b547c74f8c9644 (plain) (blame)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

# this aport does not include qt support in order to break the
# circular make dependency: qt <- cups <- poppler <- qt
# So we build qt support in separate package poppler-qt4
pkgname=poppler
pkgver=0.56.0
pkgrel=2
pkgdesc="PDF rendering library based on xpdf 3.0"
url="https://poppler.freedesktop.org/"
arch="all"
options="!check"  # No test suite.
license="GPL-2.0+"
depends=
depends_dev="cairo-dev glib-dev"
makedepends="$depends_dev libjpeg-turbo-dev cairo-dev libxml2-dev
	fontconfig-dev lcms2-dev gobject-introspection-dev
	openjpeg-dev libpng-dev tiff-dev zlib-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-glib
	"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz
	CVE-2019-9959.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   0.56.0-r2:
#     - CVE-2019-9959

prepare() {
	local _linked_pkg=poppler-qt4
	local _linked_apkbuild="$startdir"/../$_linked_pkg/APKBUILD
	cd "$builddir"
	if  [ -f "$_linked_apkbuild" ]; then
		local _linked_ver=$( . "$_linked_apkbuild"; echo "$pkgver")
		if [ "$_linked_ver" != "$pkgver" ]; then
			error "pkgver needs to be identical with $_linked_pkg ($_linked_ver)"
			return 1
		fi
	fi
	default_prepare
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--disable-static \
		--enable-cairo-output \
		--enable-xpdf-headers \
		--enable-libjpeg \
		--enable-zlib \
		--enable-poppler-glib \
		--disable-poppler-qt4
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="Poppler's xpdf-workalike command line utilities"
	install -d "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

glib() {
	pkgdesc="Glib wrapper for poppler"
	replaces="poppler-gtk"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpoppler-glib.so.* \
		"$pkgdir"/usr/lib/girepository* \
		"$subpkgdir"/usr/lib/
}

_cpp() {
	pkgdesc="Pure C++ wrapper for poppler"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpoppler-cpp.so.* \
		"$subpkgdir"/usr/lib/
}

sha512sums="74d2ca63afcb7e155c153b4ddc71621b7f4f2c60d4fcafd873176d5ac59fafedc35b200a22c7af2013d7f75e670a1cc23d6ba878167a02209917f8d30002d528  poppler-0.56.0.tar.xz
c647bf98ee1ec86270d942d256d9ae4264537f9bbfe2b2adc1f31c9cf27604682ba780943cbc6059451dc67228cf923fb1626e24da2635c7728fe1da2613a929  CVE-2019-9959.patch"