app=freeglut
version=3.0.0
build=1sml
homepage="http://freeglut.sourceforge.net/"
download="http://prdownloads.sourceforge.net/freeglut/freeglut-$version.tar.gz"
desc="Provides functionality for small OpenGL programs"
requires="glu"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  mkdir -p smbuild && cd smbuild
  cmake .. \
    -DCMAKE_C_COMPILER="$CC" \
    -DCMAKE_INSTALL_PREFIX="" \
    -DFREEGLUT_BUILD_DEMOS=ON \
    -DCMAKE_INSTALL_LIBDIR=/lib \
    -DFREEGLUT_BUILD_SHARED_LIBS=ON \
    -DFREEGLUT_BUILD_STATIC_LIBS=OFF 

  make
  make install DESTDIR=$pkg

  cp ../COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
3b999a7c4cf4050c684c4b62b0b39f040903abb56661255080f9598d3e4b3181aaa5b82eec85bbaa0b78633bb224d825614b0b9ae67f9bea3b4cd966fa83824e  freeglut-3.0.0.tar.xz
"
