pkgname=glamor-hybris
pkgver=1.0_git20181217
pkgrel=0
_commit="347463bcd688b75067d0dda2a920fb74fc976f51"
pkgdesc="glamor Xserver 2D acceleration modified to work with libhybris drivers"
url="https://github.com/NotKit/glamor-hybris"
arch="armhf armv7 aarch64"
license="MIT"
subpackages="$pkgname-doc $pkgname-dev"
depends=
makedepends="autoconf automake util-macros libtool
	xorg-server-dev libxi-dev fontsproto randrproto
	videoproto renderproto drihybrisproto drihybris-dev libepoxy-dev
	libhybris-dev"

source="$pkgname-$_commit.tar.gz::https://github.com/NotKit/glamor-hybris/archive/$_commit.tar.gz"

builddir="$srcdir"/$pkgname-$_commit

build() {
	cd "$builddir"
	export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
	export CPPFLAGS="$CPPFLAGS -I/usr/include/android-7.1"

	./autogen.sh \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-glamor-gles2
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	mv "$pkgdir/usr/include/xorg/glamor.h" "$pkgdir/usr/include/xorg/glamor-hybris.h"
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
sha512sums="57fa7462a8967cdb282868800ca69e6ee2e2187a421853c093a4e06f8242c15b5953b86921df6e1b668a254a251b38ba80d4194ab5230fa0940f4b97545c0176  glamor-hybris-347463bcd688b75067d0dda2a920fb74fc976f51.tar.gz"
