From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:51357) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPXqZ-0000eG-F5 for guix-patches@gnu.org; Tue, 29 Oct 2019 16:12:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPXqX-0006fV-8P for guix-patches@gnu.org; Tue, 29 Oct 2019 16:12:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39825) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPXqW-0006eK-1z for guix-patches@gnu.org; Tue, 29 Oct 2019 16:12:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iPXqV-00058v-Iw for guix-patches@gnu.org; Tue, 29 Oct 2019 16:12:03 -0400 Subject: [bug#37870] [PATCH v3] gnu: make-nsis: Fix cross-compilation. References: In-Reply-To: Resent-Message-ID: Date: Tue, 29 Oct 2019 20:11:22 +0000 From: Carl Dong Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Carl Dong Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: "37870@debbugs.gnu.org" <37870@debbugs.gnu.org> Updated the patch to address Efraim's suggestion. ----- * gnu/packages/installers.scm (make-nsis)[arguments]: Enforce correct ordering of search paths (mingw-w64 last). --- gnu/packages/installers.scm | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/gnu/packages/installers.scm b/gnu/packages/installers.scm index c987254d61..9229359fdf 100644 --- a/gnu/packages/installers.scm +++ b/gnu/packages/installers.scm @@ -28,7 +28,10 @@ #:use-module (guix utils)) (define (make-nsis machine target-arch nsis-target-type) - (let ((triplet (string-append machine "-" "w64-mingw32"))) + (let* ((triplet (string-append machine "-" "w64-mingw32")) + (xbinutils (cross-binutils triplet)) + (xlibc (cross-libc triplet)) + (xgcc (cross-gcc triplet #:libc xlibc))) (package (name (string-append "nsis-" machine)) (version "3.04") @@ -41,13 +44,14 @@ "1xgllk2mk36ll2509hd31mfq6blgncmdzmwxj3ymrwshdh23d5b0")) (patches (search-patches "nsis-env-passthru.patch")))) (build-system scons-build-system) - (native-inputs `(("xgcc" ,(cross-gcc triplet #:libc (cross-libc trip= let))) - ("xbinutils" ,(cross-binutils triplet)) - ("mingw-w64" ,(cross-libc triplet)))) + (native-inputs `(("xgcc" ,xgcc) + ("xbinutils" ,xbinutils) + ("mingw-w64" ,xlibc))) (inputs `(("zlib" ,zlib))) (arguments `(#:scons ,scons-python2 #:modules ((srfi srfi-1) + (srfi srfi-26) (guix build utils) (guix build scons-build-system)) #:tests? #f @@ -92,7 +96,20 @@ ;; CROSS_-prefixed version of env vars (setenv (string-append "CROSS_" env-name) (filter-delimited-string env-val ming= w-path?)))) - '("CPLUS_INCLUDE_PATH" "LIBRARY_PATH" "C_INCLUDE_= PATH")))) + '("CPATH" "LIBRARY_PATH")) + ;; Hack to place mingw-w64 path at the end of sear= ch + ;; paths. Could probably use a specfile and diraf= ter + (setenv "CROSS_CPLUS_INCLUDE_PATH" + (string-join + `(,@(map (cut string-append (assoc-ref %b= uild-inputs "xgcc") <>) + `("/include/c++" + ,(string-append "/include/c++/= " ,triplet) + "/include/c++/backward" + ,@(map (cut string-append "/li= b/gcc/" ,triplet "/" ,(package-version xgcc) <>) + '("/include" + "/include-fixed")))) + ,(getenv "CROSS_CPATH")) + ":")))) (add-before 'build 'fix-target-detection (lambda _ ;; NSIS target detection is screwed up, manually -- 2.23.0