Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python311Packages.pygame: 2.5.2 -> 2.6.1 #322423

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 17 additions & 25 deletions pkgs/development/python-modules/pygame/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
stdenv,
lib,
substituteAll,
fetchpatch,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,

# build-system
cython,
setuptools,
pkg-config,
SDL2,
setuptools,

# native dependencies
AppKit,
Expand All @@ -20,30 +18,28 @@
libpng,
libX11,
portmidi,
SDL2,
SDL2_image,
SDL2_mixer,
SDL2_ttf,
stdenv,

# tests
python,
}:

buildPythonPackage rec {
pname = "pygame";
version = "2.5.2";
version = "2.6.1";
pyproject = true;

disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = pname;
repo = pname;
owner = "pygame";
repo = "pygame";
rev = "refs/tags/${version}";
# Unicode file names lead to different checksums on HFS+ vs. other
# filesystems because of unicode normalisation. The documentation
# has such files and will be removed.
hash = "sha256-+gRv3Rim+2aL2uhPPGfVD0QDgB013lTf6wPx8rOwgXg=";
hash = "sha256-paSDF0oPogq0g0HSDRagGu0OfsqIku6q4GGAMveGntk=";
postFetch = "rm -rf $out/docs/reST";
};

Expand All @@ -66,14 +62,7 @@ buildPythonPackage rec {
);
})
# Skip tests that should be disabled without video driver
./skip-surface-tests.patch

# removes distutils unbreaking py312, part of https://github.com/pygame/pygame/pull/4211
(fetchpatch {
name = "remove-distutils.patch";
url = "https://github.com/pygame/pygame/commit/6038e7d6583a7a25fcc6e15387cf6240e427e5a7.patch";
hash = "sha256-HxcYjjhsu/Y9HiK9xDvY4X5dgWPP4XFLxdYGXC6tdWM=";
})
# ./skip-surface-tests.patch
];

postPatch = ''
Expand All @@ -82,7 +71,7 @@ buildPythonPackage rec {
--replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list
'';

nativeBuildInputs = [
build-system = [
cython
pkg-config
SDL2
Expand Down Expand Up @@ -116,17 +105,20 @@ buildPythonPackage rec {
export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=disk

${python.interpreter} -m pygame.tests -v --exclude opengl,timing --time_out 300
${python.interpreter} -m pygame.tests -v \
--exclude opengl,timing \
--time_out 300

runHook postCheck
'';
pythonImportsCheck = [ "pygame" ];

meta = with lib; {
meta = {
description = "Python library for games";
homepage = "https://www.pygame.org/";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ emilytrau ];
platforms = platforms.unix;
changelog = "https://github.com/pygame/pygame/releases/tag/${version}";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ emilytrau ];
platforms = lib.platforms.unix;
};
}