nixpkgs/pkgs/applications/video/kodi/wrapper.nix

29 lines
784 B
Nix
Raw Normal View History

2021-03-10 01:53:45 +00:00
{ lib, makeWrapper, buildEnv, kodi, addons }:
let
# linux distros are supposed to provide pillow and pycryptodome
requiredPythonPackages = with kodi.pythonPackages; [ pillow pycryptodome] ++ addons;
in
buildEnv {
name = "${kodi.name}-env";
2021-03-10 01:53:45 +00:00
paths = [ kodi ] ++ addons;
2018-09-06 20:40:16 +01:00
pathsToLink = [ "/share" ];
buildInputs = [ makeWrapper ];
2018-09-06 20:40:16 +01:00
postBuild = ''
mkdir $out/bin
for exe in kodi{,-standalone}
do
2018-09-06 20:40:16 +01:00
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath requiredPythonPackages} \
--prefix KODI_HOME : $out/share/kodi \
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
2021-01-15 05:42:41 +00:00
(lib.concatMap
2021-03-10 01:53:45 +00:00
(plugin: plugin.extraRuntimeDependencies or []) addons)}"
2018-09-06 20:40:16 +01:00
done
'';
}