# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-nv
pkgver=2.1.22
pkgrel=3
pkgdesc="Nvidia video driver"
url="https://xorg.freedesktop.org"
arch="all"
license="MIT"
subpackages="$pkgname-doc"
makedepends="xorg-server-dev libxi-dev util-macros xorgproto"
source="https://www.x.org/releases/individual/driver/xf86-video-nv-$pkgver.tar.xz
	fix-old-cpp-macros.patch
	"

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="
a54767e9060404cafbb028ea36e582e8cfb7431a746cfc1d698c435fa73e41c4dfc12f84e50d002a582ac61e2d4c377f4defdf407250ee9e8656e5ff989b3cda  xf86-video-nv-2.1.22.tar.xz
9d706c5535ddc22976d4e33f2e0ead79bf18356f71b6118f5beea0a48a6cd211a94e75b69bf1f8d91b33023fb877e4111ef8ae47e6a0a0a6f3bae8d9ba87d001  fix-old-cpp-macros.patch
"
