APKBUILD 2.05 KB
Newer Older
Bart Ribbers's avatar
Bart Ribbers committed
1 2 3
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=okular
4
pkgver=19.12.0
5
pkgrel=0
6
arch="all !armhf" # armhf blocked by kirigami2 -> qt5-qtdeclarative
Bart Ribbers's avatar
Bart Ribbers committed
7 8 9 10 11 12 13 14 15 16
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"
17
source="https://download.kde.org/stable/release-service/$pkgver/src/okular-$pkgver.tar.xz"
18
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-mobile"
Bart Ribbers's avatar
Bart Ribbers committed
19

20 21 22 23 24 25
prepare() {
	default_prepare

	mkdir "$builddir"/build
}

Bart Ribbers's avatar
Bart Ribbers committed
26
build() {
27 28
	cd "$builddir"/build
	cmake "$builddir" \
Bart Ribbers's avatar
Bart Ribbers committed
29 30 31
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
32 33 34
		-DBUILD_OKULARKIRIGAMI=ON \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS -D_GNU_SOURCE"
Bart Ribbers's avatar
Bart Ribbers committed
35 36 37 38
	make
}

check() {
39 40
	cd "$builddir"/build

Bart Ribbers's avatar
Bart Ribbers committed
41 42 43 44 45
	# All other tests are broken, require OpenGL, etc
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -R "^shelltest"
}

package() {
46
	cd "$builddir"/build
Bart Ribbers's avatar
Bart Ribbers committed
47 48 49 50 51 52
	DESTDIR="$pkgdir" make install
}

mobile() {
	depends="kirigami2"
	mkdir -p "$subpkgdir"/usr/bin
53
	mkdir -p "$subpkgdir"/usr/lib/qt5
Bart Ribbers's avatar
Bart Ribbers committed
54 55 56
	mkdir -p "$subpkgdir"/usr/share/applications

	mv "$pkgdir"/usr/bin/okularkirigami "$subpkgdir"/usr/bin/
57
	mv "$pkgdir"/usr/lib/qt5/qml "$subpkgdir"/usr/lib/qt5/
Bart Ribbers's avatar
Bart Ribbers committed
58
	mv "$pkgdir"/usr/share/applications/org.kde.okular.kirigami.desktop "$subpkgdir"/usr/share/applications/
59
	mv "$pkgdir"/usr/share/applications/org.kde.mobile.okular_plucker.desktop "$subpkgdir"/usr/share/applications/
Bart Ribbers's avatar
Bart Ribbers committed
60 61
}

62
sha512sums="93fb134f18b00ce84e9b2ce84974562a5d22f956b459e540750d0c67a980f66383ec13fa8f3bb52f196ce7fabe468de4fe63b0fa6678df840d2defb0e22fc30b  okular-19.12.0.tar.xz"