From b12709778b3e5d151ba04ae8e33c868a8e76c391 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 28 Dec 2024 23:20:51 +0000 Subject: [PATCH 1/5] mkLibretroCore: set hardcodeZeroVersion in unstableGitUpdater --- pkgs/applications/emulators/libretro/mkLibretroCore.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/emulators/libretro/mkLibretroCore.nix b/pkgs/applications/emulators/libretro/mkLibretroCore.nix index d8fb8879e7f58..9e063fe025724 100644 --- a/pkgs/applications/emulators/libretro/mkLibretroCore.nix +++ b/pkgs/applications/emulators/libretro/mkLibretroCore.nix @@ -83,7 +83,9 @@ stdenv.mkDerivation ( passthru = { inherit core libretroCore; - updateScript = unstableGitUpdater { }; + # libretro repos sometimes has a fake tag like "Current", ignore + # it by setting hardcodeZeroVersion + updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; } // (args.passthru or { }); meta = From f65785156a5c03334288e440043489f99bd15b83 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 28 Dec 2024 23:10:23 +0000 Subject: [PATCH 2/5] libretro.fbalpha2012: unvendor zlib Fix build with GCC 14. --- .../emulators/libretro/cores/fbalpha2012.nix | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix b/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix index febf6f7935a8e..546daaa27b352 100644 --- a/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix +++ b/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix @@ -2,8 +2,10 @@ lib, fetchFromGitHub, mkLibretroCore, + runCommand, + zlib, }: -mkLibretroCore { +mkLibretroCore rec { core = "fbalpha2012"; version = "0-unstable-2024-10-21"; @@ -14,8 +16,29 @@ mkLibretroCore { hash = "sha256-giEV09dT/e82bmDlRkxpkW04JcsEZc/enIPecqYtg3c="; }; + sourceRoot = "${src.name}/svn-current/trunk"; + + # unvendor zlib and broken minizip code + postPatch = + let + minizip-src = runCommand "minizip-src" { } '' + mkdir $out + unpackFile ${zlib.src} + cp */contrib/minizip/{unzip.*,ioapi.*,crypt.h} $out/ + ''; + in + '' + substituteInPlace ${makefile} \ + --replace-fail '-I$(FBA_LIB_DIR)/zlib' "" + + cp ${minizip-src}/* src/burner + ''; + + buildInputs = [ zlib ]; + + makeFlags = [ "EXTERNAL_ZLIB=1" ]; + makefile = "makefile.libretro"; - preBuild = "cd svn-current/trunk"; meta = { description = "Port of Final Burn Alpha ~2012 to libretro"; From 2bd9e7d5d922959348cb9193bfba841c9969f196 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 28 Dec 2024 23:15:01 +0000 Subject: [PATCH 3/5] libretro.np2kai: fix build with GCC 14 --- pkgs/applications/emulators/libretro/cores/np2kai.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/emulators/libretro/cores/np2kai.nix b/pkgs/applications/emulators/libretro/cores/np2kai.nix index 2ca6b2fba9c63..6ba98244a320b 100644 --- a/pkgs/applications/emulators/libretro/cores/np2kai.nix +++ b/pkgs/applications/emulators/libretro/cores/np2kai.nix @@ -21,6 +21,12 @@ mkLibretroCore rec { "NP2KAI_HASH=${builtins.substring 0 7 src.rev}" ]; + # Fix build with GCC 14 + env.NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=incompatible-pointer-types" + "-Wno-error=int-conversion" + ]; + preBuild = "cd sdl"; meta = { From da7851fd2244096124b08b885e3018961b96169e Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 28 Dec 2024 23:23:25 +0000 Subject: [PATCH 4/5] libretro.mame2003: 0-unstable-2024-11-01 -> 0-unstable-2024-12-10 --- pkgs/applications/emulators/libretro/cores/mame2003.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/libretro/cores/mame2003.nix b/pkgs/applications/emulators/libretro/cores/mame2003.nix index 47b83ea80c5cf..7dcbb8ab29d3c 100644 --- a/pkgs/applications/emulators/libretro/cores/mame2003.nix +++ b/pkgs/applications/emulators/libretro/cores/mame2003.nix @@ -5,15 +5,18 @@ }: mkLibretroCore { core = "mame2003"; - version = "0-unstable-2024-11-01"; + version = "0-unstable-2024-12-10"; src = fetchFromGitHub { owner = "libretro"; repo = "mame2003-libretro"; - rev = "6d543115531fc96422b73c989a628600cacbea50"; - hash = "sha256-jFzFQVB0uiSRa82sq1fiMEXyzzDJqRANNgq5hj/ZAl4="; + rev = "b6c6d52d8d630d1a172b6b771443dcbbdb45b76d"; + hash = "sha256-E0kymRxy5aubvcwE5sHcS4T3OEY924TAOXtJN69wp+8="; }; + # Fix build with GCC 14 + env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; + makefile = "Makefile"; meta = { From f5d478483cea965fbf97d69f422fa820362d77d5 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 28 Dec 2024 23:34:51 +0000 Subject: [PATCH 5/5] libretro.mame2016: unvendor rapidjson Fix build with GCC 14. --- .../emulators/libretro/cores/mame2016.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/emulators/libretro/cores/mame2016.nix b/pkgs/applications/emulators/libretro/cores/mame2016.nix index 31e929b7089a6..221940e06eaa7 100644 --- a/pkgs/applications/emulators/libretro/cores/mame2016.nix +++ b/pkgs/applications/emulators/libretro/cores/mame2016.nix @@ -4,6 +4,7 @@ fetchFromGitHub, mkLibretroCore, python3, + rapidjson, }: mkLibretroCore { core = "mame2016"; @@ -16,14 +17,22 @@ mkLibretroCore { hash = "sha256-IsM7f/zlzvomVOYlinJVqZllUhDfy4NNTeTPtNmdVak="; }; + postPatch = '' + rm -r 3rdparty/rapidjson + ln -s ${lib.getInclude rapidjson} 3rdparty/rapidjson + ''; + patches = [ ./patches/mame2016-python311.patch ]; extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib ]; makeFlags = [ "PYTHON_EXECUTABLE=python3" ]; - # Build failures when this is set to a bigger number - NIX_BUILD_CORES = 8; - # Fix build errors in GCC13 - NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive"; + + env = { + # Build failures when this is set to a bigger number + NIX_BUILD_CORES = 8; + # Fix build errors in GCC 13 + NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive"; + }; meta = { description = "Port of MAME ~2016 to libretro, compatible with MAME 0.174 sets";