29 buildPythonPackage rec {
34 src = fetchFromGitHub {
38 # Unicode file names lead to different checksums on HFS+ vs. other
39 # filesystems because of unicode normalisation. The documentation
40 # has such files and will be removed.
41 hash = "sha256-paSDF0oPogq0g0HSDRagGu0OfsqIku6q4GGAMveGntk=";
42 postFetch = "rm -rf $out/docs/reST";
46 # Patch pygame's dependency resolution to let it find build inputs
48 src = ./fix-dependency-finding.patch;
49 buildinputs_include = builtins.toJSON (
50 builtins.concatMap (dep: [
52 "${lib.getDev dep}/include"
53 "${lib.getDev dep}/include/SDL2"
56 buildinputs_lib = builtins.toJSON (
57 builtins.concatMap (dep: [
59 "${lib.getLib dep}/lib"
64 # mixer queue test returns busy queue when it shouldn't
65 ./skip-mixer-test.patch
69 substituteInPlace src_py/sysfont.py \
70 --replace-fail 'path="fc-list"' 'path="${fontconfig}/bin/fc-list"' \
71 --replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list
97 ${python.pythonOnBuildForHost.interpreter} buildconfig/config.py
100 env = lib.optionalAttrs stdenv.cc.isClang {
101 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
107 # No audio or video device in test environment
108 export SDL_VIDEODRIVER=dummy
109 export SDL_AUDIODRIVER=disk
111 ${python.interpreter} -m pygame.tests -v \
112 --exclude opengl,timing \
117 pythonImportsCheck = [ "pygame" ];
120 description = "Python library for games";
121 homepage = "https://www.pygame.org/";
122 changelog = "https://github.com/pygame/pygame/releases/tag/${src.tag}";
123 license = lib.licenses.lgpl21Plus;
124 maintainers = with lib.maintainers; [ emilytrau ];
125 platforms = lib.platforms.unix;