From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:60700) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2xeF-0006Wp-KK for guix-patches@gnu.org; Wed, 28 Aug 2019 09:06:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2xeE-0007o1-Cw for guix-patches@gnu.org; Wed, 28 Aug 2019 09:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2xeE-0007np-AF for guix-patches@gnu.org; Wed, 28 Aug 2019 09:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i2xeE-000284-22 for guix-patches@gnu.org; Wed, 28 Aug 2019 09:06:02 -0400 Subject: [bug#37208] [PATCH] gnu: zlib: Add support for MinGW targets. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:60509) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2xdg-0006AA-SO for guix-patches@gnu.org; Wed, 28 Aug 2019 09:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2xde-0007No-GC for guix-patches@gnu.org; Wed, 28 Aug 2019 09:05:28 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:43097) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2xde-0007Mu-14 for guix-patches@gnu.org; Wed, 28 Aug 2019 09:05:26 -0400 Received: by mail-qk1-x736.google.com with SMTP id m2so2261709qkd.10 for ; Wed, 28 Aug 2019 06:05:25 -0700 (PDT) From: David Thompson Date: Wed, 28 Aug 2019 09:05:22 -0400 Message-Id: <20190828130522.9469-1-dthompson2@worcester.edu> In-Reply-To: <87a7bumffh.fsf@gnu.org> References: <87a7bumffh.fsf@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37208@debbugs.gnu.org --- gnu/packages/compression.scm | 64 +++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 22 deletions(-) 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