From d68e2d795c847d9c8d5aaf5f91a6f52add111488 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 7 Oct 2025 10:38:02 +0100 Subject: [PATCH 1/3] libretro.pcsx2: fix build --- pkgs/applications/emulators/libretro/cores/pcsx2.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/applications/emulators/libretro/cores/pcsx2.nix b/pkgs/applications/emulators/libretro/cores/pcsx2.nix index e518f9049e51..b5640a856e04 100644 --- a/pkgs/applications/emulators/libretro/cores/pcsx2.nix +++ b/pkgs/applications/emulators/libretro/cores/pcsx2.nix @@ -33,6 +33,18 @@ mkLibretroCore { xz ]; + # CMake Error at 3rdparty/libzip/libzip/CMakeLists.txt:1 (cmake_minimum_required): + # Compatibility with CMake < 3.5 has been removed from CMake. + # + # Update the VERSION argument value. Or, use the ... syntax + # to tell CMake that the project requires at least but has been updated + # to work with policies introduced by or earlier. + # + # Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. + cmakeFlags = [ + "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" + ]; + # libretro/ps2 needs at least those flags to compile, and probably doesn't # work on x86_64-v1 # https://github.com/libretro/ps2/blob/397b8f54b92aeffd2dd502c2c9b601305fb1de9d/cmake/BuildParameters.cmake#L101 From 78198e61fbe0aa967201e9dbeab02eea4a839d53 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 7 Oct 2025 10:42:23 +0100 Subject: [PATCH 2/3] libretro.pcsx2: 0-unstable-2025-09-14 -> 0-unstable-2025-09-29 --- pkgs/applications/emulators/libretro/cores/pcsx2.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/libretro/cores/pcsx2.nix b/pkgs/applications/emulators/libretro/cores/pcsx2.nix index b5640a856e04..10505a7f4207 100644 --- a/pkgs/applications/emulators/libretro/cores/pcsx2.nix +++ b/pkgs/applications/emulators/libretro/cores/pcsx2.nix @@ -11,13 +11,13 @@ }: mkLibretroCore { core = "pcsx2"; - version = "0-unstable-2025-09-14"; + version = "0-unstable-2025-09-29"; src = fetchFromGitHub { owner = "libretro"; repo = "ps2"; - rev = "bb03c99fa968b50309bd80d74598f053fe9168ce"; - hash = "sha256-qIdrsLQWH29PGL0TNcUtFw6aSFUJKJccKrhMoi/vYCA="; + rev = "9485a53fa5aa2bff17e04518116107f81a8c82e3"; + hash = "sha256-xkRPESbLNX9AFOIdEA9iW4Xn7hdJXfdi+TEbegC8KXA="; fetchSubmodules = true; }; From 3df179fbb0a037618b91566790b29c9abc0159e5 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 7 Oct 2025 11:05:00 +0100 Subject: [PATCH 3/3] libretro.pcsx2: refactor by using cmakeFlags --- .../emulators/libretro/cores/pcsx2.nix | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/pkgs/applications/emulators/libretro/cores/pcsx2.nix b/pkgs/applications/emulators/libretro/cores/pcsx2.nix index 10505a7f4207..ad08ff019a4e 100644 --- a/pkgs/applications/emulators/libretro/cores/pcsx2.nix +++ b/pkgs/applications/emulators/libretro/cores/pcsx2.nix @@ -33,26 +33,20 @@ mkLibretroCore { xz ]; - # CMake Error at 3rdparty/libzip/libzip/CMakeLists.txt:1 (cmake_minimum_required): - # Compatibility with CMake < 3.5 has been removed from CMake. - # - # Update the VERSION argument value. Or, use the ... syntax - # to tell CMake that the project requires at least but has been updated - # to work with policies introduced by or earlier. - # - # Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. - cmakeFlags = [ - "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" - ]; - - # libretro/ps2 needs at least those flags to compile, and probably doesn't - # work on x86_64-v1 - # https://github.com/libretro/ps2/blob/397b8f54b92aeffd2dd502c2c9b601305fb1de9d/cmake/BuildParameters.cmake#L101 - env.NIX_CFLAGS_COMPILE = toString [ - "-msse" - "-msse2" - "-msse4.1" - "-mfxsr" + cmakeFlags = with lib.strings; [ + # Workaround the following error: + # > CMake Error at 3rdparty/libzip/libzip/CMakeLists.txt:1 (cmake_minimum_required): + # > Compatibility with CMake < 3.5 has been removed from CMake. + # + # > Update the VERSION argument value. Or, use the ... syntax + # > to tell CMake that the project requires at least but has been updated + # > to work with policies introduced by or earlier. + # + # > Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. + (cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5") + # Explicitly set ARCH_FLAG to avoid -march=native + # https://github.com/libretro/ps2/blob/9485a53fa5aa2bff17e04518116107f81a8c82e3/cmake/BuildParameters.cmake#L106-L117 + (cmakeFeature "ARCH_FLAG" "-msse4.1") ]; makefile = "Makefile";