nixpkgs/pkgs/development/libraries/glew/1.10.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2016-08-12 03:18:06 +00:00
{ stdenv, fetchurl, mesa_glu, x11, libXmu, libXi
, buildPlatform, hostPlatform
, AGL ? null
}:
2015-06-11 22:58:00 +00:00
with stdenv.lib;
stdenv.mkDerivation rec {
name = "glew-1.10.0";
src = fetchurl {
url = "mirror://sourceforge/glew/${name}.tgz";
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
};
buildInputs = [ x11 libXmu libXi ] ++ optionals stdenv.isDarwin [ AGL ];
propagatedBuildInputs = [ mesa_glu ]; # GL/glew.h includes GL/glu.h
2015-06-11 22:58:00 +00:00
patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux
2017-06-28 20:11:06 +00:00
${optionalString (hostPlatform != buildPlatform) ''
2015-06-11 22:58:00 +00:00
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
''}
'';
buildFlags = [ "all" ];
installFlags = [ "install.all" ];
preInstall = ''
export GLEW_DEST="$out"
'';
postInstall = ''
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
'';
makeFlags = [
"SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}"
];
2015-06-11 22:58:00 +00:00
meta = with stdenv.lib; {
description = "An OpenGL extension loading library for C(++)";
homepage = http://glew.sourceforge.net/;
license = licenses.free; # different files under different licenses
#["BSD" "GLX" "SGI-B" "GPL2"]
platforms = platforms.mesaPlatforms;
};
}