# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=flatpak
pkgver=0.10.1
pkgrel=0
pkgdesc="Application deployment framework for desktop apps"
url="http://flatpak.org"
arch="all !aarch64"
license="LGPL-2.1"
depends="bubblewrap"
makedepends="glib-dev libarchive-dev libsoup-dev libcap-dev polkit-dev
             libxau-dev ostree-dev fuse-dev json-glib-dev
             libgcab-dev appstream-glib-dev
             libseccomp-dev libxslt-dev gpgme-dev bubblewrap"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://github.com/flatpak/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz
		musl-fixes.patch"
options="suid"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/bin \
		--libexecdir=/usr/lib/$pkgname \
		--disable-static \
		--disable-documentation \
		--with-priv-mode=setuid \
		--with-system-bubblewrap

	make
}

check() {
	cd "$builddir"
	#make -k check
	./flatpak --version
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="0aae8a48e04df7398a290e36ecff5240a7fd9a9012cbcdd078797fef51d801a0aa5b0869894bc843213f182db0f5eb0c1ade55d15dcfa5f6c842281fca53afec  flatpak-0.10.1.tar.xz
9287ed146bf71665aa436a2c2110cc5edc829a7b4a3e3190947580850fe9ecfd2bb6adb015c692af022d425fb5259390fcdcbd402e8b0d12ee5d2c1a1071ed4f  musl-fixes.patch"
