# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=wbar
pkgver=2.3.4
pkgrel=5
pkgdesc="Simple and customizable quick-launch desktop dock"
url="https://github.com/rodolf0/wbar"
arch="all"
license="GPL-3.0-only"
makedepends="intltool imlib2-dev gettext-dev"
subpackages="
	$pkgname-lang
	$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	"
source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wbar/wbar-$pkgver.tgz
	Functions.patch
	Main.patch"

prepare() {
	default_prepare
	sed -i '/-Werror/d' src/Makefile.*
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--exec_prefix=/usr \
		--sysconfdir=/etc \
		--disable-wbar-config
	make
}

package() {
	make DESTDIR=$pkgdir install

	mkdir -p "$pkgdir"/usr/share/bash-completion
	mv "$pkgdir"/etc/bash_completion.d "$pkgdir"/usr/share/bash-completion/completions
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	amove usr/share/bash-completion/completions
}

sha512sums="07f3484bd071761d57ef1172c56b30980eef9ce2ee65d1fc21ea20c631a1da1d88c1b8a9e1a1fca0e5f18e7bf1c5697c349a543d72966ce71ff53d7e921147b3  wbar-2.3.4.tgz
edc3f17ef9ee3d761c22c2dc4bb47118ecf2061b0e1fef74a96a9e69d5a1df446f157ab010f5a95b38a4bcd132dacb852fd91b4dfd96ceb659b1409a2149fa5e  Functions.patch
175cd141650cd735539af1cde81c89175aca70acbbac3138bce16b46f5ac7f91d36d415026cdd158a9cd75d73d349a5286e00fa1cf22df0ac601f523cc44ddf8  Main.patch"
