{ lib, stdenv , buildPythonPackage , fetchPypi , unzip , pythonOlder , libGL , libGLU , xorg , pytestCheckHook , glibc , gtk2-x11 , gdk-pixbuf , fontconfig , freetype , ffmpeg-full , openal , libpulseaudio }: buildPythonPackage rec { version = "1.5.21"; pname = "pyglet"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; sha256 = "5aaaddb06dc4b6f9ba08254d8d806a2bd2406925a9caf3a51fdffbd5d09728e2"; extension = "zip"; }; # find_library doesn't reliably work with nix (https://github.com/NixOS/nixpkgs/issues/7307). # Even naively searching `LD_LIBRARY_PATH` won't work since `libc.so` is a linker script and # ctypes.cdll.LoadLibrary cannot deal with those. Therefore, just hardcode the paths to the # necessary libraries. postPatch = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in '' cat > pyglet/lib.py <