aboutsummaryrefslogtreecommitdiffstats
path: root/community/okular/APKBUILD
blob: 2f0d30055adda5a840e4b3596d1883c556e36a54 (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
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=okular
pkgver=19.12.2
pkgrel=1
arch="all !armhf" # armhf blocked by kirigami2 -> qt5-qtdeclarative
url="https://kde.org/applications/office/org.kde.okular"
pkgdesc="A universal document viewer"
license="GPL-2.0-or-later AND LGPL-2.0-or-later"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtspeech-dev karchive-dev
	kbookmarks-dev kcompletion-dev kconfig-dev kconfigwidgets-dev
	kcoreaddons-dev kcrash-dev kiconthemes-dev kio-dev kparts-dev
	threadweaver-dev kwindowsystem-dev kdoctools-dev kjs-dev kwallet-dev
	kactivities-dev phonon-dev purpose-dev zlib-dev poppler-qt5-dev
	kirigami2-dev qca-dev kpty-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/okular-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-mobile"

prepare() {
	default_prepare

	mkdir "$builddir"/build
}

build() {
	cd "$builddir"/build
	cmake "$builddir" \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_OKULARKIRIGAMI=ON \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS -D_GNU_SOURCE"
	make
}

check() {
	cd "$builddir"/build

	# All other tests are broken, require OpenGL, etc
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -R "^shelltest"
}

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

mobile() {
	depends="kirigami2"
	mkdir -p "$subpkgdir"/usr/bin
	mkdir -p "$subpkgdir"/usr/lib/qt5
	mkdir -p "$subpkgdir"/usr/share/applications

	mv "$pkgdir"/usr/bin/okularkirigami "$subpkgdir"/usr/bin/
	mv "$pkgdir"/usr/lib/qt5/qml "$subpkgdir"/usr/lib/qt5/
	mv "$pkgdir"/usr/share/applications/org.kde.okular.kirigami.desktop "$subpkgdir"/usr/share/applications/
	mv "$pkgdir"/usr/share/applications/org.kde.mobile.okular_plucker.desktop "$subpkgdir"/usr/share/applications/
}

sha512sums="acd9640c120d73a0b84054941a76d8eaa7434fc9a6d82e77edf5bd4827ab17334f4e4bedc521133d922afa7cd9ba9e08057534ac08281fd23f9bed7fff28f304  okular-19.12.2.tar.xz"