1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/libraries/glew/default.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
, buildPlatform, hostPlatform
}:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "glew-2.1.0";
src = fetchurl {
url = "mirror://sourceforge/glew/${name}.tgz";
sha256 = "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4";
};
outputs = [ "bin" "out" "dev" "doc" ];
buildInputs = [ xlibsWrapper libXmu libXi ];
propagatedBuildInputs = [ libGLU ]; # GL/glew.h includes GL/glu.h
patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux
2017-11-27 15:57:50 +00:00
substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
2017-06-28 21:12:05 +01:00
${optionalString (hostPlatform != buildPlatform) ''
2017-11-27 15:57:50 +00:00
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
'';
makeFlags = [
"SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}"
];
2017-11-27 15:57:50 +00:00
enableParallelBuilding = true;
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;
};
}