# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer:
pkgname=jgmenu
pkgver=4.4.1
pkgrel=1
pkgdesc="Simple, independent X11 menu"
url="https://github.com/johanmalm/jgmenu"
arch="all"
license="GPL-2.0-only"
depends="
	bash
	desktop-file-utils
	python3
	"
makedepends="
	librsvg-dev
	libxrandr-dev
	libxml2-dev
	menu-cache-dev
	pango-dev
	xfce4-panel-dev
	"
checkdepends="perl xvfb-run"
subpackages="$pkgname-doc $pkgname-xfce4"
source="$pkgname-$pkgver.tar.gz::https://github.com/johanmalm/jgmenu/archive/v$pkgver.tar.gz
	libxfce4panel.patch"

build() {
	export CFLAGS="$CFLAGS -flto=auto"

	./configure \
		--prefix=/usr \
		--with-gtktheme \
		--with-lx \
		--with-pmenu \
		--with-xfce4-panel-applet
	make
}

check() {
	export XDG_RUNTIME_DIR="$builddir"
	xvfb-run -a make test
}

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

xfce4() {
	pkgdesc="$pkgdesc (xfce4 panel integration)"

	amove usr/lib/xfce4 usr/share/xfce4
}

sha512sums="
e09ff357e99e58ba63f0a9e8c9c8d1164bcc588bfda565139a8d9b35bb76683e284952feb12680830bec8188957c5b7aec6c89817962fb368381b80046d43ae0  jgmenu-4.4.1.tar.gz
4f6a8aa42e4b2c36b5e7379170fbab9bb33d38a38d6564be92a0eec6c038dfe7ae75ddc70d4826eb5dbe5228201cc4b99bda5dbfc58d713740dac5db31e70dc2  libxfce4panel.patch
"
