summaryrefslogtreecommitdiff
path: root/.gitlab
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-12-10 13:12:17 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-16 19:33:01 -0500
commitcc6280885f15c00703c4fc8305f6d47747910fc2 (patch)
tree650eb8b84c7633382f81fdaebd424544d8eed89e /.gitlab
parentac25a3f637d894e9b972600e8942a91570e2dcd0 (diff)
downloadhaskell-cc6280885f15c00703c4fc8305f6d47747910fc2.tar.gz
gitlab-ci: Another approach for xz detection
Diffstat (limited to '.gitlab')
-rwxr-xr-x.gitlab/prepare-system.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/.gitlab/prepare-system.sh b/.gitlab/prepare-system.sh
index a8eabe2678..4180e6029c 100755
--- a/.gitlab/prepare-system.sh
+++ b/.gitlab/prepare-system.sh
@@ -13,7 +13,24 @@ if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
if [[ -z ${BUILD_FLAVOUR:-} ]]; then BUILD_FLAVOUR=perf; fi
-if [[ -z ${XZ:-} ]]; then XZ=pxz; fi
+
+if [[ -z ${XZ:-} ]]; then
+ if which pxz; then
+ XZ="pxz"
+ elif which xz; then
+ # Check whether --threads is supported
+ if echo "hello" | xz --threads=$CORES >/dev/null; then
+ XZ="xz --threads=$CORES"
+ else
+ XZ="xz"
+ fi
+ else
+ echo "error: neither pxz nor xz were found"
+ exit 1
+ fi
+fi
+echo "Using $XZ for compression..."
+
cat > mk/build.mk <<EOF
V=1