From 38115fa2c52801b0b30d24482da3296335029e29 Mon Sep 17 00:00:00 2001 From: Rafael Ieda Date: Mon, 27 Oct 2025 19:12:40 -0300 Subject: [PATCH] stepmania: upgrade to gtk3 --- pkgs/by-name/st/stepmania/ffmpeg-7.patch | 11 ++++++++ pkgs/by-name/st/stepmania/package.nix | 32 ++++++++++++++---------- 2 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 pkgs/by-name/st/stepmania/ffmpeg-7.patch diff --git a/pkgs/by-name/st/stepmania/ffmpeg-7.patch b/pkgs/by-name/st/stepmania/ffmpeg-7.patch new file mode 100644 index 000000000000..80b4b8b6a2b7 --- /dev/null +++ b/pkgs/by-name/st/stepmania/ffmpeg-7.patch @@ -0,0 +1,11 @@ +--- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp ++++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +@@ -273,7 +273,7 @@ + bool bSkipThisFrame = + fTargetTime != -1 && + GetTimestamp() + GetFrameDuration() < fTargetTime && +- (m_pStreamCodec->frame_number % 2) == 0; ++ (m_pStreamCodec->frame_num % 2) == 0; + + int iGotFrame; + int len; diff --git a/pkgs/by-name/st/stepmania/package.nix b/pkgs/by-name/st/stepmania/package.nix index 66cfca7cd573..a447ebb62b07 100644 --- a/pkgs/by-name/st/stepmania/package.nix +++ b/pkgs/by-name/st/stepmania/package.nix @@ -6,10 +6,10 @@ cmake, nasm, alsa-lib, - ffmpeg_6, + ffmpeg_7, glew, glib, - gtk2, + gtk3, libmad, libogg, libpng, @@ -32,12 +32,20 @@ stdenv.mkDerivation { }; patches = [ - # https://github.com/stepmania/stepmania/pull/2247 (fetchpatch { - name = "fix-building-with-ffmpeg6.patch"; - url = "https://github.com/stepmania/stepmania/commit/3fef5ef60b7674d6431f4e1e4ba8c69b0c21c023.patch"; + # Fix building with newer FFmpeg + name = "fix-building-with-newer-ffmpeg.patch"; + url = "https://github.com/stepmania/stepmania/commit/3fef5ef60b7674d6431f4e1e4ba8c69b0c21c023.patch?full_index=1"; hash = "sha256-m+5sP+mIpcSjioRBdzChqja5zwNcwdSNAfvSJ2Lww+g="; }) + (fetchpatch { + # Fix crash on loading animated previews while using newer FFmpeg + name = "fix-crash-newer-ffmpeg.patch"; + url = "https://github.com/stepmania/stepmania/commit/e0d2a5182dcd855e181fffa086273460c553c7ff.patch?full_index=1"; + hash = "sha256-XacaMn29FwG3WgFBfB890I8mzVrvuOL4wPWcHHNYfXM="; + }) + # FFmpeg 7 frame_number compatibility fix + ./ffmpeg-7.patch ]; postPatch = '' @@ -54,10 +62,10 @@ stdenv.mkDerivation { buildInputs = [ alsa-lib - ffmpeg_6 + ffmpeg_7 glew glib - gtk2 + gtk3 libmad libogg libpng @@ -72,8 +80,6 @@ stdenv.mkDerivation { "-DWITH_SYSTEM_FFMPEG=1" "-DWITH_SYSTEM_PNG=on" "-DWITH_SYSTEM_ZLIB=on" - "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include" - "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include" ]; postInstall = '' @@ -86,12 +92,12 @@ stdenv.mkDerivation { install -Dm444 $src/stepmania.desktop -t $out/share/applications ''; - meta = with lib; { + meta = { homepage = "https://www.stepmania.com/"; description = "Free dance and rhythm game for Windows, Mac, and Linux"; - platforms = platforms.linux; - license = licenses.mit; # expat version - maintainers = with maintainers; [ h7x4 ]; + platforms = lib.platforms.linux; + license = lib.licenses.mit; # expat version + maintainers = with lib.maintainers; [ h7x4 ]; mainProgram = "stepmania"; }; }