kodi: wrapper: simplify
This commit is contained in:
@@ -1,54 +1,24 @@
|
|||||||
{ stdenv, lib, makeWrapper, kodi, plugins }:
|
{ stdenv, lib, makeWrapper, buildEnv, kodi, plugins }:
|
||||||
|
|
||||||
let
|
buildEnv {
|
||||||
|
name = "kodi-with-plugins-${(builtins.parseDrvName kodi.name).version}";
|
||||||
|
|
||||||
p = builtins.parseDrvName kodi.name;
|
paths = [ kodi ] ++ plugins;
|
||||||
|
pathsToLink = [ "/share" ];
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
|
|
||||||
name = "kodi-" + p.version;
|
|
||||||
version = p.version;
|
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
buildCommand = ''
|
postBuild = ''
|
||||||
mkdir -p $out/share/kodi/addons
|
mkdir $out/bin
|
||||||
${stdenv.lib.concatMapStrings
|
for exe in kodi{,-standalone}
|
||||||
(plugin: "ln -s ${plugin.out
|
|
||||||
+ plugin.kodiPlugin
|
|
||||||
+ "/" + plugin.namespace
|
|
||||||
} $out/share/kodi/addons/.;") plugins}
|
|
||||||
$(for plugin in ${kodi}/share/kodi/addons/*
|
|
||||||
do
|
do
|
||||||
$(ln -s $plugin/ $out/share/kodi/addons/.)
|
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
||||||
done)
|
--prefix KODI_HOME : $out/share/kodi
|
||||||
$(for share in ${kodi}/share/kodi/*
|
done
|
||||||
do
|
|
||||||
$(ln -s $share $out/share/kodi/.)
|
|
||||||
done)
|
|
||||||
$(for passthrough in icons xsessions applications
|
|
||||||
do
|
|
||||||
ln -s ${kodi}/share/$passthrough $out/share/
|
|
||||||
done)
|
|
||||||
$(for exe in kodi{,-standalone}
|
|
||||||
do
|
|
||||||
makeWrapper ${kodi}/bin/$exe $out/bin/$exe \
|
|
||||||
--prefix KODI_HOME : $out/share/kodi;
|
|
||||||
done)
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preferLocalBuild = true;
|
meta = kodi.meta // {
|
||||||
|
description = kodi.meta.description
|
||||||
meta = with kodi.meta; {
|
+ " (with plugins: ${lib.concatMapStringsSep ", " (x: x.name) plugins})";
|
||||||
inherit license homepage;
|
|
||||||
description = description
|
|
||||||
+ " (with plugins: "
|
|
||||||
+ lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins))
|
|
||||||
+ ")";
|
|
||||||
|
|
||||||
platforms = stdenv.lib.platforms.linux;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user