mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
Merge pull request #244339 from bjornfor/retroarch-auto-detect-joypads
retroarch: auto-detect joypads
This commit is contained in:
commit
da865b2b9e
@ -0,0 +1,28 @@
|
||||
{ lib
|
||||
, stdenvNoCC
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "retroarch-joypad-autoconfig";
|
||||
version = "1.15.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libretro";
|
||||
repo = "retroarch-joypad-autoconfig";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-/F2Y08uDA/pIIeLiLfOQfGVjX2pkuOqPourlx2RbZ28=";
|
||||
};
|
||||
|
||||
makeFlags = [
|
||||
"PREFIX=$(out)"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Joypad autoconfig files";
|
||||
homepage = "https://www.libretro.com/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; teams.libretro.members ++ [ ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
@ -3,16 +3,28 @@
|
||||
, makeWrapper
|
||||
, retroarch
|
||||
, symlinkJoin
|
||||
, runCommand
|
||||
, cores ? [ ]
|
||||
, settings ? { }
|
||||
}:
|
||||
|
||||
let
|
||||
settingsPath = runCommand "declarative-retroarch.cfg"
|
||||
{
|
||||
value = lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n} = \"${v}\"") settings);
|
||||
passAsFile = [ "value" ];
|
||||
}
|
||||
''
|
||||
cp "$valuePath" "$out"
|
||||
'';
|
||||
|
||||
# All cores should be located in the same path after symlinkJoin,
|
||||
# but let's be safe here
|
||||
coresPath = lib.lists.unique (map (c: c.libretroCore) cores);
|
||||
wrapperArgs = lib.strings.escapeShellArgs
|
||||
(lib.lists.flatten
|
||||
(map (p: [ "--add-flags" "-L ${placeholder "out" + p}" ]) coresPath));
|
||||
wrapperArgs = lib.strings.escapeShellArgs (
|
||||
(lib.lists.flatten (map (p: [ "--add-flags" "-L ${placeholder "out" + p}" ]) coresPath))
|
||||
++ [ "--add-flags" "--appendconfig=${settingsPath}" ]
|
||||
);
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "retroarch-with-cores-${lib.getVersion retroarch}";
|
||||
|
@ -2644,19 +2644,24 @@ with pkgs;
|
||||
(builtins.attrValues libretro);
|
||||
};
|
||||
|
||||
wrapRetroArch = { retroarch }:
|
||||
wrapRetroArch = { retroarch, settings ? {} }:
|
||||
callPackage ../applications/emulators/retroarch/wrapper.nix
|
||||
{ inherit retroarch; };
|
||||
{ inherit retroarch settings; };
|
||||
|
||||
retroarch = wrapRetroArch {
|
||||
retroarch = retroarchBare.override {
|
||||
withAssets = true;
|
||||
withCoreInfo = true;
|
||||
};
|
||||
settings = {
|
||||
joypad_autoconfig_dir = "${retroarch-joypad-autoconfig}/share/libretro/autoconfig";
|
||||
};
|
||||
};
|
||||
|
||||
retroarch-assets = callPackage ../applications/emulators/retroarch/retroarch-assets.nix { };
|
||||
|
||||
retroarch-joypad-autoconfig = callPackage ../applications/emulators/retroarch/retroarch-joypad-autoconfig.nix { };
|
||||
|
||||
libretranslate = with python3.pkgs; toPythonApplication libretranslate;
|
||||
|
||||
libretro = recurseIntoAttrs
|
||||
|
Loading…
Reference in New Issue
Block a user