# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=virtualgl
_pkgname=VirtualGL
pkgver=2.5.1
pkgrel=2
pkgdesc="VirtualGL is a toolkit to run remote OpenGL applications with full 3D hardware acceleration."
url="http://www.virtualgl.org"
arch="x86_64 ppc64le"
license="LGPL"
depends=""
depends_dev=""
makedepends="mesa-dev cmake libressl-dev libjpeg-turbo-dev libx11-dev glu-dev libxv-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="http://downloads.sourceforge.net/project/${pkgname}/${pkgver}/${_pkgname}-${pkgver}.tar.gz"

builddir=${srcdir}/${_pkgname}-${pkgver}
build() {
	cd "$builddir"
	mkdir -p build && cd build

	cmake .. \
	-DCMAKE_INSTALL_PREFIX=/usr/share \
	-DTJPEG_INCLUDE_DIR=/usr/include \
	-DTJPEG_LIBRARY=/usr/lib/libturbojpeg.so \
        -DOPENGL_glu_LIBRARY=/usr/lib/libGLU.so \
        -DVGL_USESSL=1 \
	-DVGL_LIBDIR=/usr/lib \
	-DVGL_BINDIR=/usr/bin \
	-DVGL_DOCDIR=/usr/share/doc/${pkgname} \
	-DVGL_FAKEXCB=1 || return 1
	make
}

package() {
	cd "$builddir/build"
        make  DESTDIR="$pkgdir" install || return 1
        cd "$builddir" && rm -r build
}

md5sums="7c6bac673fab01c572de618d7e8f61a5  VirtualGL-2.5.1.tar.gz"
sha256sums="da342e0157257cd7b7c9c6705c7f2b9853f28f6bb6c51c90c710cc14257f3659  VirtualGL-2.5.1.tar.gz"
sha512sums="a60a55bae58c80bcea418702f4d3b41356a9e599f007fd539043228c4fe75c28582bab376caf121a5eeee4a21cddb80f1edc2f89abfe88a584321c46383d3654  VirtualGL-2.5.1.tar.gz"
