2018-09-06 19:40:16 +00:00
|
|
|
{ stdenv, lib, makeWrapper, buildEnv, kodi, plugins }:
|
2015-01-19 21:14:36 +00:00
|
|
|
|
2019-04-11 18:06:06 +00:00
|
|
|
let
|
|
|
|
drvName = builtins.parseDrvName kodi.name;
|
|
|
|
in buildEnv {
|
|
|
|
name = "${drvName.name}-with-plugins-${drvName.version}";
|
2015-01-19 21:14:36 +00:00
|
|
|
|
2018-09-06 19:40:16 +00:00
|
|
|
paths = [ kodi ] ++ plugins;
|
|
|
|
pathsToLink = [ "/share" ];
|
2015-01-19 21:14:36 +00:00
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
2018-09-06 19:40:16 +00:00
|
|
|
postBuild = ''
|
|
|
|
mkdir $out/bin
|
|
|
|
for exe in kodi{,-standalone}
|
2015-01-19 21:14:36 +00:00
|
|
|
do
|
2018-09-06 19:40:16 +00:00
|
|
|
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
2018-09-06 19:40:19 +00:00
|
|
|
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath plugins} \
|
2018-10-29 20:23:17 +00:00
|
|
|
--prefix KODI_HOME : $out/share/kodi \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
|
|
|
|
(stdenv.lib.concatMap
|
|
|
|
(plugin: plugin.extraRuntimeDependencies) plugins)}"
|
2018-09-06 19:40:16 +00:00
|
|
|
done
|
2015-01-19 21:14:36 +00:00
|
|
|
'';
|
|
|
|
|
2018-09-06 19:40:16 +00:00
|
|
|
meta = kodi.meta // {
|
|
|
|
description = kodi.meta.description
|
|
|
|
+ " (with plugins: ${lib.concatMapStringsSep ", " (x: x.name) plugins})";
|
2015-01-19 21:14:36 +00:00
|
|
|
};
|
2015-11-30 22:00:09 +00:00
|
|
|
}
|