aboutsummaryrefslogtreecommitdiffstats
path: root/main/poppler/APKBUILD
blob: b9a58e08e857f4cd4fbc74b0ee636f6ed93d60f6 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=poppler
pkgver=21.01.0
pkgrel=0
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-or-later"
depends_dev="cairo-dev glib-dev"
makedepends="$depends_dev cmake fontconfig-dev
	gobject-introspection-dev lcms2-dev libjpeg-turbo-dev
	libpng-dev libxml2-dev openjpeg-dev openjpeg-tools
	tiff-dev zlib-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-glib $pkgname-utils"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz"

# secfixes:
#   0.80.0-r0:
#     - CVE-2019-9959

prepare() {
	default_prepare

	local _linked_pkg=poppler-qt5
	local _linked_apkbuild="$startdir"/../../community/$_linked_pkg/APKBUILD
	mkdir -p "$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
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
		-DBUILD_QT5_TESTS=OFF \
		-DENABLE_QT5=OFF \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	make -C build 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="aec130446df73a2fc66851a563a14cb40299212a2de4a0d03668b0fecb28312fffa70d0a82431c774d0c0e3f7293788bd2bdf28c8136aa09ad80edbca4cf0ddd  poppler-21.01.0.tar.xz"