From b16fe2e832595fa450b2f85e49e187d3facf3607 Mon Sep 17 00:00:00 2001
From: samuela <skainsworth@gmail.com>
Date: Mon, 20 Jan 2020 17:52:18 +0000
Subject: [PATCH] Only change the path when on macOS

---
 recipes/xz/recipe.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/recipes/xz/recipe.sh b/recipes/xz/recipe.sh
index 1d86fb00f..b82f82407 100644
--- a/recipes/xz/recipe.sh
+++ b/recipes/xz/recipe.sh
@@ -13,12 +13,16 @@ function recipe_update {
 
 function recipe_build {
     export CFLAGS="-static"
-
+    
     # autogen.sh requires autopoint which is provided by the gettext homebrew
     # formula on macOS. Unfortunately, homebrew does not install it into PATH
     # because macOS provides the BSD gettext library. So we make sure to include
-    # it in PATH.
-    PATH="/usr/local/opt/gettext/bin:$PATH" ./autogen.sh
+    # it in PATH, preceding the default BSD version.
+    if [[ "$(uname)" == "Darwin" ]]; then
+        export PATH="/usr/local/opt/gettext/bin:$PATH"
+    fi
+
+    ./autogen.sh
 
     chmod +w build-aux/config.sub
     wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub
-- 
GitLab