3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

gnu: zlib: Support mingw cross-compilation.

* gnu/packages/compression.scm (zlib): Only run configure if not mingw.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Vivien Kraus 2022-06-25 16:33:44 +02:00 committed by Liliana Marie Prikler
parent d1c6b8db5a
commit 0565cde689
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -113,7 +113,16 @@
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" "static")) (outputs '("out" "static"))
(arguments (arguments
`(#:phases `(#:make-flags
,(if (target-mingw?)
`(list ,(string-append "PREFIX=" (%current-target-system) "-")
"BINARY_PATH = $(prefix)/bin"
"INCLUDE_PATH = $(prefix)/include"
"LIBRARY_PATH = $(prefix)/lib"
"SHARED_MODE = 1"
(string-append "prefix = " (assoc-ref %outputs "out")))
''())
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'configure (replace 'configure
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
@ -125,8 +134,10 @@
,@(if (%current-target-system) ,@(if (%current-target-system)
`((setenv "CHOST" ,(%current-target-system))) `((setenv "CHOST" ,(%current-target-system)))
'()) '())
(invoke "./configure" ,@(if (target-mingw?)
(string-append "--prefix=" out))))) `((rename-file "win32/Makefile.gcc" "Makefile"))
`((invoke "./configure"
(string-append "--prefix=" out)))))))
(add-after 'install 'move-static-library (add-after 'install 'move-static-library
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")) (let ((out (assoc-ref outputs "out"))