32 buildPythonPackage rec {
37 disabled = pythonOlder "3.6";
39 src = fetchFromGitHub {
42 rev = "refs/tags/${version}";
43 # Unicode file names lead to different checksums on HFS+ vs. other
44 # filesystems because of unicode normalisation. The documentation
45 # has such files and will be removed.
46 hash = "sha256-wNXcmH0IIuAOoomIdmhAPxe4TiEzes3Kq+Vth2r4/IA=";
47 postFetch = "rm -rf $out/docs/reST";
51 # Patch pygame's dependency resolution to let it find build inputs
53 src = ./fix-dependency-finding.patch;
54 buildinputs_include = builtins.toJSON (
55 builtins.concatMap (dep: [
57 "${lib.getDev dep}/include"
58 "${lib.getDev dep}/include/SDL2"
61 buildinputs_lib = builtins.toJSON (
62 builtins.concatMap (dep: [
64 "${lib.getLib dep}/lib"
69 # mixer queue test returns busy queue when it shouldn't
70 ./skip-mixer-test.patch
74 substituteInPlace src_py/sysfont.py \
75 --replace-fail 'path="fc-list"' 'path="${fontconfig}/bin/fc-list"' \
76 --replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list
96 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ];
99 ${python.pythonOnBuildForHost.interpreter} buildconfig/config.py
102 env = lib.optionalAttrs stdenv.cc.isClang {
103 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
109 # No audio or video device in test environment
110 export SDL_VIDEODRIVER=dummy
111 export SDL_AUDIODRIVER=disk
113 ${python.interpreter} -m pygame.tests -v --exclude opengl,timing --time_out 300
117 pythonImportsCheck = [ "pygame" ];
120 description = "Python library for games";
121 homepage = "https://www.pygame.org/";
122 license = licenses.lgpl21Plus;
123 maintainers = with maintainers; [ emilytrau ];
124 platforms = platforms.unix;