2018-02-24 04:59:47 -08:00
|
|
|
{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
|
2017-06-28 08:48:13 -07:00
|
|
|
}:
|
2010-02-05 14:00:51 -08:00
|
|
|
|
2014-02-23 20:46:04 -08:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-01-26 10:04:02 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-25 14:02:34 -07:00
|
|
|
name = "glew-2.1.0";
|
2008-01-15 18:20:46 -08:00
|
|
|
|
2008-01-30 09:20:48 -08:00
|
|
|
src = fetchurl {
|
2012-01-26 10:04:02 -08:00
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
2018-03-25 14:02:34 -07:00
|
|
|
sha256 = "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4";
|
2008-01-15 18:20:46 -08:00
|
|
|
};
|
|
|
|
|
2016-09-01 08:23:31 -07:00
|
|
|
outputs = [ "bin" "out" "dev" "doc" ];
|
|
|
|
|
2017-08-14 13:39:03 -07:00
|
|
|
buildInputs = [ xlibsWrapper libXmu libXi ];
|
2018-02-24 04:59:47 -08:00
|
|
|
propagatedBuildInputs = [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2008-01-15 18:20:46 -08:00
|
|
|
|
2013-06-08 17:33:34 -07:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2017-11-27 07:57:50 -08:00
|
|
|
substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
|
2018-08-20 11:43:41 -07:00
|
|
|
${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2017-11-27 07:57:50 -08:00
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
2014-03-10 14:22:21 -07:00
|
|
|
''}
|
2013-06-08 17:33:34 -07:00
|
|
|
'';
|
|
|
|
|
2014-02-23 20:46:04 -08:00
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
2016-09-01 08:23:31 -07:00
|
|
|
makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
|
2013-06-08 17:33:34 -07:00
|
|
|
'';
|
|
|
|
|
2014-02-23 20:46:04 -08:00
|
|
|
postInstall = ''
|
2013-05-18 00:31:02 -07:00
|
|
|
mkdir -pv $out/share/doc/glew
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
cp glew*.pc $out/lib/pkgconfig
|
2016-11-25 14:37:15 -08:00
|
|
|
cp -r README.md LICENSE.txt doc $out/share/doc/glew
|
2016-09-01 08:23:31 -07:00
|
|
|
rm $out/lib/*.a
|
2013-05-18 00:31:02 -07:00
|
|
|
'';
|
|
|
|
|
2017-06-23 14:45:27 -07:00
|
|
|
makeFlags = [
|
2018-08-20 11:43:41 -07:00
|
|
|
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
|
2017-06-28 08:48:13 -07:00
|
|
|
];
|
2014-02-23 20:46:04 -08:00
|
|
|
|
2017-11-27 07:57:50 -08:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2014-08-21 12:15:32 -07:00
|
|
|
meta = with stdenv.lib; {
|
2013-05-18 00:31:02 -07:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2010-02-05 14:00:51 -08:00
|
|
|
homepage = http://glew.sourceforge.net/;
|
2014-08-21 12:15:32 -07:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2008-01-15 18:20:46 -08:00
|
|
|
};
|
|
|
|
}
|