3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/glew/default.nix

56 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, mesa_glu, xlibsWrapper, libXmu, libXi }:
with stdenv.lib;
stdenv.mkDerivation rec {
2016-11-25 22:37:15 +00:00
name = "glew-2.0.0";
src = fetchurl {
url = "mirror://sourceforge/glew/${name}.tgz";
2016-11-25 22:37:15 +00:00
sha256 = "0r37fg2s1f0jrvwh6c8cz5x6v4wqmhq42qm15cs9qs349q5c6wn5";
};
outputs = [ "bin" "out" "dev" "doc" ];
nativeBuildInputs = [ xlibsWrapper libXmu libXi ];
propagatedNativeBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h
patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux
${optionalString (stdenv ? cross) ''
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
''}
'';
buildFlags = [ "all" ];
installFlags = [ "install.all" ];
preInstall = ''
makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
'';
postInstall = ''
mkdir -pv $out/share/doc/glew
mkdir -p $out/lib/pkgconfig
cp glew*.pc $out/lib/pkgconfig
2016-11-25 22:37:15 +00:00
cp -r README.md LICENSE.txt doc $out/share/doc/glew
rm $out/lib/*.a
'';
crossAttrs.makeFlags = [
"CC=${stdenv.cross.config}-gcc"
"LD=${stdenv.cross.config}-gcc"
"AR=${stdenv.cross.config}-ar"
"STRIP="
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw"
++ optional (stdenv.cross.libc == "libSystem") "SYSTEM=darwin";
2014-08-21 20:15:32 +01:00
meta = with stdenv.lib; {
description = "An OpenGL extension loading library for C(++)";
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;
};
}