summary refs log tree commit diff
path: root/pkgs/desktops/plasma-5/default.nix
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2017-06-22 17:28:15 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2017-06-22 17:46:44 -0500
commit0030c6610353b3706fe77d4cce06f1905a4aec43 (patch)
tree68fa3a701b038c016bcf349cfa6eb3e23ba2adc7 /pkgs/desktops/plasma-5/default.nix
parentf571ad45955c21ac5b44820231d4c07867ac3564 (diff)
downloadnixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar.gz
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar.bz2
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar.lz
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar.xz
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.tar.zst
nixpkgs-0030c6610353b3706fe77d4cce06f1905a4aec43.zip
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.
Diffstat (limited to 'pkgs/desktops/plasma-5/default.nix')
-rw-r--r--pkgs/desktops/plasma-5/default.nix31
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix
index e101d4e14c5..a592a623510 100644
--- a/pkgs/desktops/plasma-5/default.nix
+++ b/pkgs/desktops/plasma-5/default.nix
@@ -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
               '';