# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-nv
pkgver=2.1.23
pkgrel=0
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
	gcc14-revert-fix-nv-powerpc.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="
ce09f37bd29bbe588a8788d643240c9b0324654ea37b8e7f0f127494999f24b3048ca0c7ea91b33ef94efd12b570bfb73c8a5e20bf63749b01cbdc5669136b9e  xf86-video-nv-2.1.23.tar.xz
3c127965791203a2e1d18eb3acff5516d93e3e3ffaa146f0fcb476d4e4cd9a1b10ad0438821bdbf1bbfc5e60a72ea6c304e0d39f12bef0a312822d7d219ecd6b  gcc14-revert-fix-nv-powerpc.patch
"
