# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=sioyek
pkgver=2.0.0
pkgrel=26
pkgdesc="PDF viewer designed for reading research papers and technical books"
url="https://sioyek.info"
arch="all !aarch64 !armhf !armv7"  # fails to build
license="GPL-3.0-only"
makedepends="
	cmd:desktop-file-install
	mupdf-dev
	qt5-qt3d-dev
	qt5-qtbase-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/ahrm/sioyek/archive/v$pkgver/sioyek-$pkgver.tar.gz
	fix-mupdf-libs.patch
	mupdf-0.23.0.patch
	$pkgname.desktop
	"
options="!check"  # no tests provided

build() {
	qmake-qt5 pdf_viewer_build_config.pro DEFINES+="LINUX_STANDARD_PATHS"
	make
}

package() {
	install -D -m755 sioyek -t "$pkgdir"/usr/bin/
	install -D -m644 pdf_viewer/shaders/* -t "$pkgdir"/usr/share/$pkgname/shaders/
	install -D -m644 pdf_viewer/keys.config pdf_viewer/prefs.config -t "$pkgdir"/etc/$pkgname/
	install -D -m644 resources/sioyek.1 -t "$pkgdir"/usr/share/man/man1/

	desktop-file-install --dir="$pkgdir/usr/share/applications" "$srcdir"/sioyek.desktop
	install -D -m644 resources/sioyek-icon-linux.png \
		"$pkgdir"/usr/share/icons/hicolor/256x256/apps/$pkgname.png
}

sha512sums="
3ed9959ddbc133b9c7bb241f8076da886b74790a475646911dc6d38724160ae8335020db308e405c60fce49b9260536861e8946199f1670dc8c2331e9fbd2e00  sioyek-2.0.0.tar.gz
d2b802b75804a0986a2ad39b7609e503655780d96eec18e0f2dd378797f273d055d75265ad949f471b8befa287279be79e8b6215eb2ff63b168b574ca66d0e9c  fix-mupdf-libs.patch
9c8bdeca3e572df5c7587225148f816dcea7e7842340a8884c466a5504f0afb38cb86390538f64913d8f6f20208084dbe081abf91597f730f6ab3773108d4350  mupdf-0.23.0.patch
f2f227ae181d695da979c84444f2f53402d904b9c2ddab3bb589483ad98168365c15c2052eb2192defa2131a8c27eada2936e82e1b8c3f37b86abd4159994d15  sioyek.desktop
"
