2018-07-17 21:11:16 +01:00
|
|
|
{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
|
2017-06-28 16:48:13 +01:00
|
|
|
, AGL ? null
|
|
|
|
}:
|
2015-06-11 23:58:00 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "glew-1.10.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
|
|
|
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
|
|
|
|
};
|
|
|
|
|
2018-07-17 21:11:16 +01:00
|
|
|
buildInputs = [ xlibsWrapper libXmu libXi ]
|
|
|
|
++ optionals stdenv.isDarwin [ AGL ];
|
2018-02-24 12:59:47 +00:00
|
|
|
propagatedBuildInputs = [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2015-06-11 23:58:00 +01:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2018-08-20 19:43:41 +01:00
|
|
|
${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2015-06-11 23:58:00 +01:00
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
export GLEW_DEST="$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2017-06-23 22:45:27 +01:00
|
|
|
makeFlags = [
|
2018-08-20 19:43:41 +01:00
|
|
|
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
|
2017-06-28 16:48:13 +01:00
|
|
|
];
|
2015-06-11 23:58:00 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
|
|
|
homepage = http://glew.sourceforge.net/;
|
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
|
|
|
}
|