Skip to content

Commit

Permalink
retroarch: add withCores helper
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Nov 23, 2024
1 parent 2bf2bb9 commit d53fcbe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions pkgs/by-name/re/retroarch-bare/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
wayland-scanner,
zlib,
# wrapper deps
libretro,
libretro-core-info,
retroarch-assets,
retroarch-bare,
Expand Down Expand Up @@ -153,6 +154,7 @@ stdenv.mkDerivation rec {
import ./wrapper.nix {
inherit
lib
libretro
makeWrapper
retroarch-bare
runCommand
Expand Down
2 changes: 2 additions & 0 deletions pkgs/by-name/re/retroarch-bare/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
libretro,
makeWrapper,
retroarch-bare,
runCommand,
Expand Down Expand Up @@ -45,6 +46,7 @@ symlinkJoin {
passthru = {
inherit cores;
unwrapped = retroarch-bare;
withCores = coreFun: retroarch-bare.wrapper { cores = (coreFun libretro); };
};

postBuild = ''
Expand Down
18 changes: 9 additions & 9 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1454,18 +1454,18 @@ 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 { });

wrapRetroArch = retroarch-bare.wrapper;
retroarch = retroarch-bare.wrapper { };

retroarch = retroarch-bare.wrapper;
retroarch-full = retroarch.withCores (
cores:
builtins.filter
(c: (c ? libretroCore) && (lib.meta.availableOn stdenv.hostPlatform c))
(builtins.attrValues cores)
);

libretro = recurseIntoAttrs (callPackage ../applications/emulators/retroarch/cores.nix { });
wrapRetroArch = retroarch-bare.wrapper;

# Aliases kept here because they are easier to use
x16-emulator = x16.emulator;
Expand Down

0 comments on commit d53fcbe

Please sign in to comment.