2013-08-06 12:33:41 +04:00
|
|
|
{ stdenv, fetchurl, mesa_glu, x11, libXmu, libXi }:
|
2010-02-06 01:00:51 +03:00
|
|
|
|
2014-02-24 08:46:04 +04:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-01-26 22:04:02 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2014-08-21 23:15:32 +04:00
|
|
|
name = "glew-1.11.0";
|
2008-01-16 05:20:46 +03:00
|
|
|
|
2008-01-30 20:20:48 +03:00
|
|
|
src = fetchurl {
|
2012-01-26 22:04:02 +04:00
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
2014-08-21 23:15:32 +04:00
|
|
|
sha256 = "1mhkllxz49l1x680dmzrv2i82qjrq017sykah3xc90f2d8qcxfv9";
|
2008-01-16 05:20:46 +03:00
|
|
|
};
|
|
|
|
|
2014-02-24 08:46:04 +04:00
|
|
|
nativeBuildInputs = [ x11 libXmu libXi ];
|
|
|
|
propagatedNativeBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h
|
2008-01-16 05:20:46 +03:00
|
|
|
|
2013-06-09 04:33:34 +04:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2014-03-11 01:22:21 +04:00
|
|
|
${optionalString (stdenv ? cross) ''
|
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
|
|
|
''}
|
2013-06-09 04:33:34 +04:00
|
|
|
'';
|
|
|
|
|
2014-02-24 08:46:04 +04:00
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
export GLEW_DEST="$out"
|
2013-06-09 04:33:34 +04:00
|
|
|
'';
|
|
|
|
|
2014-02-24 08:46:04 +04:00
|
|
|
postInstall = ''
|
2013-05-18 11:31:02 +04:00
|
|
|
mkdir -pv $out/share/doc/glew
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
cp glew*.pc $out/lib/pkgconfig
|
|
|
|
cp -r README.txt LICENSE.txt doc $out/share/doc/glew
|
|
|
|
'';
|
|
|
|
|
2014-02-24 08:46:04 +04:00
|
|
|
crossAttrs.makeFlags = [
|
|
|
|
"CC=${stdenv.cross.config}-gcc"
|
|
|
|
"LD=${stdenv.cross.config}-gcc"
|
2014-03-11 01:22:21 +04:00
|
|
|
"AR=${stdenv.cross.config}-ar"
|
2014-02-24 08:46:04 +04:00
|
|
|
"STRIP="
|
2014-03-12 13:16:51 +04:00
|
|
|
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw"
|
|
|
|
++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin";
|
2014-02-24 08:46:04 +04:00
|
|
|
|
2014-08-21 23:15:32 +04:00
|
|
|
meta = with stdenv.lib; {
|
2013-05-18 11:31:02 +04:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2010-02-06 01:00:51 +03:00
|
|
|
homepage = http://glew.sourceforge.net/;
|
2014-08-21 23:15:32 +04:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2008-01-16 05:20:46 +03:00
|
|
|
};
|
|
|
|
}
|