From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: [PATCH 02/11] gnu: cross-build: i686-w64-mingw32: new cross target. Date: Wed, 18 May 2016 09:27:02 +0200 Message-ID: <87twhvq115.fsf@igalia.com> References: <1462740169-15029-1-git-send-email-janneke@gnu.org> <1462740169-15029-3-git-send-email-janneke@gnu.org> <87oa8f3dn5.fsf@igalia.com> <87twi09yhg.fsf@drakenvlieg.flower> <87wpmtqgcj.fsf@igalia.com> <87ziro8ghv.fsf@drakenvlieg.flower> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2vta-0000Uc-1h for guix-devel@gnu.org; Wed, 18 May 2016 03:27:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2vtV-0006v9-0P for guix-devel@gnu.org; Wed, 18 May 2016 03:27:52 -0400 In-Reply-To: <87ziro8ghv.fsf@drakenvlieg.flower> (Jan Nieuwenhuizen's message of "Wed, 18 May 2016 00:30:20 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jan Nieuwenhuizen Cc: guix-devel@gnu.org On Wed 18 May 2016 00:30, Jan Nieuwenhuizen writes: > Yay...looks like we're almost there! Yeah almost! Just two (?) more nits -- I seem to keep finding these. Sorry about that. > @@ -19,12 +19,17 @@ > ;;; along with GNU Guix. If not, see . > > (define-module (gnu packages cross-base) > - #:use-module (guix licenses) > + #:use-module ((guix licenses) #:prefix license:) > #:use-module (gnu packages) > - #:use-module (gnu packages gcc) > #:use-module (gnu packages base) > + #:use-module (gnu packages bash) > + #:use-module (gnu packages gawk) > + #:use-module (gnu packages gcc) > #:use-module (gnu packages commencement) > + #:use-module (gnu packages compression) > #:use-module (gnu packages linux) > + #:use-module (gnu packages mingw) > + #:use-module (gnu packages multiprecision) > #:use-module (guix packages) > #:use-module (guix download) > #:use-module (guix utils) It seems that of these additions, only mingw is necessary. Can you check? > + ;; libc is false, so we are building xgcc-sans-libc > + ;; Add essential headers from mingw-w64. > + (let ((mingw-source (assoc-ref inputs "mingw-source")) > + (mingw-headers > + (string-append (getcwd) "/mingw-w64-v5.0-rc2/mingw-w64-headers"))) > + (system* "tar" "xf" mingw-source) > + ;; We need _mingw.h which will gets built from > + ;; _mingw.h.in by mingw-w64's configure. We cannot > + ;; configure mingw-w64 until we have > + ;; xgcc-sans-libc; substitute to the rescue. > + (copy-file (string-append mingw-headers "/crt/_mingw.h.in") > + (string-append mingw-headers "/crt/_mingw.h")) > + (substitute* (string-append mingw-headers "/crt/_mingw.h") > + (("@MINGW_HAS_SECURE_API@") "#define MINGW_HAS_SECURE_API 1")) Humm, this v5.0-rc2 version is definitely going to break in the future. OK, we're depending on the internal structure of a tarball, we know it's going to be a bit fragile, but uf... If you have the bandwidth, a fix would be nice. Maybe: (define (unpacked-mingw-dir) (match (scandir "." (lambda (name) (string-contains name "mingw-w64"))) ((mingw-dir) (string-append (getcwd) "/" mingw-dir "/mingw-w64-headers")))) You'll need to add (ice-9 match) and (ice-9 ftw) to #:modules, and you'd have to invoke this function after unpacking the tarball. Andy