2015-09-15 10:13:22 +01:00
|
|
|
{ stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi }:
|
2010-02-05 22:00:51 +00:00
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-01-26 18:04:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-10-03 00:08:42 +01:00
|
|
|
name = "glew-1.13.0";
|
2008-01-16 02:20:46 +00:00
|
|
|
|
2008-01-30 17:20:48 +00:00
|
|
|
src = fetchurl {
|
2012-01-26 18:04:02 +00:00
|
|
|
url = "mirror://sourceforge/glew/${name}.tgz";
|
2015-10-03 00:08:42 +01:00
|
|
|
sha256 = "1iwb2a6wfhkzv6fa7zx2gz1lkwa0iwnd9ka1im5vdc44xm4dq9da";
|
2008-01-16 02:20:46 +00:00
|
|
|
};
|
|
|
|
|
2016-09-01 16:23:31 +01:00
|
|
|
outputs = [ "bin" "out" "dev" "doc" ];
|
|
|
|
|
2015-09-15 10:13:22 +01:00
|
|
|
nativeBuildInputs = [ xlibsWrapper libXmu libXi ];
|
2014-02-24 04:46:04 +00:00
|
|
|
propagatedNativeBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h
|
2008-01-16 02:20:46 +00:00
|
|
|
|
2013-06-09 01:33:34 +01:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2014-03-10 21:22:21 +00:00
|
|
|
${optionalString (stdenv ? cross) ''
|
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
|
|
|
''}
|
2013-06-09 01:33:34 +01:00
|
|
|
'';
|
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
2016-09-01 16:23:31 +01:00
|
|
|
makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
|
2013-06-09 01:33:34 +01:00
|
|
|
'';
|
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
postInstall = ''
|
2013-05-18 08:31:02 +01: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
|
2016-09-01 16:23:31 +01:00
|
|
|
rm $out/lib/*.a
|
2013-05-18 08:31:02 +01:00
|
|
|
'';
|
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
crossAttrs.makeFlags = [
|
|
|
|
"CC=${stdenv.cross.config}-gcc"
|
|
|
|
"LD=${stdenv.cross.config}-gcc"
|
2014-03-10 21:22:21 +00:00
|
|
|
"AR=${stdenv.cross.config}-ar"
|
2014-02-24 04:46:04 +00:00
|
|
|
"STRIP="
|
2014-03-12 09:16:51 +00:00
|
|
|
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw"
|
|
|
|
++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin";
|
2014-02-24 04:46:04 +00:00
|
|
|
|
2014-08-21 20:15:32 +01:00
|
|
|
meta = with stdenv.lib; {
|
2013-05-18 08:31:02 +01:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2010-02-05 22:00:51 +00:00
|
|
|
homepage = http://glew.sourceforge.net/;
|
2014-08-21 20:15:32 +01:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2008-01-16 02:20:46 +00:00
|
|
|
};
|
|
|
|
}
|