2022-10-30 16:37:04 +00:00
|
|
|
{ lib, stdenv, fetchurl, libGLU, libXmu, libXi, libXext
|
2020-12-17 21:53:35 +00:00
|
|
|
, AGL, OpenGL
|
2023-02-11 14:21:55 +00:00
|
|
|
, testers
|
2017-06-28 15:48:13 +00:00
|
|
|
}:
|
2015-06-11 22:58:00 +00:00
|
|
|
|
2023-02-11 14:21:55 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-11-09 22:12:55 +00:00
|
|
|
pname = "glew";
|
|
|
|
version = "1.10.0";
|
2015-06-11 22:58:00 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-02-11 14:21:55 +00:00
|
|
|
url = "mirror://sourceforge/glew/${finalAttrs.pname}-${finalAttrs.version}.tgz";
|
2015-06-11 22:58:00 +00:00
|
|
|
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
|
|
|
|
};
|
|
|
|
|
2022-10-30 16:37:04 +00:00
|
|
|
buildInputs = if stdenv.isDarwin then [ AGL ] else [ libXmu libXi libXext ];
|
2020-12-17 21:53:35 +00:00
|
|
|
propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2015-06-11 22:58:00 +00:00
|
|
|
|
2022-09-21 01:45:08 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2015-06-11 22:58:00 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2023-01-26 17:31:02 +00:00
|
|
|
${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
|
2022-09-21 01:45:08 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2017-06-23 21:45:27 +00:00
|
|
|
makeFlags = [
|
2018-08-20 18:43:41 +00:00
|
|
|
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
|
2017-06-28 15:48:13 +00:00
|
|
|
];
|
2015-06-11 22:58:00 +00:00
|
|
|
|
2023-02-11 14:21:55 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2015-06-11 22:58:00 +00:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2023-01-21 21:41:12 +00:00
|
|
|
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"]
|
2023-02-11 14:21:55 +00:00
|
|
|
pkgConfigModules = [ "glew" ];
|
2015-06-11 22:58:00 +00:00
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
2023-02-11 14:21:55 +00:00
|
|
|
})
|