unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean-Pierre De Jesus DIAZ <jean@foundation.xyz>
To: 71630@debbugs.gnu.org
Cc: Jean-Pierre De Jesus DIAZ <jean@foundation.xyz>
Subject: [bug#71630] [PATCH 2/5] gnu: make-mingw-w64: Use G-Expressions.
Date: Tue, 18 Jun 2024 13:26:14 +0200	[thread overview]
Message-ID: <b96c2c9f775536446d22c17d2388679260999dff.1718708756.git.jean@foundation.xyz> (raw)
In-Reply-To: <cover.1718708756.git.jean@foundation.xyz>

* gnu/packages/mingw.scm (make-mingw-w64): Use G-Expressions and
move some arguments above phases.

Change-Id: Ie095dceac635f19f146895c8e3f36d9889108a9a
---
 gnu/packages/mingw.scm | 67 +++++++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/mingw.scm b/gnu/packages/mingw.scm
index 1ef2c5e1cf..825a784e0d 100644
--- a/gnu/packages/mingw.scm
+++ b/gnu/packages/mingw.scm
@@ -25,6 +25,7 @@ (define-module (gnu packages mingw)
   #:use-module (gnu packages)
   #:use-module (gnu packages cross-base)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (guix memoization)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -76,37 +77,41 @@ (define* (make-mingw-w64/implementation machine
                  ,(string-append triplet "/lib")
                  ,(string-append triplet "/lib64"))))))
       (arguments
-       `(#:configure-flags '(,(string-append "--host=" triplet)
-                             ,@(if with-winpthreads?
-                                   '("--with-libraries=winpthreads")
-                                   '()))
-         #:phases
-         (modify-phases %standard-phases
-           (add-before 'configure 'setenv
-             (lambda* (#:key inputs #:allow-other-keys)
-               (let ((xgcc-core (assoc-ref inputs "xgcc-core"))
-                     (mingw-headers (string-append
-                                     (getcwd) "/mingw-w64-headers")))
-                 (setenv "CPP"
-                         (string-append
-                          xgcc-core ,(string-append "/bin/" triplet "-cpp")))
-                 (setenv "CROSS_C_INCLUDE_PATH"
-                         (string-append
-                          mingw-headers
-                          ":" mingw-headers "/include"
-                          ":" mingw-headers "/crt"
-                          ":" mingw-headers "/defaults/include"
-                          ":" mingw-headers "/direct-x/include"))
-                 (when ,with-winpthreads?
-                   (let ((xlibc (assoc-ref inputs "xlibc")))
-                     (setenv "CROSS_LIBRARY_PATH"
-                             (string-append
-                              xlibc "/lib" ":"
-                              xlibc "/" ,triplet "/lib"))))))))
-         #:make-flags (list "DEFS=-DHAVE_CONFIG_H -D__MINGW_HAS_DXSDK=1")
-         #:parallel-build? #f ; parallel builds often fail with empty .a files
-         #:tests? #f ; compiles and includes glibc headers
-         #:strip-binaries? #f))
+       (list #:parallel-build? #f ; parallel builds often fail with empty .a files
+             #:tests? #f ; compiles and includes glibc headers
+             #:strip-binaries? #f
+             #:configure-flags
+             #~(list #$(string-append "--host=" triplet)
+                     #$@(if with-winpthreads?
+                           #~("--with-libraries=winpthreads")
+                           #~()))
+             #:make-flags #~'("DEFS=-DHAVE_CONFIG_H -D__MINGW_HAS_DXSDK=1")
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-before 'configure 'setenv
+                   (lambda _
+                     (let ((xgcc-core #+(this-package-native-input
+                                          "xgcc-core"))
+                           (mingw-headers (string-append
+                                           (getcwd) "/mingw-w64-headers")))
+                       (setenv "CPP"
+                               (string-append
+                                xgcc-core "/bin/" #$triplet "-cpp"))
+                       (setenv "CROSS_C_INCLUDE_PATH"
+                               (string-append
+                                mingw-headers
+                                ":" mingw-headers "/include"
+                                ":" mingw-headers "/crt"
+                                ":" mingw-headers "/defaults/include"
+                                ":" mingw-headers "/direct-x/include"))
+                       #$@(if with-winpthreads?
+                              #~((let ((xlibc #+(this-package-native-input
+                                                  "xlibc")))
+                                   (setenv "CROSS_LIBRARY_PATH"
+                                           (string-append
+                                            xlibc "/lib" ":"
+                                            xlibc "/" #$triplet "/lib"))))
+                              #~())))))))
       (home-page "https://mingw-w64.org")
       (synopsis "Minimalist GNU for Windows")
       (description
-- 
2.45.1





  parent reply	other threads:[~2024-06-18 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 11:17 [bug#71630] [PATCH 0/5] gnu: make-mingw-w64: Update to 12.0.0 Jean-Pierre De Jesus DIAZ
2024-06-18 11:26 ` [bug#71630] [PATCH 1/5] gnu: make-mingw-w64: Memoize Jean-Pierre De Jesus DIAZ
2024-06-18 11:26 ` Jean-Pierre De Jesus DIAZ [this message]
2024-06-18 11:26 ` [bug#71630] [PATCH 3/5] gnu: make-mingw-w64: Update to 12.0.0 Jean-Pierre De Jesus DIAZ
2024-06-18 11:26 ` [bug#71630] [PATCH 4/5] gnu: mingw-w64-tools: Use G-Expressions Jean-Pierre De Jesus DIAZ
2024-06-18 11:26 ` [bug#71630] [PATCH 5/5] gnu: mingw-w64-tools: Update to 12.0.0 Jean-Pierre De Jesus DIAZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b96c2c9f775536446d22c17d2388679260999dff.1718708756.git.jean@foundation.xyz \
    --to=jean@foundation.xyz \
    --cc=71630@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).