ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / pygame_sdl2 / default.nix
blob1ef91e080fe1b07cf18c718a067d641bb1df0546
1 { lib, buildPythonPackage, fetchurl, isPy27, renpy
2 , cython, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, libjpeg, libpng }:
4 buildPythonPackage rec {
5   pname = "pygame_sdl2";
6   version = "2.1.0";
7   renpy_version = renpy.base_version;
8   name = "${pname}-${version}-${renpy_version}";
10   src = fetchurl {
11     url = "https://www.renpy.org/dl/${renpy_version}/pygame_sdl2-${version}-for-renpy-${renpy_version}.tar.gz";
12     sha256 = "sha256-BpETor1dz8qdMM8iYijlthnsrPF0FS8b1FDvuXxFB9s=";
13   };
15   # force rebuild of headers needed for install
16   prePatch = ''
17     rm -rf gen gen3
18   '';
20   nativeBuildInputs = [
21     SDL2.dev cython
22   ];
24   buildInputs = [
25     SDL2 SDL2_image SDL2_ttf SDL2_mixer
26     libjpeg libpng
27   ];
30   doCheck = isPy27; # python3 tests are non-functional
32   postInstall = ''
33     ( cd "$out"/include/python*/ ;
34       ln -s pygame-sdl2 pygame_sdl2 || true ; )
35   '';
37   meta = with lib; {
38     description = "A reimplementation of parts of pygame API using SDL2";
39     homepage    = "https://github.com/renpy/pygame_sdl2";
40     # Some parts are also available under Zlib License
41     license     = licenses.lgpl2;
42     maintainers = with maintainers; [ raskin ];
43   };