Archived
1
0
Fork 0

gnu: make-mingw-w64: Use G-Expressions.

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

Change-Id: Ie095dceac635f19f146895c8e3f36d9889108a9a
Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2024-06-18 13:26:14 +02:00 committed by Christopher Baines
parent 4baaa56e37
commit ce578830e6
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

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