From 88d69df250a546952666ead4068d400446cfec84 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 6 Sep 2018 19:40:16 +0000 Subject: kodi: wrapper: simplify --- pkgs/applications/video/kodi/wrapper.nix | 58 ++++++++------------------------ 1 file changed, 14 insertions(+), 44 deletions(-) (limited to 'pkgs/applications/video/kodi') diff --git a/pkgs/applications/video/kodi/wrapper.nix b/pkgs/applications/video/kodi/wrapper.nix index e6d3fbb090fc..27a7a9d34662 100644 --- a/pkgs/applications/video/kodi/wrapper.nix +++ b/pkgs/applications/video/kodi/wrapper.nix @@ -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; - -in - -stdenv.mkDerivation { - - name = "kodi-" + p.version; - version = p.version; + paths = [ kodi ] ++ plugins; + pathsToLink = [ "/share" ]; buildInputs = [ makeWrapper ]; - buildCommand = '' - mkdir -p $out/share/kodi/addons - ${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 + postBuild = '' + mkdir $out/bin + for exe in kodi{,-standalone} 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) + makeWrapper ${kodi}/bin/$exe $out/bin/$exe \ + --prefix KODI_HOME : $out/share/kodi + done ''; - preferLocalBuild = true; - - meta = with kodi.meta; { - inherit license homepage; - description = description - + " (with plugins: " - + lib.concatStrings (lib.intersperse ", " (map (x: ""+x.name) plugins)) - + ")"; - - platforms = stdenv.lib.platforms.linux; + meta = kodi.meta // { + description = kodi.meta.description + + " (with plugins: ${lib.concatMapStringsSep ", " (x: x.name) plugins})"; }; - } -- cgit 1.4.1