2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
|
2020-12-17 22:53:35 +01:00
|
|
|
, AGL, OpenGL
|
2017-06-28 17:48:13 +02:00
|
|
|
}:
|
2015-06-12 00:58:00 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
with lib;
|
2015-06-12 00:58:00 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "glew-1.10.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
|
|
|
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
|
|
|
|
};
|
|
|
|
|
2020-12-17 22:53:35 +01:00
|
|
|
buildInputs = if stdenv.isDarwin then [ AGL ] else [ xlibsWrapper libXmu libXi ];
|
|
|
|
propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2015-06-12 00:58:00 +02:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2018-08-20 20:43:41 +02:00
|
|
|
${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2015-06-12 00:58:00 +02: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 23:45:27 +02:00
|
|
|
makeFlags = [
|
2018-08-20 20:43:41 +02:00
|
|
|
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
|
2017-06-28 17:48:13 +02:00
|
|
|
];
|
2015-06-12 00:58:00 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2015-06-12 00:58:00 +02:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://glew.sourceforge.net/";
|
2015-06-12 00:58:00 +02:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
|
|
|
}
|