1 { lib, stdenv, fetchFromGitHub, glfw, pkg-config, libXrandr, libXdamage
2 , libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
3 , libX11, libGLU, python3Packages, ensureNewerSourcesForZipFilesHook
7 stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
12 owner = "patriciogonzalezvivo";
15 sha256 = "0v7x93b61ama0gmzlx1zc56jgi7bvzsfvbkfl82xzwf2h5g1zni7";
19 sed '1i#include <cstring>' -i src/tools/text.cpp # gcc12
20 sed '8i#include <cstdint>' -i src/io/fs.cpp # gcc13
23 nativeBuildInputs = [ pkg-config ensureNewerSourcesForZipFilesHook python3Packages.six ];
25 glfw libGLU glfw libXrandr libXdamage
26 libXext libXrender libXinerama libXcursor libXxf86vm
28 ] ++ (with python3Packages; [ python setuptools wrapPython ])
29 ++ lib.optional stdenv.isDarwin Cocoa;
30 pythonPath = with python3Packages; [ pyyaml requests ];
32 # Makefile has /usr/local/bin hard-coded for 'make install'
34 substituteInPlace Makefile \
35 --replace '/usr/local' "$out" \
36 --replace '/usr/bin/clang++' 'clang++'
37 substituteInPlace Makefile \
38 --replace 'python setup.py install' "python setup.py install --prefix=$out"
43 mkdir -p $out/bin $(toPythonPath "$out")
44 export PYTHONPATH=$PYTHONPATH:$(toPythonPath "$out")
52 description = "Live GLSL coding renderer";
53 homepage = "https://patriciogonzalezvivo.com/2015/glslViewer/";
54 license = licenses.bsd3;
55 platforms = platforms.linux ++ platforms.darwin;
56 maintainers = [ maintainers.hodapp ];
57 # never built on aarch64-darwin since first introduction in nixpkgs
58 broken = stdenv.isDarwin && stdenv.isAarch64;