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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, libGLU, libXmu, libXi, libXext
, AGL, OpenGL
, testers
}:
2015-06-11 22:58:00 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "glew";
version = "1.10.0";
2015-06-11 22:58:00 +00:00
src = fetchurl {
url = "mirror://sourceforge/glew/${finalAttrs.pname}-${finalAttrs.version}.tgz";
2015-06-11 22:58:00 +00:00
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
};
buildInputs = if stdenv.isDarwin then [ AGL ] else [ libXmu libXi libXext ];
propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
2015-06-11 22:58:00 +00:00
outputs = [ "out" "dev" ];
2015-06-11 22:58:00 +00:00
patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux
${lib.optionalString (stdenv.hostPlatform != stdenv.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 $dev/lib/pkgconfig
cp glew*.pc $dev/lib/pkgconfig
2015-06-11 22:58:00 +00:00
cp -r README.txt LICENSE.txt doc $out/share/doc/glew
'';
makeFlags = [
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
];
2015-06-11 22:58:00 +00:00
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
2015-06-11 22:58:00 +00:00
description = "An OpenGL extension loading library for C(++)";
homepage = "https://glew.sourceforge.net/";
2015-06-11 22:58:00 +00:00
license = licenses.free; # different files under different licenses
#["BSD" "GLX" "SGI-B" "GPL2"]
pkgConfigModules = [ "glew" ];
2015-06-11 22:58:00 +00:00
platforms = platforms.mesaPlatforms;
};
})