1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 07:00:43 +00:00
nixpkgs/pkgs/applications/video/kodi/wrapper.nix

24 lines
607 B
Nix

{ lib, makeWrapper, buildEnv, kodi, addons }:
buildEnv {
name = "${kodi.name}-env";
paths = [ kodi ] ++ addons;
pathsToLink = [ "/share" ];
buildInputs = [ makeWrapper ];
postBuild = ''
mkdir $out/bin
for exe in kodi{,-standalone}
do
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath addons} \
--prefix KODI_HOME : $out/share/kodi \
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath
(lib.concatMap
(plugin: plugin.extraRuntimeDependencies or []) addons)}"
done
'';
}