1 { stdenv, lib, substituteAll, fetchPypi, buildPythonPackage, SDL2, SDL2_ttf, SDL2_image, SDL2_gfx, SDL2_mixer }:
3 buildPythonPackage rec {
7 # The tests use OpenGL using find_library, which would have to be
8 # patched; also they seem to actually open X windows and test stuff
9 # like "screensaver disabling", which would have to be cleverly
10 # sandboxed. Disable for now.
12 pythonImportsCheck = [ "sdl2" ];
17 hash = "sha256-ECdAa62+zdMP5W6AClp2rX1ycaOuwLes94DuJqAPLUA=";
20 # Deliberately not in propagated build inputs; users can decide
21 # which library they want to include.
22 buildInputs = [ SDL2_ttf SDL2_image SDL2_gfx SDL2_mixer ];
23 propagatedBuildInputs = [ SDL2 ];
26 src = ./PySDL2-dll.patch;
27 } // builtins.mapAttrs (_: pkg: "${pkg}/lib/lib${pkg.pname}${stdenv.hostPlatform.extensions.sharedLibrary}") {
28 # substituteAll keys must start lowercase
31 sdl2_image = SDL2_image;
33 sdl2_mixer = SDL2_mixer;
38 description = "A wrapper around the SDL2 library and as such similar to the discontinued PySDL project";
39 homepage = "https://github.com/marcusva/py-sdl2";
40 license = lib.licenses.publicDomain;
41 maintainers = with lib.maintainers; [ pmiddend ];