# Contributor: Carlo Landmeter
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=glew
pkgver=2.1.0
pkgrel=2
pkgdesc="Cross-platform C/C++ extension loading library"
url="http://glew.sourceforge.net"
arch="all"
options="!check"  # No test suite.
license="BSD-3-Clause AND MIT"
depends=""
depends_dev="libxi-dev libxmu-dev mesa-dev"
makedepends="$depends_dev glu-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tgz
	mesa-compat.patch
	"

prepare() {
	default_prepare
	sed -i 's|lib64|lib|' config/Makefile.linux
}

build() {
	make CFLAGS.EXTRA="$CFLAGS -fPIC"
}

package() {
	make GLEW_DEST="${pkgdir}/usr" install
	install -D -m644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="9a9b4d81482ccaac4b476c34ed537585ae754a82ebb51c3efa16d953c25cc3931be46ed2e49e79c730cd8afc6a1b78c97d52cd714044a339c3bc29734cd4d2ab  glew-2.1.0.tgz
6598a3d8263b8e49ca45cea00fed6b6921b6e75ff120d7f4f86b6e181dd9c8d56d52d1664a1693cf807dda130cfebd1a9a0bf8b2edc02552c1831486378adf1a  mesa-compat.patch"