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,20 +77,26 @@ 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
#~(list #$(string-append "--host=" triplet)
#$@(if with-winpthreads?
#~("--with-libraries=winpthreads")
#~()))
#:make-flags #~'("DEFS=-DHAVE_CONFIG_H -D__MINGW_HAS_DXSDK=1")
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'configure 'setenv (add-before 'configure 'setenv
(lambda* (#:key inputs #:allow-other-keys) (lambda _
(let ((xgcc-core (assoc-ref inputs "xgcc-core")) (let ((xgcc-core #+(this-package-native-input
"xgcc-core"))
(mingw-headers (string-append (mingw-headers (string-append
(getcwd) "/mingw-w64-headers"))) (getcwd) "/mingw-w64-headers")))
(setenv "CPP" (setenv "CPP"
(string-append (string-append
xgcc-core ,(string-append "/bin/" triplet "-cpp"))) xgcc-core "/bin/" #$triplet "-cpp"))
(setenv "CROSS_C_INCLUDE_PATH" (setenv "CROSS_C_INCLUDE_PATH"
(string-append (string-append
mingw-headers mingw-headers
@ -97,16 +104,14 @@ specified, recurse and return a mingw-w64 with support for winpthreads."
":" mingw-headers "/crt" ":" mingw-headers "/crt"
":" mingw-headers "/defaults/include" ":" mingw-headers "/defaults/include"
":" mingw-headers "/direct-x/include")) ":" mingw-headers "/direct-x/include"))
(when ,with-winpthreads? #$@(if with-winpthreads?
(let ((xlibc (assoc-ref inputs "xlibc"))) #~((let ((xlibc #+(this-package-native-input
"xlibc")))
(setenv "CROSS_LIBRARY_PATH" (setenv "CROSS_LIBRARY_PATH"
(string-append (string-append
xlibc "/lib" ":" xlibc "/lib" ":"
xlibc "/" ,triplet "/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))
(home-page "https://mingw-w64.org") (home-page "https://mingw-w64.org")
(synopsis "Minimalist GNU for Windows") (synopsis "Minimalist GNU for Windows")
(description (description