git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit0030c6610353b3706fe77d4cce06f1905a4aec43 authorThomas Tuegel <ttuegel@mailbox.org> dateThu 22 Jun 2017, 17:28 (9 years ago) parentf571ad4
2 files changed+40−22
pkgs/desktops/plasma-5/default.nix+20−11 pkgs/development/libraries/kde-frameworks/default.nix+20−11
pkgs/desktops/plasma-5/default.nix+20−11
@@ -43,17 +43,26 @@ let
4343
4444 propagate = out:
4545 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@"
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
5766 fi
5867 fi
5968 '';
pkgs/development/libraries/kde-frameworks/default.nix+20−11
@@ -41,17 +41,26 @@ let
4141
4242 propagate = out:
4343 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@"
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
5564 fi
5665 fi
5766 '';