From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:58636) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0MPc-0006fW-9G for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0MPb-0005HW-2F for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0MPa-0005HI-Uu for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:11 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0MPa-0006Yl-PT for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:10 -0400 Subject: [bug#36477] [PATCH v2 12/61] gnu: cmake: Fix cross-compilation. Resent-Message-ID: From: Mathieu Othacehe Date: Wed, 21 Aug 2019 10:54:06 +0200 Message-Id: <20190821085455.18508-12-m.othacehe@gmail.com> In-Reply-To: <20190821085455.18508-1-m.othacehe@gmail.com> References: <20190821085455.18508-1-m.othacehe@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36477@debbugs.gnu.org Cc: Mathieu Othacehe * 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)))) + (define-public emacs-cmake-mode (package (inherit cmake) diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index ca88fadddf..aa0f4187ec 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -43,16 +43,19 @@ `((guix build cmake-build-system) ,@%gnu-build-system-modules)) -(define (default-cmake) +(define (default-cmake target) "Return the default CMake package." ;; Do not use `@' to avoid introducing circular dependencies. (let ((module (resolve-interface '(gnu packages cmake)))) - (module-ref module 'cmake-minimal))) + (module-ref module + (if target + 'cmake-minimal-cross + 'cmake-minimal)))) (define* (lower name #:key source inputs native-inputs outputs system target - (cmake (default-cmake)) + (cmake (default-cmake target)) #:allow-other-keys #:rest arguments) "Return a bag for NAME." -- 2.17.1