# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=libpeas
pkgver=1.22.0
pkgrel=0
pkgdesc="GObject-based plugin system"
url="https://wiki.gnome.org/Projects/Libpeas"
arch="all"
license="LGPL"
makedepends="$depends_dev glib-dev gobject-introspection-dev intltool gtk+3.0-dev py-gobject3-dev python3-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-python3:py3"
source="https://download.gnome.org/sources/libpeas/1.22/libpeas-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-python2
	make
}

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

py3() {
	depends="py3-gobject3"
	mkdir -p "$subpkgdir"/usr/lib/libpeas-1.0/loaders
	mv "$pkgdir"/usr/lib/libpeas-1.0/loaders/libpython3loader.* "$subpkgdir"/usr/lib/libpeas-1.0/loaders/
}

sha512sums="9c1da1d4b5688c0f4d0647f3519dbfbed94c8921091057aaef0e41bf5ed3f8faf04a49ce9e4eea3fd7bf4ac4dfa1727d76a5f6dae2a4f52228d4c8c74b420c91  libpeas-1.22.0.tar.xz"
