3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/video/kodi/wrapper.nix

31 lines
847 B
Nix
Raw Normal View History

2021-03-10 01:53:45 +00:00
{ lib, makeWrapper, buildEnv, kodi, addons }:
2019-04-11 19:06:06 +01:00
let
drvName = builtins.parseDrvName kodi.name;
in buildEnv {
2021-03-10 01:53:45 +00:00
name = "${drvName.name}-with-addons-${drvName.version}";
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 \
2021-03-10 01:53:45 +00:00
--prefix PYTHONPATH : ${kodi.pythonPackages.makePythonPath addons} \
--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
'';
2018-09-06 20:40:16 +01:00
meta = kodi.meta // {
description = kodi.meta.description
2021-03-10 01:53:45 +00:00
+ " (with addons: ${lib.concatMapStringsSep ", " (x: x.name) addons})";
};
}