@@ -1,6 +1,6 @@
11{ stdenv, substituteAll, fetchFromGitHub, python3Packages, glfw, libunistring,
22 harfbuzz, fontconfig, pkgconfig, ncurses, imagemagick, xsel,
3− libstartup_notification, libX11, libXrandr, libXinerama, libXcursor,
3+ libstartup_notification, libGL, libX11, libXrandr, libXinerama, libXcursor,
44 libxkbcommon, libXi, libXext, wayland-protocols, wayland,
55 which, dbus,
66 Cocoa,
@@ -57,6 +57,8 @@ buildPythonApplication rec {
5757 optipng
5858 ];
5959
60+ propagatedBuildInputs = stdenv.lib.optional stdenv.isLinux libGL;
61+
6062 outputs = [ "out" "terminfo" ];
6163
6264 patches = [
@@ -70,6 +72,10 @@ buildPythonApplication rec {
7072 ./png2icns.patch
7173 ];
7274
75+ preConfigure = stdenv.lib.optional (!stdenv.isDarwin) ''
76+ substituteInPlace glfw/egl_context.c --replace "libEGL.so.1" "${stdenv.lib.getLib libGL}/lib/libEGL.so.1"
77+ '';
78+
7379 buildPhase = if stdenv.isDarwin then ''
7480 make app
7581 '' else ''