# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-savage
pkgver=2.4.1
pkgrel=0
pkgdesc="S3 Savage video driver"
url="https://xorg.freedesktop.org"
arch="all"
license="MIT"
subpackages="$pkgname-doc"
makedepends="
	libdrm-dev
	libxi-dev
	libxrandr-dev
	mesa-dev
	util-macros
	xorg-server-dev
	xorgproto
	"
source="https://www.x.org/releases/individual/driver/$pkgname-$pkgver.tar.xz"

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

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

sha512sums="
7928dafa148340e4a6c0ecd2324a69a67aa8fec55d316468c7e68fd79d1a388fd0e1f593d39b6dab0c8a5876b23e7c65c037a3285d340fa82b27ec7c2d5c8713  xf86-video-savage-2.4.1.tar.xz
"
