Skip to content

Commit

Permalink
retroarch-bare: hardcode assets and core info
Browse files Browse the repository at this point in the history
This is kind of a revert from the changes in
fbab0d0.

The reason for this is because when you open a content and close it
(using `F1` -> `Close content`), RetroArch will reload the configs but
will ignore `--appendconfig`. This definitely looks like a bug, but
hardcoding the values works.

Fix #257114 and #348881.
  • Loading branch information
thiagokokada committed Nov 23, 2024
1 parent 7485cd8 commit 62c34de
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions pkgs/by-name/re/retroarch-bare/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
symlinkJoin,
# params
enableNvidiaCgToolkit ? false,
withAssets ? true,
withCoreInfo ? true,
withGamemode ? stdenv.hostPlatform.isLinux,
withVulkan ? stdenv.hostPlatform.isLinux,
withWayland ? stdenv.hostPlatform.isLinux,
Expand All @@ -72,6 +74,16 @@ stdenv.mkDerivation rec {
qt5.wrapQtAppsHook
] ++ lib.optional withWayland wayland ++ lib.optional (runtimeLibs != [ ]) makeWrapper;

preBuild =
lib.optionalString withCoreInfo ''
substituteInPlace configuration.c \
--replace-fail 'path_libretro_info, false, NULL, true' 'path_libretro_info, false, NULL, false'
''
+ lib.optionalString withAssets ''
substituteInPlace configuration.c \
--replace-fail 'directory_assets, true, NULL, true' 'directory_assets, true, NULL, false'
'';

buildInputs =
[
ffmpeg
Expand Down Expand Up @@ -117,8 +129,14 @@ stdenv.mkDerivation rec {
"--enable-systemmbedtls"
"--disable-builtinzlib"
"--disable-builtinflac"
]
++ lib.optionals withAssets [
"--disable-update_assets"
"--with-assets_dir=${retroarch-assets}/share"
]
++ lib.optionals withCoreInfo [
"--disable-update_core_info"
"--with-core_info_dir=${libretro-core-info}/share"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"--enable-dbus"
Expand Down Expand Up @@ -162,9 +180,7 @@ stdenv.mkDerivation rec {
cores
;
settings = {
assets_directory = "${retroarch-assets}/share/retroarch/assets";
joypad_autoconfig_dir = "${retroarch-joypad-autoconfig}/share/libretro/autoconfig";
libretro_info_path = "${libretro-core-info}/share/retroarch/cores";
} // settings;
};
};
Expand Down

0 comments on commit 62c34de

Please sign in to comment.