Subject: Re: [bug#36477] [PATCH v3 04/48] gnu: cmake: Fix cross-compilation.

From: Ludovic Courtès <[email-masked]>
Date: Wed, 04 Sep 2019 15:00:51 +0200

Mathieu Othacehe <[email-masked]> skribis:

> * gnu/packages/cmake.scm (cmake-minimal-cross): New package.
> * guix/build-system/cmake.scm (default-cmake): Add new target argument and use
> it to select cmake-minimal or cmake-minimal-cross.
> (lower): Pass target to default-cmake.
> ---
>  gnu/packages/cmake.scm      | 8 ++++++++
>  guix/build-system/cmake.scm | 9 ++++++---
>  2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
> index 1d8d829ec5..9bf0273f00 100644
> --- a/gnu/packages/cmake.scm
> +++ b/gnu/packages/cmake.scm
> @@ -207,6 +207,14 @@ and workspaces that can be used in the compiler environment of your choice.")
>      (outputs '("out" "doc"))
>      (properties (alist-delete 'hidden? (package-properties cmake-minimal)))))
>  
> +(define-public cmake-minimal-cross
> +  (package
> +    (inherit cmake-minimal)
> +    (name "cmake-minimal-cross")
> +    (native-search-paths '())
> +    (search-paths
> +     (package-native-search-paths cmake-minimal))))

It seems to be enough to just add ‘search-paths’ to ‘cmake’:

diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 7186cf98df..9f517238a0 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -151,6 +151,7 @@
      (list (search-path-specification
             (variable "CMAKE_PREFIX_PATH")
             (files '("")))))
+    (search-paths native-search-paths)
     (home-page "https://cmake.org/")
     (synopsis "Cross-platform build system")
     (description

… and it doesn’t trigger a full rebuild.

Please push that to ‘master’ if it works for you!

Ludo’.