aboutsummaryrefslogtreecommitdiffstats
path: root/community/poppler-qt5/APKBUILD
blob: f8b5801b2129a8f5df9c729f18402b2a27e416c4 (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
# 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=21.11.0
pkgrel=0
pkgdesc="PDF rendering library based on xpdf 3.0"
url="https://poppler.freedesktop.org/"
arch="all"
license="GPL-2.0-only"
replaces="poppler-glib"
provides="poppler-qt4-$pkgver-$pkgrel"
options="!check" # Requires dl of testfiles and only checks qt5 libs
makedepends="cairo-dev cmake fontconfig-dev jpeg-dev lcms2-dev libjpeg-turbo-dev
	libpng-dev libxml2-dev openjpeg-dev openjpeg-tools poppler-dev>=$pkgver
	qt5-qtbase-dev tiff-dev zlib-dev
	"
depends_dev="$makedepends"
subpackages="$pkgname-dev"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz
	dont-enforce-build-type.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	local _linked_pkg=poppler
	local _linked_apkbuild="$startdir"/../../main/$_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_GTK_TESTS=OFF \
		-DBUILD_QT5_TESTS=ON \
		-DBUILD_CPP_TESTS=OFF \
		-DENABLE_QT5=ON \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DENABLE_BOOST=OFF \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	install -Dm644 build/poppler-qt5.pc "$pkgdir"/usr/lib/pkgconfig/poppler-qt5.pc
	make -C build/qt5 DESTDIR="$pkgdir" install
}

sha512sums="
354d6372093e7ecedf95c43e8d203e9b2781ff7ecd81cd3920cb8c72a37463b47423ce7ab3c8233c0f031f2c024ac1ba5c8d442c80e6643722192fb9638e5d3a  poppler-21.11.0.tar.xz
b4141912e73e9a0baaf7b69d0901db24b4aba854c6aff8e01389ac760e4d23606ff29c37626747f24184f1bfc97e25d53a0f99b24eef7661ac9805ea3311802a  dont-enforce-build-type.patch
"