2015-01-19 22:14:36 +01:00
|
|
|
{ stdenv, lib, makeWrapper, kodi, plugins }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
p = builtins.parseDrvName kodi.name;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "kodi-" + p.version;
|
|
|
|
version = p.version;
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
2015-11-30 23:00:09 +01:00
|
|
|
mkdir -p $out/share/kodi/addons
|
2015-01-19 22:14:36 +01:00
|
|
|
${stdenv.lib.concatMapStrings
|
|
|
|
(plugin: "ln -s ${plugin.out
|
|
|
|
+ plugin.kodiPlugin
|
|
|
|
+ "/" + plugin.namespace
|
|
|
|
} $out/share/kodi/addons/.;") plugins}
|
|
|
|
$(for plugin in ${kodi}/share/kodi/addons/*
|
|
|
|
do
|
|
|
|
$(ln -s $plugin/ $out/share/kodi/addons/.)
|
|
|
|
done)
|
|
|
|
$(for share in ${kodi}/share/kodi/*
|
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2016-12-14 03:48:20 +01:00
|
|
|
preferLocalBuild = true;
|
2015-01-19 22:14:36 +01:00
|
|
|
|
|
|
|
meta = with kodi.meta; {
|
|
|
|
inherit license homepage;
|
|
|
|
description = description
|
|
|
|
+ " (with plugins: "
|
|
|
|
+ lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins))
|
|
|
|
+ ")";
|
|
|
|
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2015-01-19 22:14:36 +01:00
|
|
|
};
|
|
|
|
|
2015-11-30 23:00:09 +01:00
|
|
|
}
|