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 { stdenv.mkDerivation {
name = "kde-env-${drv.name}"; name = "kde-env-${drv.name}";
nativeBuildInputs = [ lndir ]; nativeBuildInputs = [ lndir ];
propagatedUserEnvPkgs = builtins.map lib.getBin ([drv] ++ pkgs); envPkgs = builtins.map lib.getBin ([drv] ++ pkgs);
unpackPhase = "true"; unpackPhase = "true";
configurePhase = "runHook preConfigure; runHook postConfigure"; configurePhase = "runHook preConfigure; runHook postConfigure";
buildPhase = "true"; buildPhase = "true";
@ -13,7 +13,7 @@ stdenv.mkDerivation {
runHook preInstall runHook preInstall
propagated="" propagated=""
for i in $propagatedUserEnvPkgs; do for i in $envPkgs; do
findInputs $i propagated propagated-user-env-packages findInputs $i propagated propagated-user-env-packages
done done
@ -26,6 +26,15 @@ stdenv.mkDerivation {
done done
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 runHook postInstall
''; '';
} }

View File

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