2021-03-15 08:37:03 +00:00
|
|
|
{ lib, makeWrapper, buildEnv, kodi, addons }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
let
|
|
|
|
# linux distros are supposed to provide pillow and pycryptodome
|
|
|
|
requiredPythonPackages = with kodi.pythonPackages; [ pillow pycryptodome] ++ addons;
|
|
|
|
in
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
buildEnv {
|
|
|
|
name = "${kodi.name}-env";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
paths = [ kodi ] ++ addons;
|
2020-04-24 23:36:52 +00:00
|
|
|
pathsToLink = [ "/share" ];
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
mkdir $out/bin
|
|
|
|
for exe in kodi{,-standalone}
|
|
|
|
do
|
|
|
|
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
2021-03-19 17:17:44 +00:00
|
|
|
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath requiredPythonPackages} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--prefix KODI_HOME : $out/share/kodi \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
|
2021-01-15 22:18:51 +00:00
|
|
|
(lib.concatMap
|
2021-03-15 08:37:03 +00:00
|
|
|
(plugin: plugin.extraRuntimeDependencies or []) addons)}"
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|