1{ stdenv, pkgs, buildPythonPackage, fetchFromGitHub, isPy27
2, cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }:
3
4buildPythonPackage rec {
5 pname = "pygame_sdl2";
6 version = "6.99.10.1227";
7 name = "${pname}-${version}";
8
9 src = fetchFromGitHub {
10 owner = "renpy";
11 repo = "${pname}";
12 rev = "renpy-${version}";
13 sha256 = "10n6janvqh5adn7pcijqwqfh234sybjz788kb8ac6b4l11hy2lx1";
14 };
15
16 buildInputs = [
17 SDL2 SDL2_image SDL2_ttf SDL2_mixer
18 cython libjpeg libpng
19 ];
20
21
22 doCheck = isPy27; # python3 tests are non-functional
23
24 postInstall = ''
25 ( cd "$out"/include/python*/ ;
26 ln -s pygame-sdl2 pygame_sdl2 || true ; )
27 '';
28
29 meta = with stdenv.lib; {
30 description = "A reimplementation of parts of pygame API using SDL2";
31 homepage = "https://github.com/renpy/pygame_sdl2";
32 # Some parts are also available under Zlib License
33 license = licenses.lgpl2;
34 maintainers = with maintainers; [ raskin ];
35 };
36}