diff --git a/pkgs/development/python-modules/pyglet/default.nix b/pkgs/development/python-modules/pyglet/default.nix index 1bb36d6029ec..b530dfe0b5b1 100644 --- a/pkgs/development/python-modules/pyglet/default.nix +++ b/pkgs/development/python-modules/pyglet/default.nix @@ -1,26 +1,31 @@ { lib, stdenv , buildPythonPackage , fetchPypi +, unzip +, pythonOlder , libGL , libGLU , xorg -, future -, pytest +, pytestCheckHook , glibc , gtk2-x11 , gdk-pixbuf , fontconfig , freetype , ffmpeg-full +, openal +, libpulseaudio }: buildPythonPackage rec { - version = "1.4.2"; + version = "1.5.19"; pname = "pyglet"; + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "1dxxrl4nc7xh3aai1clgzvk48bvd35r7ksirsddz0mwhx7jmm8px"; + sha256 = "sha256-/kuh2RboWWoOs4KX0PyhNlYgKI8q2SyiWvMJvprg/8w="; + extension = "zip"; }; # find_library doesn't reliably work with nix (https://github.com/NixOS/nixpkgs/issues/7307). @@ -37,6 +42,8 @@ buildPythonPackage rec { path = None if name == 'GL': path = '${libGL}/lib/libGL${ext}' + elif name == 'EGL': + path = '${libGL}/lib/libEGL${ext}' elif name == 'GLU': path = '${libGLU}/lib/libGLU${ext}' elif name == 'c': @@ -55,26 +62,46 @@ buildPythonPackage rec { path = '${freetype}/lib/libfreetype${ext}' elif name[0:2] == 'av' or name[0:2] == 'sw': path = '${ffmpeg-full}/lib/lib' + name + '${ext}' + elif name == 'openal': + path = '${openal}/lib/libopenal${ext}' + elif name == 'pulse': + path = '${libpulseaudio}/lib/libpulse${ext}' + elif name == 'Xi': + path = '${xorg.libXi}/lib/libXi${ext}' + elif name == 'Xinerama': + path = '${xorg.libXinerama}/lib/libXinerama${ext}' + elif name == 'Xxf86vm': + path = '${xorg.libXxf86vm}/lib/libXxf86vm${ext}' if path is not None: return ctypes.cdll.LoadLibrary(path) raise Exception("Could not load library {}".format(names)) EOF ''; - propagatedBuildInputs = [ future ]; + nativeBuildInputs = [ unzip ]; - # needs an X server. Keep an eye on - # https://bitbucket.org/pyglet/pyglet/issues/219/egl-support-headless-rendering + # needs GL set up which isn't really possible in a build environment even in headless mode. + # tests do run and pass in nix-shell, however. doCheck = false; checkInputs = [ - pytest + pytestCheckHook ]; - checkPhase = '' - py.test tests/unit tests/integration + preCheck = '' + export PYGLET_HEADLESS=True ''; + # test list taken from .travis.yml + disabledTestPaths = [ + "tests/base" + "tests/interactive" + "tests/integration" + "tests/unit/text/test_layout.py" + ]; + + pythonImportsCheck = [ "pyglet" ]; + meta = with lib; { homepage = "http://www.pyglet.org/"; description = "A cross-platform windowing and multimedia library";