retroarch: add withCores helper

This commit is contained in:
Thiago Kenji Okada 2024-11-23 11:31:52 +00:00
parent 3c11d3ede1
commit 3aa0725cb3
3 changed files with 14 additions and 10 deletions

View File

@ -37,6 +37,7 @@
wayland-scanner,
zlib,
# wrapper deps
libretro,
libretro-core-info,
retroarch-assets,
retroarch-bare,
@ -153,6 +154,7 @@ stdenv.mkDerivation rec {
import ./wrapper.nix {
inherit
lib
libretro
makeWrapper
retroarch-bare
runCommand

View File

@ -1,5 +1,6 @@
{
lib,
libretro,
makeWrapper,
retroarch-bare,
runCommand,
@ -45,6 +46,7 @@ symlinkJoin {
passthru = {
inherit cores;
unwrapped = retroarch-bare;
withCores = coreFun: retroarch-bare.wrapper { cores = (coreFun libretro); };
};
postBuild = ''

View File

@ -1454,19 +1454,19 @@ with pkgs;
### APPLICATIONS/EMULATORS/RETROARCH
retroarch-full = wrapRetroArch {
cores = builtins.filter
# Remove cores not supported on platform
(c: c ? libretroCore && (lib.meta.availableOn stdenv.hostPlatform c))
(builtins.attrValues libretro);
};
libretro = recurseIntoAttrs (callPackage ../applications/emulators/retroarch/cores.nix { });
retroarch = retroarch-bare.wrapper { };
retroarch-full = retroarch.withCores (
cores:
builtins.filter
(c: (c ? libretroCore) && (lib.meta.availableOn stdenv.hostPlatform c))
(builtins.attrValues cores)
);
wrapRetroArch = retroarch-bare.wrapper;
retroarch = retroarch-bare.wrapper;
libretro = recurseIntoAttrs (callPackage ../applications/emulators/retroarch/cores.nix { });
# Aliases kept here because they are easier to use
x16-emulator = x16.emulator;
x16-rom = x16.rom;