Files

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

55 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
fetchFromGitHub,
python3,
cmake,
libglvnd,
libGLU,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "gl3w";
version = "0-unstable-2025-09-23";
src = fetchFromGitHub {
owner = "skaslev";
repo = "gl3w";
rev = "97a85e153d7f43c8d2de8b776a33721e238ddb96";
hash = "sha256-cpB/8qo9dDyKPxD6mRriKGZf7N7ei1oL5JtM4jgXsAw=";
};
nativeBuildInputs = [
python3
cmake
];
# gl3w installs a CMake config that when included expects to be able to
# build and link against both of these libraries
# (the gl3w generated C file gets compiled into the downstream target)
propagatedBuildInputs = [
libglvnd
libGLU
];
dontUseCmakeBuildDir = true;
# These files must be copied rather than linked since they are considered
# outputs for the custom command, and CMake expects to be able to touch them
preConfigure = ''
mkdir -p include/{GL,KHR}
cp ${libglvnd.dev}/include/GL/glcorearb.h include/GL/glcorearb.h
cp ${libglvnd.dev}/include/KHR/khrplatform.h include/KHR/khrplatform.h
'';
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Simple OpenGL core profile loading";
homepage = "https://github.com/skaslev/gl3w";
license = licenses.unlicense;
maintainers = [ ];
platforms = platforms.unix;
};
}