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 }: { lib, makeWrapper, buildEnv, kodi, addons }:
let buildEnv {
drvName = builtins.parseDrvName kodi.name; name = "${kodi.name}-env";
in buildEnv {
name = "${drvName.name}-with-addons-${drvName.version}";
paths = [ kodi ] ++ addons; paths = [ kodi ] ++ addons;
pathsToLink = [ "/share" ]; pathsToLink = [ "/share" ];
@ -22,9 +20,4 @@ in buildEnv {
(plugin: plugin.extraRuntimeDependencies or []) addons)}" (plugin: plugin.extraRuntimeDependencies or []) addons)}"
done 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; 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; useWayland = true;
}; };
kodi-gbm = callPackage ../applications/video/kodi/unwrapped.nix { kodi-gbm = callPackage ../applications/video/kodi {
useGbm = true; useGbm = true;
}; };