kdeWrapper: avoid excessive file collisions

This commit is contained in:
Thomas Tuegel 2016-08-04 10:40:36 -05:00
parent c291485b74
commit 5b008e30b4
2 changed files with 13 additions and 8 deletions

View File

@ -5,7 +5,7 @@ drv: pkgs:
stdenv.mkDerivation {
name = "kde-env-${drv.name}";
nativeBuildInputs = [ lndir ];
propagatedUserEnvPkgs = builtins.map lib.getBin ([drv] ++ pkgs);
envPkgs = builtins.map lib.getBin ([drv] ++ pkgs);
unpackPhase = "true";
configurePhase = "runHook preConfigure; runHook postConfigure";
buildPhase = "true";
@ -13,7 +13,7 @@ stdenv.mkDerivation {
runHook preInstall
propagated=""
for i in $propagatedUserEnvPkgs; do
for i in $envPkgs; do
findInputs $i propagated propagated-user-env-packages
done
@ -26,6 +26,15 @@ stdenv.mkDerivation {
done
done
for p in $propagated; do
for s in applications dbus-1 desktop-directories icons mime polkit-1; do
if [ -d "$p/share/$s" ]; then
propagatedUserEnvPkgs+=" $p"
break
fi
done
done
runHook postInstall
'';
}

View File

@ -37,11 +37,7 @@ stdenv.mkDerivation {
fi
done
for s in applications dbus-1 desktop-directories icons mime polkit-1; do
if [ -d "$env/share/$s" ]; then
mkdir -p "$out/share"
ln -s "$env/share/$s" "$out/share/$s"
fi
done
mkdir -p "$out/nix-support"
ln -s "$env/nix-support/propagated-user-env-packages" "$out/nix-support/"
'';
}