2013-08-06 10:33:41 +02:00
|
|
|
{ stdenv, fetchurl, mesa_glu, x11, libXmu, libXi }:
|
2010-02-05 23:00:51 +01:00
|
|
|
|
2014-02-24 05:46:04 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-01-26 19:04:02 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-12-18 15:31:59 +01:00
|
|
|
name = "glew-1.10.0";
|
2008-01-16 03:20:46 +01:00
|
|
|
|
2008-01-30 18:20:48 +01:00
|
|
|
src = fetchurl {
|
2012-01-26 19:04:02 +01:00
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
2013-12-18 15:31:59 +01:00
|
|
|
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
|
2008-01-16 03:20:46 +01:00
|
|
|
};
|
|
|
|
|
2014-02-24 05:46:04 +01:00
|
|
|
nativeBuildInputs = [ x11 libXmu libXi ];
|
|
|
|
propagatedNativeBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h
|
2008-01-16 03:20:46 +01:00
|
|
|
|
2013-06-09 02:33:34 +02:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2014-03-10 22:22:21 +01:00
|
|
|
${optionalString (stdenv ? cross) ''
|
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
|
|
|
''}
|
2013-06-09 02:33:34 +02:00
|
|
|
'';
|
|
|
|
|
2014-02-24 05:46:04 +01:00
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
export GLEW_DEST="$out"
|
2013-06-09 02:33:34 +02:00
|
|
|
'';
|
|
|
|
|
2014-02-24 05:46:04 +01:00
|
|
|
postInstall = ''
|
2013-05-18 09:31:02 +02: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 05:46:04 +01:00
|
|
|
crossAttrs.makeFlags = [
|
|
|
|
"CC=${stdenv.cross.config}-gcc"
|
|
|
|
"LD=${stdenv.cross.config}-gcc"
|
2014-03-10 22:22:21 +01:00
|
|
|
"AR=${stdenv.cross.config}-ar"
|
2014-02-24 05:46:04 +01:00
|
|
|
"STRIP="
|
2014-03-12 10:16:51 +01:00
|
|
|
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw"
|
|
|
|
++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin";
|
2014-02-24 05:46:04 +01:00
|
|
|
|
2013-05-18 09:31:02 +02:00
|
|
|
meta = {
|
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2010-02-05 23:00:51 +01:00
|
|
|
homepage = http://glew.sourceforge.net/;
|
|
|
|
license = ["BSD" "GLX" "SGI-B" "GPL2"]; # License description copied from gentoo-1.4.0
|
2008-01-16 03:20:46 +01:00
|
|
|
};
|
|
|
|
}
|