2017-06-28 17:48:13 +02:00
|
|
|
{ stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi
|
|
|
|
, buildPlatform, hostPlatform
|
|
|
|
}:
|
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 {
|
2016-11-25 23:37:15 +01:00
|
|
|
name = "glew-2.0.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";
|
2016-11-25 23:37:15 +01:00
|
|
|
sha256 = "0r37fg2s1f0jrvwh6c8cz5x6v4wqmhq42qm15cs9qs349q5c6wn5";
|
2008-01-16 03:20:46 +01:00
|
|
|
};
|
|
|
|
|
2016-09-01 17:23:31 +02:00
|
|
|
outputs = [ "bin" "out" "dev" "doc" ];
|
|
|
|
|
2017-08-14 22:39:03 +02:00
|
|
|
buildInputs = [ xlibsWrapper libXmu libXi ];
|
|
|
|
propagatedBuildInputs = [ 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
|
2017-06-28 22:12:05 +02:00
|
|
|
${optionalString (hostPlatform != buildPlatform) ''
|
2014-03-10 22:22:21 +01:00
|
|
|
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 = ''
|
2016-09-01 17:23:31 +02:00
|
|
|
makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
|
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
|
2016-11-25 23:37:15 +01:00
|
|
|
cp -r README.md LICENSE.txt doc $out/share/doc/glew
|
2016-09-01 17:23:31 +02:00
|
|
|
rm $out/lib/*.a
|
2013-05-18 09:31:02 +02:00
|
|
|
'';
|
|
|
|
|
2017-06-23 23:45:27 +02:00
|
|
|
makeFlags = [
|
|
|
|
"SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}"
|
2017-06-28 17:48:13 +02:00
|
|
|
];
|
2014-02-24 05:46:04 +01:00
|
|
|
|
2014-08-21 21:15:32 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-05-18 09:31:02 +02:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2010-02-05 23:00:51 +01:00
|
|
|
homepage = http://glew.sourceforge.net/;
|
2014-08-21 21:15:32 +02:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2008-01-16 03:20:46 +01:00
|
|
|
};
|
|
|
|
}
|