From 3a321906d17b230a3f5803e5bbc6bb6e4ff4e2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edward=20Tj=C3=B6rnhammar?= Date: Mon, 19 Jan 2015 22:14:37 +0100 Subject: [PATCH] Add Kodi retroarch launchers --- .../retroarch/kodi-advanced-launchers.nix | 39 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix diff --git a/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix b/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix new file mode 100644 index 000000000000..38b8e27db7d9 --- /dev/null +++ b/pkgs/misc/emulators/retroarch/kodi-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 kodi" & + nohup sh -c "${exec} '$@' -f;pkill -SIGCONT kodi" + ''; + scriptSh = exec: pkgs.writeScript ("kodi-"+exec.name) (script exec.path); + execs = map (core: rec { name = core.core; path = core+"/bin/retroarch-"+name;}) cores; + +in + +stdenv.mkDerivation rec { + name = "kodi-retroarch-advanced-launchers-${version}"; + version = "0.2"; + + dontBuild = true; + + buildCommand = '' + mkdir -p $out/bin + ${stdenv.lib.concatMapStrings (exec: "ln -s ${scriptSh exec} $out/bin/kodi-${exec.name};") execs} + ''; + + meta = { + description = "Kodi retroarch advanced launchers"; + longDescription = '' + These retroarch launchers are intended to be used with + anglescry advanced launcher for Kodi since device input is + caught by both Kodi and the retroarch process. + ''; + license = stdenv.lib.licenses.gpl3; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 527d72b3e2d9..db8bc95c79ef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11591,6 +11591,11 @@ let cores = retroArchCores; }; + kodi-retroarch-advanced-launchers = + callPackage ../misc/emulators/retroarch/kodi-advanced-launchers.nix { + cores = retroArchCores; + }; + xca = callPackage ../applications/misc/xca { }; xcalib = callPackage ../tools/X11/xcalib { };