# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=awesome
pkgver=4.2
pkgrel=0
pkgdesc="lua-configurable window manager framework"
url="http://awesome.naquadah.org/"
arch="all"
license="GPL2+"
depends="imagemagick lua5.1-lgi cairo-gobject pango"
makedepends="lua lua5.1 lua5.1-dev libxcb-dev pango-dev cairo-dev cmake gperf glib-dev
	imlib2-dev libxdg-basedir-dev libev-dev startup-notification-dev
	xcb-util-keysyms-dev xcb-util-image-dev xcb-util-dev xcb-util-wm-dev
	dbus-dev lua-doc gdk-pixbuf-dev xcb-util-cursor-dev libxkbcommon-dev
	xcb-util-xrm-dev"
install=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.xz::https://github.com/awesomeWM/$pkgname-releases/raw/master/$pkgname-$pkgver.tar.xz"

_srcdir="${srcdir}/${pkgname}-${pkgver}"
_builddir="${srcdir}/build"
prepare() {
	local i
	cd "$_srcdir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	mkdir "$_builddir"
	cd "$_builddir"
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
		-DSYSCONFDIR=/etc \
		-DCMAKE_BUILD_TYPE=Release \
		"$_srcdir"
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

sha512sums="134dd3625c86243861b3d0701cc8bfd8c00986d7027f0832016c3f5e59e6b9a1ef2f677bb0d1d66ece63449533e4b13d8d7388e96e6f9014212030a79f163e09  awesome-4.2.tar.xz"