kdeFrameworks, plasma5: fix setup hooks

The setup hooks for many kdeFrameworks and plasma5 packages were erroneously
running before $outputDev was set. This lead to .dev outputs being propagated
into the user environment.

+38 -20
+19 -10
pkgs/desktops/plasma-5/default.nix
··· 43 44 propagate = out: 45 let setupHook = { writeScript }: 46 - writeScript "setup-hook.sh" '' 47 - # Propagate $${out} output 48 - propagatedUserEnvPkgs+=" @${out}@" 49 50 - # Propagate $dev so that this setup hook is propagated 51 - # But only if there is a separate $dev output 52 - if [ "$outputDev" != out ]; then 53 - if [ -n "$crossConfig" ]; then 54 - propagatedBuildInputs+=" @dev@" 55 - else 56 - propagatedNativeBuildInputs+=" @dev@" 57 fi 58 fi 59 '';
··· 43 44 propagate = out: 45 let setupHook = { writeScript }: 46 + writeScript "setup-hook" '' 47 + if [ "$hookName" != postHook ]; then 48 + postHooks+=("source @dev@/nix-support/setup-hook") 49 + else 50 + # Propagate $${out} output 51 + propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@" 52 + 53 + if [ -z "$outputDev" ]; then 54 + echo "error: \$outputDev is unset!" >&2 55 + exit 1 56 + fi 57 58 + # Propagate $dev so that this setup hook is propagated 59 + # But only if there is a separate $dev output 60 + if [ "$outputDev" != out ]; then 61 + if [ -n "$crossConfig" ]; then 62 + propagatedBuildInputs="$propagatedBuildInputs @dev@" 63 + else 64 + propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@" 65 + fi 66 fi 67 fi 68 '';
+19 -10
pkgs/development/libraries/kde-frameworks/default.nix
··· 41 42 propagate = out: 43 let setupHook = { writeScript }: 44 - writeScript "setup-hook.sh" '' 45 - # Propagate $${out} output 46 - propagatedUserEnvPkgs+=" @${out}@" 47 48 - # Propagate $dev so that this setup hook is propagated 49 - # But only if there is a separate $dev output 50 - if [ "$outputDev" != out ]; then 51 - if [ -n "$crossConfig" ]; then 52 - propagatedBuildInputs+=" @dev@" 53 - else 54 - propagatedNativeBuildInputs+=" @dev@" 55 fi 56 fi 57 '';
··· 41 42 propagate = out: 43 let setupHook = { writeScript }: 44 + writeScript "setup-hook" '' 45 + if [ "$hookName" != postHook ]; then 46 + postHooks+=("source @dev@/nix-support/setup-hook") 47 + else 48 + # Propagate $${out} output 49 + propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@" 50 + 51 + if [ -z "$outputDev" ]; then 52 + echo "error: \$outputDev is unset!" >&2 53 + exit 1 54 + fi 55 56 + # Propagate $dev so that this setup hook is propagated 57 + # But only if there is a separate $dev output 58 + if [ "$outputDev" != out ]; then 59 + if [ -n "$crossConfig" ]; then 60 + propagatedBuildInputs="$propagatedBuildInputs @dev@" 61 + else 62 + propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@" 63 + fi 64 fi 65 fi 66 '';