diff options
| author | 7c6f434c <7c6f434c@mail.ru> | 2025-02-03 11:34:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-03 11:34:28 +0000 |
| commit | 670b96b99c23bef12bb9797c26f7194bb95a39ce (patch) | |
| tree | 32f9665c300697042b6660f947afc162e68d81ec | |
| parent | handheld-daemon: 3.11.0 -> 3.11.3 (#378912) (diff) | |
| parent | pygame-sdl2: modernize derivation (diff) | |
| download | nixpkgs-670b96b99c23bef12bb9797c26f7194bb95a39ce.tar.gz | |
pygame-sdl2: 2.1.0 -> 8.3.1.24090601; modernize derivation (#374642)
| -rw-r--r-- | pkgs/development/python-modules/pygame-sdl2/default.nix | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/pkgs/development/python-modules/pygame-sdl2/default.nix b/pkgs/development/python-modules/pygame-sdl2/default.nix index 43ce26585f30..e8bea65a499f 100644 --- a/pkgs/development/python-modules/pygame-sdl2/default.nix +++ b/pkgs/development/python-modules/pygame-sdl2/default.nix @@ -1,68 +1,64 @@ { - lib, buildPythonPackage, - fetchurl, - isPy27, - renpy, cython_0, + fetchFromGitHub, + lib, + libjpeg, + libpng, + nix-update-script, SDL2, SDL2_image, - SDL2_ttf, SDL2_mixer, - libjpeg, - libpng, + SDL2_ttf, setuptools, }: -let - pname = "pygame-sdl2"; - version = "2.1.0"; - renpy_version = renpy.base_version; -in -buildPythonPackage { - inherit pname version; - name = "${pname}-${version}-${renpy_version}"; +buildPythonPackage rec { + pname = "pygame-sdl2"; + version = "8.3.1.24090601"; pyproject = true; - src = fetchurl { - url = "https://www.renpy.org/dl/${renpy_version}/pygame_sdl2-${version}+renpy${renpy_version}.tar.gz"; - hash = "sha256-bcTrdXWLTCnZQ/fP5crKIPoqJiyz+o6s0PzRChV7TQE="; + src = fetchFromGitHub { + owner = "renpy"; + repo = "pygame_sdl2"; + tag = "renpy-${version}"; + hash = "sha256-0itOmDScM+4HmWTpjkln56pv+yXDPB1KIDbE6ub2Tls="; }; - # force rebuild of headers needed for install - prePatch = '' - rm -rf gen gen3 - ''; - - # Remove build tag which produces invaild version - postPatch = '' - sed -i '2d' setup.cfg - ''; - - nativeBuildInputs = [ - SDL2.dev + build-system = [ cython_0 + SDL2 setuptools ]; - buildInputs = [ + dependencies = [ + libjpeg + libpng SDL2 SDL2_image - SDL2_ttf SDL2_mixer - libjpeg - libpng + SDL2_ttf ]; - doCheck = isPy27; # python3 tests are non-functional + doCheck = true; + + preBuild = '' + substituteInPlace setup.py --replace-fail "2.1.0" "${version}" + substituteInPlace src/pygame_sdl2/version.py --replace-fail "2, 1, 0" "${ + builtins.replaceStrings [ "." ] [ ", " ] version + }" + ''; + + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=renpy-(.*)" ]; }; meta = { - description = "Reimplementation of parts of pygame API using SDL2"; + description = "Reimplementation of the Pygame API using SDL2 and related libraries"; homepage = "https://github.com/renpy/pygame_sdl2"; license = with lib.licenses; [ lgpl2 zlib ]; + platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ raskin ]; }; } |
