vimUtils.packdir: only include python3 if needed

`makeCustomizable` can be called on vim derivations that don't depend on
python, so avoid including python3 in the environment if there are no python3
dependencies.
This commit is contained in:
Naïm Favier 2022-12-02 16:21:52 +01:00
parent 3dc19ce82d
commit cda13fae03
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325

View File

@ -186,9 +186,9 @@ let
depsOfOptionalPlugins = lib.subtractLists opt (findDependenciesRecursively opt);
startWithDeps = findDependenciesRecursively start;
allPlugins = lib.unique (startWithDeps ++ depsOfOptionalPlugins);
python3Env = python3.withPackages (ps:
lib.flatten (builtins.map (plugin: (plugin.python3Dependencies or (_: [])) ps) allPlugins)
);
allPython3Dependencies = ps:
lib.flatten (builtins.map (plugin: (plugin.python3Dependencies or (_: [])) ps) allPlugins);
python3Env = python3.withPackages allPython3Dependencies;
packdirStart = vimFarm "pack/${packageName}/start" "packdir-start" allPlugins;
packdirOpt = vimFarm "pack/${packageName}/opt" "packdir-opt" opt;
@ -201,7 +201,7 @@ let
ln -s ${python3Env}/${python3Env.sitePackages} $out/pack/${packageName}/start/__python3_dependencies/python3
'';
in
[ packdirStart packdirOpt python3link ];
[ packdirStart packdirOpt ] ++ lib.optional (allPython3Dependencies python3.pkgs != []) python3link;
in
buildEnv {
name = "vim-pack-dir";