diff --git a/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix b/pkgs/applications/emulators/libretro/cores/fbalpha2012.nix index febf6f7935a8..546daaa27b35 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"; diff --git a/pkgs/applications/emulators/libretro/cores/mame2003.nix b/pkgs/applications/emulators/libretro/cores/mame2003.nix index 47b83ea80c5c..7dcbb8ab29d3 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 = { diff --git a/pkgs/applications/emulators/libretro/cores/mame2016.nix b/pkgs/applications/emulators/libretro/cores/mame2016.nix index 31e929b7089a..221940e06eaa 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"; diff --git a/pkgs/applications/emulators/libretro/cores/np2kai.nix b/pkgs/applications/emulators/libretro/cores/np2kai.nix index 2ca6b2fba9c6..6ba98244a320 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 = { diff --git a/pkgs/applications/emulators/libretro/mkLibretroCore.nix b/pkgs/applications/emulators/libretro/mkLibretroCore.nix index d8fb8879e7f5..9e063fe02572 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 =