1 { lib, stdenv, fetchFromGitHub, python3, cmake, libglvnd, libGLU, unstableGitUpdater }:
3 stdenv.mkDerivation rec {
5 version = "unstable-2023-10-10";
7 src = fetchFromGitHub {
10 rev = "3a33275633ce4be433332dc776e6a5b3bdea6506";
11 hash = "sha256-kEm5QItpasSFJQ32YBHPpc+itz/nQ8bQMCavbOTGT/w=";
14 nativeBuildInputs = [ python3 cmake ];
15 # gl3w installs a CMake config that when included expects to be able to
16 # build and link against both of these libraries
17 # (the gl3w generated C file gets compiled into the downstream target)
18 propagatedBuildInputs = [ libglvnd libGLU ];
20 dontUseCmakeBuildDir = true;
22 # These files must be copied rather than linked since they are considered
23 # outputs for the custom command, and CMake expects to be able to touch them
25 mkdir -p include/{GL,KHR}
26 cp ${libglvnd.dev}/include/GL/glcorearb.h include/GL/glcorearb.h
27 cp ${libglvnd.dev}/include/KHR/khrplatform.h include/KHR/khrplatform.h
30 passthru.updateScript = unstableGitUpdater { };
33 description = "Simple OpenGL core profile loading";
34 homepage = "https://github.com/skaslev/gl3w";
35 license = licenses.unlicense;
36 maintainers = with maintainers; [ lilyinstarlight ];
37 platforms = platforms.unix;