Skip to content

Commit

Permalink
kdeFrameworks, plasma5: fix setup hooks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ttuegel committed Jun 22, 2017
1 parent f571ad4 commit 0030c66
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 22 deletions.
31 changes: 20 additions & 11 deletions pkgs/desktops/plasma-5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,26 @@ let

propagate = out:
let setupHook = { writeScript }:
writeScript "setup-hook.sh" ''
# Propagate $${out} output
propagatedUserEnvPkgs+=" @${out}@"
# Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output
if [ "$outputDev" != out ]; then
if [ -n "$crossConfig" ]; then
propagatedBuildInputs+=" @dev@"
else
propagatedNativeBuildInputs+=" @dev@"
writeScript "setup-hook" ''
if [ "$hookName" != postHook ]; then
postHooks+=("source @dev@/nix-support/setup-hook")
else
# Propagate $${out} output
propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
if [ -z "$outputDev" ]; then
echo "error: \$outputDev is unset!" >&2
exit 1
fi
# Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output
if [ "$outputDev" != out ]; then
if [ -n "$crossConfig" ]; then
propagatedBuildInputs="$propagatedBuildInputs @dev@"
else
propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
fi
fi
fi
'';
Expand Down
31 changes: 20 additions & 11 deletions pkgs/development/libraries/kde-frameworks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,26 @@ let

propagate = out:
let setupHook = { writeScript }:
writeScript "setup-hook.sh" ''
# Propagate $${out} output
propagatedUserEnvPkgs+=" @${out}@"
# Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output
if [ "$outputDev" != out ]; then
if [ -n "$crossConfig" ]; then
propagatedBuildInputs+=" @dev@"
else
propagatedNativeBuildInputs+=" @dev@"
writeScript "setup-hook" ''
if [ "$hookName" != postHook ]; then
postHooks+=("source @dev@/nix-support/setup-hook")
else
# Propagate $${out} output
propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
if [ -z "$outputDev" ]; then
echo "error: \$outputDev is unset!" >&2
exit 1
fi
# Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output
if [ "$outputDev" != out ]; then
if [ -n "$crossConfig" ]; then
propagatedBuildInputs="$propagatedBuildInputs @dev@"
else
propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
fi
fi
fi
'';
Expand Down

0 comments on commit 0030c66

Please sign in to comment.