[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/11] gnu: cross-build: i686-w64-mingw32: new cross target.
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
On Wed 18 May 2016 00:30, Jan Nieuwenhuizen <address@hidden> 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 <http://www.gnu.org/licenses/>.
>
> (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
- [PATCH 01/11] gnu: Add mingw-w64., (continued)
[PATCH 06/11] gnu: ncurses: support mingw., Jan Nieuwenhuizen, 2016/05/08
[PATCH 03/11] gnu: Add function libiconv-if-needed., Jan Nieuwenhuizen, 2016/05/08
[PATCH 07/11] gnu: cross-base: Add cross-libtool., Jan Nieuwenhuizen, 2016/05/08