diff options
author | Edward Tjörnhammar <ed@cflags.cc> | 2014-10-02 20:09:18 +0200 |
---|---|---|
committer | Edward Tjörnhammar <ed@cflags.cc> | 2014-10-02 20:09:18 +0200 |
commit | 9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19 (patch) | |
tree | 7c6959d2ad37ae204b9d462d97ae3d4ec031c141 /pkgs/misc | |
parent | bee638d269649ed3d15da728318a48cfd95cb001 (diff) | |
download | nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar.gz nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar.bz2 nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar.lz nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar.xz nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.tar.zst nixlib-9d93f9bcda9851586cd75d80a8d9c8e9c07b4a19.zip |
XBMC AdvancedLauncher RetroArch launchers.
These are wrappers for retroarch wrappers, they are needed since launching a process from XBMC(as a display manager and probably otherwise), using AdvancedLauncher, results in it and it's parent recieving the same gamepad input. These wrappers will produce no sound on XBMC and AdvancedLauncher setups not using a sound daemon, since XBMC gets paused while still holding onto the sound device.
Diffstat (limited to 'pkgs/misc')
-rw-r--r-- | pkgs/misc/emulators/retroarch/cores.nix | 5 | ||||
-rw-r--r-- | pkgs/misc/emulators/retroarch/xbmc-advanced-launchers.nix | 39 |
2 files changed, 43 insertions, 1 deletions
diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix index a8b74959d90e..db412eb883de 100644 --- a/pkgs/misc/emulators/retroarch/cores.nix +++ b/pkgs/misc/emulators/retroarch/cores.nix @@ -24,7 +24,10 @@ let --add-flags "-L $COREDIR/${d2u core}_libretro.so $@" ''; - passthru.libretroCore = "/lib/retroarch/cores"; + passthru = { + core = core; + libretroCore = "/lib/retroarch/cores"; + }; meta = with stdenv.lib; { inherit description; diff --git a/pkgs/misc/emulators/retroarch/xbmc-advanced-launchers.nix b/pkgs/misc/emulators/retroarch/xbmc-advanced-launchers.nix new file mode 100644 index 000000000000..ec539cb43f95 --- /dev/null +++ b/pkgs/misc/emulators/retroarch/xbmc-advanced-launchers.nix @@ -0,0 +1,39 @@ +{ stdenv, pkgs, cores }: + +assert cores != []; + +with pkgs.lib; + +let + + script = exec: '' + #!${stdenv.shell} + nohup sh -c "sleep 1 && pkill -SIGSTOP xbmc" & + nohup sh -c "${exec} '$@' -f;pkill -SIGCONT xbmc" + ''; + scriptSh = exec: pkgs.writeScript ("xbmc-"+exec.name) (script exec.path); + execs = map (core: rec { name = core.core; path = core+"/bin/retroarch-"+name;}) cores; + +in + +stdenv.mkDerivation rec { + name = "xbmc-retroarch-advanced-launchers-${version}"; + version = "0.2"; + + dontBuild = true; + + buildCommand = '' + mkdir -p $out/bin + ${stdenv.lib.concatMapStrings (exec: "ln -s ${scriptSh exec} $out/bin/xbmc-${exec.name};") execs} + ''; + + meta = { + description = "XBMC retroarch advanced launchers"; + longDescription = '' + These retroarch launchers are intended to be used with + anglescry advanced launcher for XBMC since device input is + caught by both XBMC and the retroarch process. + ''; + license = "GPL-3"; + }; +} |