Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retroarch: 1.9.13.2 -> 1.9.14; libretro: unstable-2021-11-22 -> unstable-2021-12-06 #149114

Merged
merged 5 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 34 additions & 40 deletions pkgs/misc/emulators/retroarch/cores.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, alsa-lib
, boost
, buildPackages
, bzip2
, cmake
, curl
, fetchFromGitHub
Expand All @@ -30,7 +31,6 @@
, pcre
, pkg-config
, portaudio
, python27
, python3
, retroarch
, sfml
Expand All @@ -44,8 +44,6 @@
}:

let
d2u = lib.replaceChars [ "-" ] [ "_" ];

hashesFile = builtins.fromJSON (builtins.readFile ./hashes.json);

getCoreSrc = core:
Expand All @@ -58,12 +56,16 @@ let
, license
, src ? null
, broken ? false
, version ? "unstable-2021-11-22"
, version ? "unstable-2021-12-06"
, platforms ? retroarch.meta.platforms
# The resulting core file is based on core name
# Setting `normalizeCore` to `true` will convert `-` to `_` on the core filename
, normalizeCore ? true
, ...
}@args:
lib.makeOverridable stdenv.mkDerivation (
let
d2u = if normalizeCore then (lib.replaceChars [ "-" ] [ "_" ]) else (x: x);
finalSrc = if src == null then getCoreSrc core else src;
in
(rec {
Expand Down Expand Up @@ -403,11 +405,7 @@ in
description = "Port of FBNeo to libretro";
license = "Non-commercial";
makefile = "Makefile";
postPatch = ''
sed -i -e 's:-Wall:-Wall -Wno-format-security:g' src/burner/libretro/Makefile
'';
Comment on lines -406 to -408
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to be needed anymore, build and works fine without it.

preBuild = "cd src/burner/libretro";
makeFlags = [ "USE_EXPERIMENTAL_FLAGS=1" ];
Copy link
Contributor Author

@thiagokokada thiagokokada Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag seems to be used mostly for optimizations on slow platforms. Seems to enable some "dangerous" optimization flags that are not needed on x86_64 or even aarch64.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The slow platforms that upstream enable are either a Funkey S or a Classic NES/SNES that should be much slower than any platform we support.

};

fceumm = mkLibRetroCore {
Expand Down Expand Up @@ -490,11 +488,6 @@ in
description = "Port of MAME to libretro";
license = with lib.licenses; [ bsd3 gpl2Plus ];
extraBuildInputs = [ alsa-lib libGLU libGL portaudio python3 xorg.libX11 ];
postPatch = ''
# Prevent the failure during the parallel building of:
# make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
mkdir -p 3rdparty/genie/build/gmake.linux/obj/Release/src/host/lua-5.3.0/src
'';
makefile = "Makefile.libretro";
};

Expand Down Expand Up @@ -536,25 +529,20 @@ in
core = "mame2015";
description = "Port of MAME ~2015 to libretro";
license = "MAME";
extraNativeBuildInputs = [ python27 ];
makeFlags = [ "PYTHON=python3" ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makefile = "Makefile";
enableParallelBuilding = false;
};

mame2016 = mkLibRetroCore {
core = "mame2016";
patches = [
(fetchpatch {
name = "fix_mame_build_on_make-4.3.patch";
url = "https://github.com/libretro/mame2016-libretro/commit/5874fae3d124f5e7c8a91634f5473a8eac902e47.patch";
sha256 = "061f1lcm72glksf475ikl8w10pnbgqa7049ylw06nikis2qdjlfn";
})
];
Comment on lines -547 to -553
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = "Port of MAME ~2016 to libretro";
license = with lib.licenses; [ bsd3 gpl2Plus ];
extraNativeBuildInputs = [ python27 ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makeFlags = [ "PYTHON_EXECUTABLE=python3" ];
postPatch = ''
# Prevent the failure during the parallel building of:
# make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
Expand All @@ -580,17 +568,12 @@ in
};

mesen-s = mkLibRetroCore {
core = "mesens";
src = getCoreSrc "mesen-s";
core = "mesen-s";
description = "Port of Mesen-S to libretro";
license = lib.licenses.gpl3Only;
makefile = "Makefile";
preBuild = "cd Libretro";
postInstall = ''
# fix library name to match libretro-core-info
mv $coreDir/mesens_libretro${stdenv.hostPlatform.extensions.sharedLibrary} \
$coreDir/mesen-s_libretro${stdenv.hostPlatform.extensions.sharedLibrary}
'';
normalizeCore = false;
};

meteor = mkLibRetroCore {
Expand Down Expand Up @@ -674,7 +657,6 @@ in

pcsx2 = mkLibRetroCore {
core = "pcsx2";
version = "unstable-2021-11-27";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more version for this guy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It derivates the version from here: https://github.com/NixOS/nixpkgs/pull/149114/files#diff-86029dc4c3d1ca3e77939271748ead9d43e99e83df50a7d368337b59e64b3b30R58.

The only reason this version was set before because when I introduced this core in PR #147622 I didn't want to bump all other cores.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha.

description = "Port of PCSX2 to libretro";
license = lib.licenses.gpl3Plus;
extraNativeBuildInputs = [
Expand Down Expand Up @@ -727,11 +709,11 @@ in
core = "play";
description = "Port of Play! to libretro";
license = lib.licenses.bsd2;
extraBuildInputs = [ boost ];
extraNativeBuildInputs = [ cmake openssl curl icu libGL libGLU xorg.libX11 ];
extraBuildInputs = [ boost bzip2 curl openssl icu libGL libGLU xorg.libX11 ];
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
cmakeFlags = [ "-DBUILD_PLAY=OFF -DBUILD_LIBRETRO_CORE=ON" ];
postBuild = "mv Source/ui_libretro/play_libretro${stdenv.hostPlatform.extensions.sharedLibrary} play_libretro${stdenv.hostPlatform.extensions.sharedLibrary}";
cmakeFlags = [ "-DBUILD_PLAY=OFF" "-DBUILD_LIBRETRO_CORE=ON" ];
postBuild = "cd Source/ui_libretro";
};

ppsspp = mkLibRetroCore {
Expand All @@ -741,8 +723,14 @@ in
extraNativeBuildInputs = [ cmake pkg-config python3 ];
extraBuildInputs = [ libGLU libGL libzip ffmpeg snappy xorg.libX11 ];
makefile = "Makefile";
cmakeFlags = [ "-DLIBRETRO=ON -DUSE_SYSTEM_FFMPEG=ON -DUSE_SYSTEM_SNAPPY=ON -DUSE_SYSTEM_LIBZIP=ON -DOpenGL_GL_PREFERENCE=GLVND" ];
postBuild = "mv lib/ppsspp_libretro${stdenv.hostPlatform.extensions.sharedLibrary} ppsspp_libretro${stdenv.hostPlatform.extensions.sharedLibrary}";
cmakeFlags = [
"-DLIBRETRO=ON"
"-DUSE_SYSTEM_FFMPEG=ON"
"-DUSE_SYSTEM_SNAPPY=ON"
"-DUSE_SYSTEM_LIBZIP=ON"
"-DOpenGL_GL_PREFERENCE=GLVND"
];
postBuild = "cd lib";
};

prboom = mkLibRetroCore {
Expand Down Expand Up @@ -811,8 +799,15 @@ in
description = "Optimized port/rewrite of SNES9x 1.43 to Libretro";
license = "Non-commercial";
makefile = "Makefile";
};

snes9x2005-plus = mkLibRetroCore {
core = "snes9x2005-plus";
src = getCoreSrc "snes9x2005";
description = "Optimized port/rewrite of SNES9x 1.43 to Libretro, with Blargg's APU";
license = "Non-commercial";
makefile = "Makefile";
makeFlags = [ "USE_BLARGG_APU=1" ];
postBuild = "mv snes9x2005_plus_libretro${stdenv.hostPlatform.extensions.sharedLibrary} snes9x2005_libretro${stdenv.hostPlatform.extensions.sharedLibrary}";
};
Comment on lines +804 to 811
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snes9x2005 with USE_BLARGG_APU results on snes9x2005-plus (that was what we previously called snes9x2005). So this just fixes it, and add a proper snes9x2005 (without the USE_BLARGG_APU set).


snes9x2010 = mkLibRetroCore {
Expand Down Expand Up @@ -847,7 +842,6 @@ in
cmakeFlags = [
"-DBUILD_LIBRETRO_CORE=ON"
];
postPatch = "mkdir -p src/duckstation-libretro";
};

tgbdual = mkLibRetroCore {
Expand All @@ -863,7 +857,7 @@ in
license = lib.licenses.gpl3Only;
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
postBuild = "cd src/";
postBuild = "cd src";
};

tic80 = mkLibRetroCore {
Expand Down Expand Up @@ -917,7 +911,7 @@ in
description = "Port of Yabause to libretro";
license = lib.licenses.gpl2Only;
makefile = "Makefile";
# Disable SSE for non-x86. DYNAREC doesn't build on either Aarch64 or x86_64.
# Disable SSE for non-x86. DYNAREC doesn't build on aarch64.
makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "HAVE_SSE=0";
preBuild = "cd yabause/src/libretro";
};
Expand Down
11 changes: 5 additions & 6 deletions pkgs/misc/emulators/retroarch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,22 @@
with lib;

let
mainVersion = "1.9.13";
revision = "2";
version = "1.9.14";
libretroSuperSrc = fetchFromGitHub {
owner = "libretro";
repo = "libretro-core-info";
sha256 = "sha256-jM+iXNSCpJy4wOk1S72G1UjNGBzejyhs5LFFWCFjs2c=";
rev = "v${mainVersion}";
sha256 = "sha256-C2PiBcN5r9NDxFWFE1pytSGR1zq9E5aVt6QUf5aJ7I0=";
rev = "v${version}";
};
in
stdenv.mkDerivation rec {
pname = "retroarch-bare";
version = "${lib.concatStringsSep "." [ mainVersion revision ]}";
inherit version;

src = fetchFromGitHub {
owner = "libretro";
repo = "RetroArch";
sha256 = "sha256-fehHchn+o9QM2wIK6zYamnbFvQda32Gw0rJk8Orx00U=";
sha256 = "sha256-H2fCA1sM8FZfVnLxBjnKe7RjHJNAn/Antxlos5oFFSY=";
rev = "v${version}";
};

Expand Down
Loading