From 3e54fa949cdcd4d69ecb99267c29c8aeb70a30d6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 14 Dec 2023 22:33:08 +0000 Subject: [PATCH] hedgewars: hold SDL2_image back on 2.6 branch Without the holdback hedgewars fails to start game sessions on `SDL2_image-2.8.1` as: "Surface2Tex failed, expecting 32 bit surface" It is caused by lack of support of palette-based .png files by `hedgewars`. Those were added in `SDL2_image-2.8` in https://github.com/libsdl-org/SDL_image/commit/bf0821bcc71f16ba3c4282ec2e6aad29684faf57 --- pkgs/games/hedgewars/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/games/hedgewars/default.nix b/pkgs/games/hedgewars/default.nix index 94f8a28add9b..763dc3f63a6c 100644 --- a/pkgs/games/hedgewars/default.nix +++ b/pkgs/games/hedgewars/default.nix @@ -1,4 +1,4 @@ -{ stdenv, SDL2_image, SDL2_ttf, SDL2_net, fpc, ghcWithPackages, ffmpeg_4, freeglut +{ stdenv, SDL2_image_2_6, SDL2_ttf, SDL2_net, fpc, ghcWithPackages, ffmpeg_4, freeglut , lib, fetchurl, cmake, pkg-config, lua5_1, SDL2, SDL2_mixer , zlib, libpng, libGL, libGLU, physfs , qtbase, qttools, wrapQtAppsHook @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ]; buildInputs = [ - SDL2_ttf SDL2_net SDL2 SDL2_mixer SDL2_image + SDL2_ttf SDL2_net SDL2 SDL2_mixer SDL2_image_2_6 fpc lua5_1 llvm # hard-requirement on aarch64, for some reason not strictly necessary on x86-64 ffmpeg_4 freeglut physfs @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [ SDL2.out - SDL2_image + SDL2_image_2_6 SDL2_mixer SDL2_net SDL2_ttf diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd2434bcb4df..74c04480e8da 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24925,6 +24925,12 @@ with pkgs; version = "2.0.5"; hash = "sha256-vdX24CZoL31+G+C2BRsgnaL0AqLdi9HEvZwlrSYxCNA"; }); + SDL2_image_2_6 = SDL2_image.override({ + # Pinned for hedgewars: + # https://github.com/NixOS/nixpkgs/pull/274185#issuecomment-1856764786 + version = "2.6.3"; + hash = "sha256-kxyb5b8dfI+um33BV4KLfu6HTiPH8ktEun7/a0g2MSw="; + }); SDL2_mixer = callPackage ../development/libraries/SDL2_mixer { inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit AudioToolbox;