diff --git a/pkgs/by-name/sd/SDL2_image/package.nix b/pkgs/by-name/sd/SDL2_image/package.nix index 2672f76d3f8b6..6baa7311a5c27 100644 --- a/pkgs/by-name/sd/SDL2_image/package.nix +++ b/pkgs/by-name/sd/SDL2_image/package.nix @@ -14,6 +14,7 @@ stdenv, zlib, # Boolean flags + enableSTB ? true, ## Darwin headless will hang when trying to run the SDL test program enableSdltest ? (!stdenv.hostPlatform.isDarwin), }: @@ -36,16 +37,17 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = [ - SDL2 - giflib - libXpm - libjpeg - libpng - libtiff - libwebp - zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ]; + buildInputs = + [ + SDL2 + libtiff + libwebp + zlib + ] + ++ lib.optionals (!enableSTB) [ + libjpeg + libpng + ]; configureFlags = [ @@ -54,6 +56,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.enableFeature false "png-shared") (lib.enableFeature false "tif-shared") (lib.enableFeature false "webp-shared") + (lib.enableFeature enableSTB "stb-image") (lib.enableFeature enableSdltest "sdltest") ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ diff --git a/pkgs/by-name/sd/SDL2_image_2_0/package.nix b/pkgs/by-name/sd/SDL2_image_2_0/package.nix deleted file mode 100644 index 4897ff5ad44ab..0000000000000 --- a/pkgs/by-name/sd/SDL2_image_2_0/package.nix +++ /dev/null @@ -1,17 +0,0 @@ -# Dependency of pygame, toppler -{ SDL2_image, fetchurl }: - -SDL2_image.overrideAttrs (oldAttrs: { - version = "2.0.5"; - src = fetchurl { - inherit (oldAttrs.src) url; - hash = "sha256-vdX24CZoL31+G+C2BRsgnaL0AqLdi9HEvZwlrSYxCNA"; - }; - - postPatch = - (oldAttrs.postPatch or "") - + '' - # allow newer autoreconf to run successfully - touch NEWS README AUTHORS ChangeLog - ''; -}) diff --git a/pkgs/development/python-modules/pygame-ce/default.nix b/pkgs/development/python-modules/pygame-ce/default.nix index 649c72c0be2ae..3f0c7e30b98cd 100644 --- a/pkgs/development/python-modules/pygame-ce/default.nix +++ b/pkgs/development/python-modules/pygame-ce/default.nix @@ -19,7 +19,7 @@ libpng, libX11, portmidi, - SDL2, + SDL2_classic, SDL2_image, SDL2_mixer, SDL2_ttf, @@ -60,8 +60,6 @@ buildPythonPackage rec { ]) buildInputs ); }) - # Skip tests that should be disabled without video driver - ./skip-surface-tests.patch ]; postPatch = @@ -101,8 +99,8 @@ buildPythonPackage rec { libjpeg libpng portmidi - SDL2 - SDL2_image + SDL2_classic + (SDL2_image.override { enableSTB = false; }) SDL2_mixer SDL2_ttf ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ]; @@ -117,7 +115,7 @@ buildPythonPackage rec { env = { - SDL_CONFIG = lib.getExe' (lib.getDev SDL2) "sdl2-config"; + SDL_CONFIG = lib.getExe' (lib.getDev SDL2_classic) "sdl2-config"; } // lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types"; diff --git a/pkgs/development/python-modules/pygame-ce/skip-surface-tests.patch b/pkgs/development/python-modules/pygame-ce/skip-surface-tests.patch deleted file mode 100644 index 21d9c9060f3b8..0000000000000 --- a/pkgs/development/python-modules/pygame-ce/skip-surface-tests.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/test/surface_test.py b/test/surface_test.py -index 5ce78b6e..8b8f7ed5 100644 ---- a/test/surface_test.py -+++ b/test/surface_test.py -@@ -1091,6 +1091,10 @@ class GeneralSurfaceTests(unittest.TestCase): - finally: - pygame.display.quit() - -+ @unittest.skipIf( -+ os.environ.get("SDL_VIDEODRIVER") == "dummy", -+ 'requires a non-"dummy" SDL_VIDEODRIVER', -+ ) - def test_convert_init(self): - """Ensure initialization exceptions are raised - for surf.convert().""" -@@ -1118,6 +1122,10 @@ class GeneralSurfaceTests(unittest.TestCase): - finally: - pygame.display.quit() - -+ @unittest.skipIf( -+ os.environ.get("SDL_VIDEODRIVER") == "dummy", -+ 'requires a non-"dummy" SDL_VIDEODRIVER', -+ ) - def test_convert_alpha_init(self): - """Ensure initialization exceptions are raised - for surf.convert_alpha().""" diff --git a/pkgs/development/python-modules/pygame/default.nix b/pkgs/development/python-modules/pygame/default.nix index f549bffc1d3b1..bb595909e5c90 100644 --- a/pkgs/development/python-modules/pygame/default.nix +++ b/pkgs/development/python-modules/pygame/default.nix @@ -87,7 +87,7 @@ buildPythonPackage rec { libX11 portmidi SDL2_classic - SDL2_image + (SDL2_image.override { enableSTB = false; }) SDL2_mixer SDL2_ttf ]; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 566df1693f5fe..92fa71c841f7e 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1569,6 +1569,7 @@ mapAliases { SDL_classic = SDL1; # Added 2024-09-03 SDL1 = throw "'SDL1' has been removed as development ended long ago with SDL 2.0 replacing it, use SDL_compat instead"; # Added 2025-03-27 SDL_gpu = throw "'SDL_gpu' has been removed due to lack of upstream maintenance and known users"; # Added 2025-03-15 + SDL_image_2_0 = throw "'SDL_image_2_0' has been removed in favor of the latest version"; # Added 2025-04-20 s2n = throw "'s2n' has been renamed to/replaced by 's2n-tls'"; # Converted to throw 2024-10-17 sandboxfs = throw "'sandboxfs' has been removed due to being unmaintained, consider using linux namespaces for sandboxing instead"; # Added 2024-06-06 sane-backends-git = throw "'sane-backends-git' has been renamed to/replaced by 'sane-backends'"; # Converted to throw 2024-10-17 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6ab1d23a3b941..04431477502c4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12263,11 +12263,10 @@ self: super: with self; { pygal = callPackage ../development/python-modules/pygal { }; - pygame = callPackage ../development/python-modules/pygame { SDL2_image = pkgs.SDL2_image_2_0; }; + pygame = callPackage ../development/python-modules/pygame { }; pygame-ce = callPackage ../development/python-modules/pygame-ce { inherit (pkgs.darwin.apple_sdk.frameworks) AppKit; - SDL2_image = pkgs.SDL2_image_2_0; SDL2_mixer = pkgs.SDL2_mixer_2_0; };