From 6f05bc3791cd7d27cdc376548df4ce05d9a4ce6d Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 27 Nov 2021 16:05:34 -0300 Subject: [PATCH 1/3] libretro.pcsx2: init at unstable-2021-11-27 Thanks for @jnetod help. --- pkgs/misc/emulators/retroarch/cores.nix | 36 +++++++++++++++++++++++ pkgs/misc/emulators/retroarch/hashes.json | 7 +++++ pkgs/misc/emulators/retroarch/update.py | 1 + 3 files changed, 44 insertions(+) diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index c8a1b8983f32..44c43f0f3284 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -14,6 +14,7 @@ , hexdump , hidapi , icu +, libaio , libGL , libGLU , libevdev @@ -21,6 +22,7 @@ , libpcap , libpng , libvorbis +, libxml2 , libzip , makeWrapper , nasm @@ -36,6 +38,8 @@ , udev , which , xorg +, xxd +, xz , zlib }: @@ -669,6 +673,38 @@ in ''; }; + pcsx2 = mkLibRetroCore { + core = "pcsx2"; + version = "unstable-2021-11-27"; + description = "Port of PCSX2 to libretro"; + license = lib.licenses.gpl3Plus; + extraNativeBuildInputs = [ + cmake + gettext + pkg-config + ]; + extraBuildInputs = [ + libaio + libGL + libGLU + libpcap + libpng + libxml2 + xz + xxd + ]; + makefile = "Makefile"; + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + "-DLIBRETRO=ON" + ]; + postPatch = '' + # remove ccache + substituteInPlace CMakeLists.txt --replace "ccache" "" + ''; + postBuild = "cd /build/source/build/pcsx2"; + }; + pcsx_rearmed = mkLibRetroCore { core = "pcsx_rearmed"; description = "Port of PCSX ReARMed with GNU lightning to libretro"; diff --git a/pkgs/misc/emulators/retroarch/hashes.json b/pkgs/misc/emulators/retroarch/hashes.json index 9eab19b29ad1..3caf4ed9f7b8 100644 --- a/pkgs/misc/emulators/retroarch/hashes.json +++ b/pkgs/misc/emulators/retroarch/hashes.json @@ -377,6 +377,13 @@ "sha256": "rms+T8JOp/TJ/T5a5uLj8lu1LLz/GAsJZ7UbK42C9yU=", "fetchSubmodules": false }, + "pcsx2": { + "owner": "libretro", + "repo": "pcsx2", + "rev": "18e0685ed4f191796c8e923caf4f5e96a930057e", + "sha256": "V2eS741us2p+JC+ghmHjAtFeptB0UcBlwZuisZ8Co7M=", + "fetchSubmodules": false + }, "pcsx_rearmed": { "owner": "libretro", "repo": "pcsx_rearmed", diff --git a/pkgs/misc/emulators/retroarch/update.py b/pkgs/misc/emulators/retroarch/update.py index 3c1ea2b755b1..831709d89e7c 100755 --- a/pkgs/misc/emulators/retroarch/update.py +++ b/pkgs/misc/emulators/retroarch/update.py @@ -64,6 +64,7 @@ CORES = { "o2em": {"repo": "libretro-o2em"}, "opera": {"repo": "opera-libretro"}, "parallel-n64": {"repo": "parallel-n64"}, + "pcsx2": {"repo": "pcsx2"}, "pcsx_rearmed": {"repo": "pcsx_rearmed"}, "picodrive": {"repo": "picodrive", "fetch_submodules": True}, "play": {"repo": "Play-", "owner": "jpd002", "fetch_submodules": True}, From 7ff536edd6a8fff222889229dce7d2673f0ab463 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 28 Nov 2021 14:18:22 -0300 Subject: [PATCH 2/3] libretro: remove "-DCMAKE_BUILD_TYPE=Release" --- pkgs/misc/emulators/retroarch/cores.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index 44c43f0f3284..dd7f723d3c73 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -367,7 +367,6 @@ in ] ++ (with xorg; [ libSM libX11 libXi libpthreadstubs libxcb xcbutil libXext libXrandr libXinerama libXxf86vm ]); makefile = "Makefile"; cmakeFlags = [ - "-DCMAKE_BUILD_TYPE=Release" "-DLIBRETRO=ON" "-DLIBRETRO_STATIC=1" "-DENABLE_QT=OFF" @@ -695,7 +694,6 @@ in ]; makefile = "Makefile"; cmakeFlags = [ - "-DCMAKE_BUILD_TYPE=Release" "-DLIBRETRO=ON" ]; postPatch = '' @@ -846,7 +844,6 @@ in extraNativeBuildInputs = [ cmake ]; makefile = "Makefile"; cmakeFlags = [ - "-DCMAKE_BUILD_TYPE=Release" "-DBUILD_LIBRETRO_CORE=ON" ]; postPatch = "mkdir -p src/duckstation-libretro"; From 5c589d83edadc493b0c99a663f1433cf9c8f2b80 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 28 Nov 2021 14:50:21 -0300 Subject: [PATCH 3/3] libretro: fix core platforms --- pkgs/misc/emulators/retroarch/cores.nix | 9 +++++---- pkgs/misc/emulators/retroarch/default.nix | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index dd7f723d3c73..b09af281166b 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -59,6 +59,7 @@ let , src ? null , broken ? false , version ? "unstable-2021-11-22" + , platforms ? retroarch.meta.platforms , ... }@args: lib.makeOverridable stdenv.mkDerivation ( @@ -109,10 +110,9 @@ let }; meta = with lib; { - inherit broken description license; + inherit broken description license platforms; homepage = "https://www.libretro.com/"; maintainers = with maintainers; [ edwtjo hrdinka MP2E thiagokokada ]; - platforms = platforms.unix; }; }) // builtins.removeAttrs args [ "core" "src" "description" "license" "makeFlags" ] ); @@ -193,7 +193,7 @@ in description = "Port of Mednafen's Saturn core to libretro"; license = lib.licenses.gpl2Only; makefile = "Makefile"; - meta.platforms = [ "x86_64-linux" "aarch64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; }; beetle-snes = mkLibRetroCore { @@ -423,7 +423,7 @@ in extraBuildInputs = [ libGL libGLU ]; makefile = "Makefile"; makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=arm64" ]; - meta.platforms = [ "aarch64-linux" "x86_64-linux" ]; + platforms = [ "aarch64-linux" "x86_64-linux" ]; }; fmsx = mkLibRetroCore { @@ -701,6 +701,7 @@ in substituteInPlace CMakeLists.txt --replace "ccache" "" ''; postBuild = "cd /build/source/build/pcsx2"; + platforms = lib.platforms.x86; }; pcsx_rearmed = mkLibRetroCore { diff --git a/pkgs/misc/emulators/retroarch/default.nix b/pkgs/misc/emulators/retroarch/default.nix index 5a294277c80c..6bf5f219cd78 100644 --- a/pkgs/misc/emulators/retroarch/default.nix +++ b/pkgs/misc/emulators/retroarch/default.nix @@ -110,7 +110,7 @@ stdenv.mkDerivation rec { homepage = "https://libretro.com"; description = "Multi-platform emulator frontend for libretro cores"; license = licenses.gpl3Plus; - platforms = platforms.all; + platforms = platforms.unix; maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ]; # FIXME: exits with error on macOS: # No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting