[PATCH] gnu: zlib: Add support for MinGW targets.

  • Done
  • quality assurance status badge
Details
One participant
  • David Thompson
Owner
unassigned
Submitted by
David Thompson
Severity
normal

Debbugs page

David Thompson wrote 6 years ago
(address . guix-patches@gnu.org)(address . ludo@gnu.org)
20190828130522.9469-1-dthompson2@worcester.edu
---
gnu/packages/compression.scm | 64 +++++++++++++++++++++++-------------
1 file changed, 42 insertions(+), 22 deletions(-)

Toggle diff (77 lines)
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index bda43bfd18..9ca61dda75 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -85,28 +85,48 @@
(build-system gnu-build-system)
(outputs '("out" "static"))
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Zlib's home-made `configure' fails when passed
- ;; extra flags like `--enable-fast-install', so we need to
- ;; invoke it with just what it understand.
- (let ((out (assoc-ref outputs "out")))
- ;; 'configure' doesn't understand '--host'.
- ,@(if (%current-target-system)
- `((setenv "CHOST" ,(%current-target-system)))
- '())
- (invoke "./configure"
- (string-append "--prefix=" out)))))
- (add-after 'install 'move-static-library
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (static (assoc-ref outputs "static")))
- (with-directory-excursion (string-append out "/lib")
- (install-file "libz.a" (string-append static "/lib"))
- (delete-file "libz.a")
- #t)))))))
+ (let ((shared-phase-mod
+ '(add-after 'install 'move-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (static (assoc-ref outputs "static")))
+ (with-directory-excursion (string-append out "/lib")
+ (install-file "libz.a" (string-append static "/lib"))
+ (delete-file "libz.a")
+ #t))))))
+ (if (target-mingw?)
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'install 'set-install-paths
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "INCLUDE_PATH" (string-append out "/include"))
+ (setenv "LIBRARY_PATH" (string-append out "/lib"))
+ (setenv "BINARY_PATH" (string-append out "/bin"))
+ #t)))
+ ,shared-phase-mod)
+ #:make-flags
+ '("-fwin32/Makefile.gcc"
+ "SHARED_MODE=1"
+ ,(string-append "CC=" (%current-target-system) "-gcc")
+ ,(string-append "RC=" (%current-target-system) "-windres")
+ ,(string-append "AR=" (%current-target-system) "-ar")))
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Zlib's home-made `configure' fails when passed
+ ;; extra flags like `--enable-fast-install', so we need to
+ ;; invoke it with just what it understand.
+ (let ((out (assoc-ref outputs "out")))
+ ;; 'configure' doesn't understand '--host'.
+ ,@(if (%current-target-system)
+ `((setenv "CHOST" ,(%current-target-system)))
+ '())
+ (invoke "./configure"
+ (string-append "--prefix=" out)))))
+ ,shared-phase-mod)))))
(home-page "https://zlib.net/")
(synopsis "Compression library")
(description
--
2.17.1
Thompson, David wrote 6 years ago
Re: bug#37208: Acknowledgement ([PATCH] gnu: zlib: Add support for MinGW targets.)
(address . 37208-done@debbugs.gnu.org)
CAJ=RwfagCwJo1w60kT0zUbgXq07WbKB52Zp9Ry6u18dMOngTSg@mail.gmail.com
Opened in error.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 37208@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 37208
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help