Merge pull request #147622 from thiagokokada/libretro-pcsx2

libretro.pcsx2: init at unstable-2021-11-27
This commit is contained in:
Thiago Kenji Okada 2021-11-28 15:41:11 -03:00 committed by GitHub
commit d6312c26b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 7 deletions

View file

@ -14,6 +14,7 @@
, hexdump , hexdump
, hidapi , hidapi
, icu , icu
, libaio
, libGL , libGL
, libGLU , libGLU
, libevdev , libevdev
@ -21,6 +22,7 @@
, libpcap , libpcap
, libpng , libpng
, libvorbis , libvorbis
, libxml2
, libzip , libzip
, makeWrapper , makeWrapper
, nasm , nasm
@ -36,6 +38,8 @@
, udev , udev
, which , which
, xorg , xorg
, xxd
, xz
, zlib , zlib
}: }:
@ -55,6 +59,7 @@ let
, src ? null , src ? null
, broken ? false , broken ? false
, version ? "unstable-2021-11-22" , version ? "unstable-2021-11-22"
, platforms ? retroarch.meta.platforms
, ... , ...
}@args: }@args:
lib.makeOverridable stdenv.mkDerivation ( lib.makeOverridable stdenv.mkDerivation (
@ -105,10 +110,9 @@ let
}; };
meta = with lib; { meta = with lib; {
inherit broken description license; inherit broken description license platforms;
homepage = "https://www.libretro.com/"; homepage = "https://www.libretro.com/";
maintainers = with maintainers; [ edwtjo hrdinka MP2E thiagokokada ]; maintainers = with maintainers; [ edwtjo hrdinka MP2E thiagokokada ];
platforms = platforms.unix;
}; };
}) // builtins.removeAttrs args [ "core" "src" "description" "license" "makeFlags" ] }) // builtins.removeAttrs args [ "core" "src" "description" "license" "makeFlags" ]
); );
@ -189,7 +193,7 @@ in
description = "Port of Mednafen's Saturn core to libretro"; description = "Port of Mednafen's Saturn core to libretro";
license = lib.licenses.gpl2Only; license = lib.licenses.gpl2Only;
makefile = "Makefile"; makefile = "Makefile";
meta.platforms = [ "x86_64-linux" "aarch64-linux" ]; platforms = [ "x86_64-linux" "aarch64-linux" ];
}; };
beetle-snes = mkLibRetroCore { beetle-snes = mkLibRetroCore {
@ -363,7 +367,6 @@ in
] ++ (with xorg; [ libSM libX11 libXi libpthreadstubs libxcb xcbutil libXext libXrandr libXinerama libXxf86vm ]); ] ++ (with xorg; [ libSM libX11 libXi libpthreadstubs libxcb xcbutil libXext libXrandr libXinerama libXxf86vm ]);
makefile = "Makefile"; makefile = "Makefile";
cmakeFlags = [ cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DLIBRETRO=ON" "-DLIBRETRO=ON"
"-DLIBRETRO_STATIC=1" "-DLIBRETRO_STATIC=1"
"-DENABLE_QT=OFF" "-DENABLE_QT=OFF"
@ -420,7 +423,7 @@ in
extraBuildInputs = [ libGL libGLU ]; extraBuildInputs = [ libGL libGLU ];
makefile = "Makefile"; makefile = "Makefile";
makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=arm64" ]; makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=arm64" ];
meta.platforms = [ "aarch64-linux" "x86_64-linux" ]; platforms = [ "aarch64-linux" "x86_64-linux" ];
}; };
fmsx = mkLibRetroCore { fmsx = mkLibRetroCore {
@ -669,6 +672,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 = [
"-DLIBRETRO=ON"
];
postPatch = ''
# remove ccache
substituteInPlace CMakeLists.txt --replace "ccache" ""
'';
postBuild = "cd /build/source/build/pcsx2";
platforms = lib.platforms.x86;
};
pcsx_rearmed = mkLibRetroCore { pcsx_rearmed = mkLibRetroCore {
core = "pcsx_rearmed"; core = "pcsx_rearmed";
description = "Port of PCSX ReARMed with GNU lightning to libretro"; description = "Port of PCSX ReARMed with GNU lightning to libretro";
@ -810,7 +845,6 @@ in
extraNativeBuildInputs = [ cmake ]; extraNativeBuildInputs = [ cmake ];
makefile = "Makefile"; makefile = "Makefile";
cmakeFlags = [ cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DBUILD_LIBRETRO_CORE=ON" "-DBUILD_LIBRETRO_CORE=ON"
]; ];
postPatch = "mkdir -p src/duckstation-libretro"; postPatch = "mkdir -p src/duckstation-libretro";

View file

@ -110,7 +110,7 @@ stdenv.mkDerivation rec {
homepage = "https://libretro.com"; homepage = "https://libretro.com";
description = "Multi-platform emulator frontend for libretro cores"; description = "Multi-platform emulator frontend for libretro cores";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
platforms = platforms.all; platforms = platforms.unix;
maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ]; maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ];
# FIXME: exits with error on macOS: # FIXME: exits with error on macOS:
# No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting # No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting

View file

@ -377,6 +377,13 @@
"sha256": "rms+T8JOp/TJ/T5a5uLj8lu1LLz/GAsJZ7UbK42C9yU=", "sha256": "rms+T8JOp/TJ/T5a5uLj8lu1LLz/GAsJZ7UbK42C9yU=",
"fetchSubmodules": false "fetchSubmodules": false
}, },
"pcsx2": {
"owner": "libretro",
"repo": "pcsx2",
"rev": "18e0685ed4f191796c8e923caf4f5e96a930057e",
"sha256": "V2eS741us2p+JC+ghmHjAtFeptB0UcBlwZuisZ8Co7M=",
"fetchSubmodules": false
},
"pcsx_rearmed": { "pcsx_rearmed": {
"owner": "libretro", "owner": "libretro",
"repo": "pcsx_rearmed", "repo": "pcsx_rearmed",

View file

@ -64,6 +64,7 @@ CORES = {
"o2em": {"repo": "libretro-o2em"}, "o2em": {"repo": "libretro-o2em"},
"opera": {"repo": "opera-libretro"}, "opera": {"repo": "opera-libretro"},
"parallel-n64": {"repo": "parallel-n64"}, "parallel-n64": {"repo": "parallel-n64"},
"pcsx2": {"repo": "pcsx2"},
"pcsx_rearmed": {"repo": "pcsx_rearmed"}, "pcsx_rearmed": {"repo": "pcsx_rearmed"},
"picodrive": {"repo": "picodrive", "fetch_submodules": True}, "picodrive": {"repo": "picodrive", "fetch_submodules": True},
"play": {"repo": "Play-", "owner": "jpd002", "fetch_submodules": True}, "play": {"repo": "Play-", "owner": "jpd002", "fetch_submodules": True},