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

31 lines
863 B
Nix
Raw Normal View History

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