diff --git a/pkgs/development/python-modules/pyglet/default.nix b/pkgs/development/python-modules/pyglet/default.nix index 4bc1cd0608c5..1b00e1264ffc 100644 --- a/pkgs/development/python-modules/pyglet/default.nix +++ b/pkgs/development/python-modules/pyglet/default.nix @@ -1,5 +1,14 @@ -{ stdenv, buildPythonPackage, fetchPypi -, libGLU_combined, xorg, freetype, fontconfig, future}: +{ stdenv +, buildPythonPackage +, fetchPypi +, libGLU_combined +, xorg +, future +, pytest +, glibc +, gtk2-x11 +, gdk_pixbuf +}: buildPythonPackage rec { version = "1.3.2"; @@ -10,15 +19,50 @@ buildPythonPackage rec { sha256 = "b00570e7cdf6971af8953b6ece50d83d13272afa5d1f1197c58c0f478dd17743"; }; + # 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 - libs = [ libGLU_combined xorg.libX11 freetype fontconfig ]; - paths = builtins.concatStringsSep "," (map (l: "\"${l}/lib\"") libs); - in "sed -i -e 's|directories\.extend.*lib[^]]*|&,${paths}|' pyglet/lib.py"; - - doCheck = false; + ext = stdenv.hostPlatform.extensions.sharedLibrary; + in '' + cat > pyglet/lib.py <