diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm index f76ee3ff3a..a235d922e0 100644 --- a/gnu/packages/cmake.scm +++ b/gnu/packages/cmake.scm @@ -92,7 +92,7 @@ using the CMake build system.") ;;; Build phases shared between 'cmake-bootstrap' and the later variants ;;; that use cmake-build-system. -(define %common-build-phases +(define (%common-build-phases) `((add-after 'unpack 'split-package ;; Remove files that have been packaged in other package recipes. (lambda _ @@ -100,6 +100,18 @@ using the CMake build system.") (substitute* "Auxiliary/CMakeLists.txt" ((".*cmake-mode.el.*") "")) #t)) + ,@(let ((system (or (%current-target-system) (%current-system)))) + (if (or (string-prefix? "i686-" system) + (string-prefix? "i586-" system)) + '((add-after 'unpack 'clamp-xz-thread-number + (lambda _ + ;; By default, 'CPack' would use as many threads as the + ;; number of available cores for xz compression. + ;; However, this leads to test failures: . + (substitute* "Source/cmArchiveWrite.cxx" + (("case CompressXZ:") + "case CompressXZ: numThreads = 1;\n"))))) + '())) (add-before 'configure 'patch-bin-sh (lambda _ ;; Replace "/bin/sh" by the right path in... a lot of @@ -188,7 +200,7 @@ using the CMake build system.") " --exclude-regex ^\\(" (string-join skipped-tests "\\|") "\\)$"))) #:phases (modify-phases %standard-phases - ,@%common-build-phases + ,@(%common-build-phases) (add-before 'configure 'set-paths (lambda _ ;; Help cmake's bootstrap process to find system libraries @@ -295,7 +307,7 @@ and workspaces that can be used in the compiler environment of your choice.") #:build-type "Release" #:phases (modify-phases %standard-phases - ,@%common-build-phases + ,@(%common-build-phases) (add-after 'install 'delete-help-documentation (lambda* (#:key outputs #:allow-other-keys) (delete-file-recursively