kodi: introduce kodi.withPackages to replace kodiPackages.kodiWithAddons

This commit is contained in:
Aaron Andersen 2021-03-10 08:16:10 -05:00
parent 587a8b2837
commit ce0621ec4f
3 changed files with 20 additions and 13 deletions

View file

@ -0,0 +1,14 @@
{ callPackage, ... } @ args:
let
unwrapped = callPackage ./unwrapped.nix (removeAttrs args [ "callPackage" ]);
kodiPackages = callPackage ./packages.nix { kodi = unwrapped; };
in
unwrapped.overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // {
packages = kodiPackages;
withPackages = func: callPackage ./wrapper.nix {
kodi = unwrapped;
addons = kodiPackages.requiredKodiAddons (func kodiPackages);
};
};
})

View file

@ -1,9 +1,7 @@
{ lib, makeWrapper, buildEnv, kodi, addons }:
let
drvName = builtins.parseDrvName kodi.name;
in buildEnv {
name = "${drvName.name}-with-addons-${drvName.version}";
buildEnv {
name = "${kodi.name}-env";
paths = [ kodi ] ++ addons;
pathsToLink = [ "/share" ];
@ -22,9 +20,4 @@ in buildEnv {
(plugin: plugin.extraRuntimeDependencies or []) addons)}"
done
'';
meta = kodi.meta // {
description = kodi.meta.description
+ " (with addons: ${lib.concatMapStringsSep ", " (x: x.name) addons})";
};
}

View file

@ -26227,15 +26227,15 @@ in
gtk = gtk2;
};
kodiPackages = recurseIntoAttrs (callPackage ../applications/video/kodi/packages.nix {});
kodiPackages = recurseIntoAttrs (kodi.packages);
kodi = callPackage ../applications/video/kodi/unwrapped.nix { };
kodi = callPackage ../applications/video/kodi { };
kodi-wayland = callPackage ../applications/video/kodi/unwrapped.nix {
kodi-wayland = callPackage ../applications/video/kodi {
useWayland = true;
};
kodi-gbm = callPackage ../applications/video/kodi/unwrapped.nix {
kodi-gbm = callPackage ../applications/video/kodi {
useGbm = true;
};