2022-11-04 12:27:35 +00:00
|
|
|
{ lib, stdenv, fetchurl, libGLU, libXmu, libXi, libXext
|
2021-01-05 17:05:55 +00:00
|
|
|
, AGL, OpenGL
|
2023-02-16 17:41:37 +00:00
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-12-26 17:43:05 +00:00
|
|
|
pname = "glew";
|
|
|
|
version = "1.10.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-02-16 17:41:37 +00:00
|
|
|
url = "mirror://sourceforge/glew/${finalAttrs.pname}-${finalAttrs.version}.tgz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
|
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
buildInputs = if stdenv.isDarwin then [ AGL ] else [ libXmu libXi libXext ];
|
2021-01-05 17:05:55 +00:00
|
|
|
propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2023-02-02 18:25:31 +00:00
|
|
|
${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2020-04-24 23:36:52 +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-10-21 18:38:19 +00:00
|
|
|
mkdir -p $dev/lib/pkgconfig
|
|
|
|
cp glew*.pc $dev/lib/pkgconfig
|
2020-04-24 23:36:52 +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}"
|
2024-06-20 14:57:18 +00:00
|
|
|
"CC:=$(CC)"
|
|
|
|
"LD:=$(CC)"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "OpenGL extension loading library for C(++)";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://glew.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
2023-02-16 17:41:37 +00:00
|
|
|
pkgConfigModules = [ "glew" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
2023-02-16 17:41:37 +00:00
|
|
|
})
|