1 { lib, stdenv, fetchurl, libGLU, libXmu, libXi, libXext
7 stdenv.mkDerivation (finalAttrs: {
12 url = "mirror://sourceforge/glew/glew-${finalAttrs.version}.tgz";
13 sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
16 buildInputs = if stdenv.hostPlatform.isDarwin then [ AGL ] else [ libXmu libXi libXext ];
17 propagatedBuildInputs = if stdenv.hostPlatform.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
19 outputs = [ "out" "dev" ];
22 sed -i 's|lib64|lib|' config/Makefile.linux
23 ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
24 sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
28 buildFlags = [ "all" ];
29 installFlags = [ "install.all" ];
32 export GLEW_DEST="$out"
36 mkdir -pv $out/share/doc/glew
37 mkdir -p $dev/lib/pkgconfig
38 cp glew*.pc $dev/lib/pkgconfig
39 cp -r README.txt LICENSE.txt doc $out/share/doc/glew
43 "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
48 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
51 description = "OpenGL extension loading library for C(++)";
52 homepage = "https://glew.sourceforge.net/";
53 license = licenses.free; # different files under different licenses
54 #["BSD" "GLX" "SGI-B" "GPL2"]
55 pkgConfigModules = [ "glew" ];
56 inherit (mesa.meta) platforms;