aboutsummaryrefslogtreecommitdiffstats
path: root/community/poppler-qt5/APKBUILD
blob: b70c2198c9f4045759465b3cdb9db1c3652fede2 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 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=23.02.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-r$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
	poppler-dev>=$pkgver
	qt5-qtbase-dev
	qt6-qtbase-dev
	samurai
	tiff-dev
	zlib-dev
	"
depends_dev="$makedepends"
subpackages="poppler-qt6:_qt6 $pkgname-dev"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz"
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 -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
		-DBUILD_QT5_TESTS="$(want_check && echo ON || echo OFF)" \
		-DBUILD_QT6_TESTS="$(want_check && echo ON || echo OFF)" \
		-DBUILD_GTK_TESTS="$(want_check && echo ON || echo OFF)" \
		-DBUILD_CPP_TESTS="$(want_check && echo ON || echo OFF)" \
		-DBUILD_MANUAL_TESTS="$(want_check && echo ON || echo OFF)" \
		-DENABLE_QT5=ON \
		-DENABLE_QT6=ON \
		-DENABLE_NSS3=OFF \
		-DENABLE_BOOST=OFF \
		$CMAKE_CROSSOPTS
	cmake --build build
}

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

_qt6() {
	pkgdesc="$pkgdesc (qt6 component)"
	amove usr/lib/libpoppler-qt6.so.*
}

sha512sums="
0765319a1b106da740c7300172866e774ccbeec0bc0e938f009efd1a106b35ca2e5ab60a523e1d1dd5682b30499de4dffed0a1ca129c770263a096f781337a2c  poppler-23.02.0.tar.xz
"