# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-openchrome
pkgver=0.6.0
pkgrel=2
pkgdesc="X.Org driver for VIA/S3G cards"
url="http://xorg.freedesktop.org/"
arch="all"
license="MIT"
subpackages="$pkgname-doc"
depends=
makedepends="xorg-server-dev libxi-dev libxvmc-dev fontsproto glproto
	randrproto videoproto renderproto xf86driproto mesa-dev
	util-macros"

source="http://www.x.org/releases/individual/driver/xf86-video-openchrome-$pkgver.tar.bz2
	openchrome.xinf
	"

builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$builddir"
	update_config_sub
	default_prepare
}

build() {
	cd "$builddir"
	export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	install -Dm644 "$srcdir"/openchrome.xinf \
		"$pkgdir"/usr/share/hwdata/videoaliases/openchrome.xinf
}

sha512sums="f074e70d54c87a9d6e1b52c2c2d72d7c551dcb59a5f34c0a5f9495db1a6e45db4300d51fabf7eedfbe91f964f9422931c752a49b322715c6aa9ddb0db9dd6004  xf86-video-openchrome-0.6.0.tar.bz2
b900999fc678f0efdcb526d2f0e0f141ed8ca9403bd2b9895c96be2f5efc424feb50f1828c54cdaf0d7d9b9e723e834068ce36841fac97a2e5209873e8e711c3  openchrome.xinf"
