From 84c58abdc4cacdf4cf5a65faff74421bc983f161 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 13 Nov 2020 01:12:37 +0100 Subject: [PATCH] setup.sh: Only load XDG_DATA_DIRS for executable inputs This avoids the scenario where strictDeps is off and cross-compiled XDG_DATA_DIRS content is brought into the environment. While probably harmless for data like manpages and completion scripts, this would cause issues when XDG_DATA_DIRS is used to find executables or plugins. The Qt framework is known to behave like this and might have run into incompatibilities. --- pkgs/stdenv/generic/setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 34405b048ec..6affe2ed2bb 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -485,6 +485,9 @@ activatePackage() { # TODO(@Ericson2314): Don't special-case native compilation if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then addToSearchPath _PATH "$pkg/bin" + fi + + if [[ "$hostOffset" -le -1 ]]; then addToSearchPath _XDG_DATA_DIRS "$pkg/share" fi