2021-11-20 01:24:41 +01:00
|
|
|
{ stdenv, pkgs, lib, runtimeShell, cores ? [ ] }:
|
2015-01-19 22:14:37 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
script = exec: ''
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2017-06-09 20:40:12 +02:00
|
|
|
nohup sh -c "pkill -SIGTSTP kodi" &
|
|
|
|
# https://forum.kodi.tv/showthread.php?tid=185074&pid=1622750#pid1622750
|
|
|
|
nohup sh -c "sleep 10 && ${exec} '$@' -f;pkill -SIGCONT kodi"
|
2015-01-19 22:14:37 +01:00
|
|
|
'';
|
|
|
|
scriptSh = exec: pkgs.writeScript ("kodi-"+exec.name) (script exec.path);
|
|
|
|
execs = map (core: rec { name = core.core; path = core+"/bin/retroarch-"+name;}) cores;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "kodi-retroarch-advanced-launchers";
|
2015-01-19 22:14:37 +01:00
|
|
|
version = "0.2";
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
2021-01-15 14:21:58 +01:00
|
|
|
${lib.concatMapStrings (exec: "ln -s ${scriptSh exec} $out/bin/kodi-${exec.name};") execs}
|
2015-01-19 22:14:37 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Kodi retroarch advanced launchers";
|
|
|
|
longDescription = ''
|
|
|
|
These retroarch launchers are intended to be used with
|
2017-06-09 20:40:12 +02:00
|
|
|
advanced (emulation) launcher for Kodi since device input is
|
|
|
|
otherwise caught by both Kodi and the retroarch process.
|
2015-01-19 22:14:37 +01:00
|
|
|
'';
|
2021-01-15 14:21:58 +01:00
|
|
|
license = lib.licenses.gpl3;
|
2015-01-19 22:14:37 +01:00
|
|
|
};
|
|
|
|
}
|