aboutsummaryrefslogtreecommitdiffstats
path: root/community/poppler-qt5/APKBUILD
blob: 75f405f115a04d9872095a44f063ea5964afeb7c (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

# this aport only includes glib/gtk support in order to break the
# circular make dependency: gtk <- cups <- poppler <- gtk

pkgname=poppler-qt5
_pkgname=poppler
pkgver=0.71.0
pkgrel=0
pkgdesc="PDF rendering library based on xpdf 3.0"
url="https://poppler.freedesktop.org/"
arch="all"
license="GPL-2.0-only"
subpackages="$pkgname-dev"
makedepends="cmake libjpeg-turbo-dev jpeg-dev cairo-dev libxml2-dev
	fontconfig-dev qt5-qtbase-dev poppler-dev>=$pkgver lcms2-dev
	openjpeg-dev openjpeg-dev libpng-dev tiff-dev zlib-dev
	openjpeg-tools
	"
depends=
replaces="poppler-glib"
depends_dev="$makedepends"
provides="poppler-qt4-$pkgver-$pkgrel"
options="!check" # no test suite
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz"
builddir="$srcdir/$_pkgname-$pkgver/build"

prepare() {
	local _linked_pkg=poppler
	local _linked_apkbuild="$startdir"/../$_linked_pkg/APKBUILD
	mkdir -p "$builddir"
	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

	# JPEG2000Stream.cc:20:10: fatal error: openjpeg.h: No such file
	sed -e "/^#include/s/openjpeg\.h/openjpeg-2.3\/openjpeg.h/" -i ../poppler/JPEG2000Stream.cc
}

build() {
	cd "$builddir"
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_GLIB=ON \
		-DENABLE_XPDF_HEADERS=ON \
		-DENABLE_QT5=ON
	make
}

package() {
	cd "$builddir"
	install -D -m644 poppler-qt5.pc "$pkgdir"/usr/lib/pkgconfig/poppler-qt5.pc
	cd qt5
	make DESTDIR="$pkgdir" install
}

sha512sums="8e0ce95e7b58c37761c36a20f1282e63373a9557bf9f746ce2936562f12648506043d9559cf816944aa238814fc1b3f3a3c0a6cb002fd214b067e399bcc6ab1e  poppler-0.71.0.tar.xz"