aboutsummaryrefslogtreecommitdiffstats
path: root/community/okular/APKBUILD
blob: 7f561512bfc54cf2c1b25b487beae0a3ac0afda3 (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
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=okular
pkgver=20.12.1
pkgrel=0
arch="all !armhf !s390x !mips64" # 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"
depends="$pkgname-common"
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-common $pkgname-mobile"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DOKULAR_UI=both
	cmake --build build
}

check() {
	cd build

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

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

common() {
	pkgdesc="Common files for okular and okular-mobile"
	mkdir -p \
		"$subpkgdir"/usr/lib/qt5 \
		"$subpkgdir"/usr/share
	mv "$pkgdir"/usr/lib/qt5/plugins "$subpkgdir"/usr/lib/qt5/
	find "$pkgdir"/usr -name "libOkular5Core.so.*" -exec mv {} "$subpkgdir"/usr/lib/ +
	mv "$pkgdir"/usr/share/okular "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/config.kcfg "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/qlogging-categories5 "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/icons "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/metainfo "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/kconf_update "$subpkgdir"/usr/share/
}

mobile() {
	depends="$pkgname-common 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* "$subpkgdir"/usr/share/applications/
}

sha512sums="6266d34b69123ed09ca0de9ce250ea7d98a576efdd6f4fc79ecf1bc0d360c8d6a2fde2700cfc9101e34ab1039ce05225d33ca5f173b5a9845ec7fb00499d658f  okular-20.12.1.tar.xz"