From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEAVc-0003Tp-76 for guix-patches@gnu.org; Fri, 26 May 2017 04:22:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEAVW-0000TF-ID for guix-patches@gnu.org; Fri, 26 May 2017 04:22:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:35913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEAVW-0000TA-Eg for guix-patches@gnu.org; Fri, 26 May 2017 04:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dEAVW-0003vW-6M for guix-patches@gnu.org; Fri, 26 May 2017 04:22:02 -0400 Subject: bug#27076: [PATCH] build-system/cmake: Add support for cross compilation. Resent-Message-ID: References: <20170525212655.18556-1-rekado@elephly.net> From: Ricardo Wurmus In-reply-to: <20170525212655.18556-1-rekado@elephly.net> Date: Fri, 26 May 2017 10:21:05 +0200 Message-ID: <87r2zcf2q6.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: 27076@debbugs.gnu.org Ricardo Wurmus writes: > diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm > index 25ac262d5..ee116c5a4 100644 > --- a/guix/build-system/cmake.scm > +++ b/guix/build-system/cmake.scm […] > + (bag > + (name name) > + (system system) > + (target target) > + (build-inputs `(,@(if source > + `(("source" ,source)) > + '()) > + ,@`(("cmake" ,cmake)) > + ,@native-inputs > + ,@(if target > + ;; Use the standard cross inputs of > + ;; 'gnu-build-system'. > + (standard-cross-packages target 'host) > + '()) > + ;; Keep the standard inputs of 'gnu-build-system'. > + ,@(standard-packages))) > + (host-inputs inputs) > + > + ;; The cross-libc is really a target package, but for bootstrapping > + ;; reasons, we can't put it in 'host-inputs'. Namely, 'cross-gcc' is a > + ;; native package, so it would end up using a "native" variant of > + ;; 'cross-libc' (built with 'gnu-build'), whereas all the other packages > + ;; would use a target variant (built with 'gnu-cross-build'.) > + (target-inputs (if target > + (standard-cross-packages target 'target) > + '())) This was the only change compared to the previous patch, which would set “target-inputs” without checking if “target” is provided. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net