GNU bug report logs - #37027
[PATCH] gnu: zlib: Add support for MinGW targets.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: David Thompson <dthompson2@HIDDEN>; Keywords: patch; dated Wed, 14 Aug 2019 13:00:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 37027 <at> debbugs.gnu.org:


Received: (at 37027) by debbugs.gnu.org; 27 Aug 2019 22:06:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 18:06:36 2019
Received: from localhost ([127.0.0.1]:49524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i2jbn-0002KF-So
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2019 18:06:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1i2jbm-0002Jp-0f
 for 37027 <at> debbugs.gnu.org; Tue, 27 Aug 2019 18:06:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37944)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1i2jbg-0004yz-Ke; Tue, 27 Aug 2019 18:06:28 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45150 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1i2jbg-0000hH-3X; Tue, 27 Aug 2019 18:06:28 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: David Thompson <dthompson2@HIDDEN>
Subject: Re: [bug#37027] [PATCH] gnu: zlib: Add support for MinGW targets.
References: <20190814125853.18488-1-dthompson2@HIDDEN>
Date: Wed, 28 Aug 2019 00:06:26 +0200
In-Reply-To: <20190814125853.18488-1-dthompson2@HIDDEN> (David
 Thompson's message of "Wed, 14 Aug 2019 08:58:53 -0400")
Message-ID: <87a7bumffh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 37027
Cc: 37027 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi David,

David Thompson <dthompson2@HIDDEN> skribis:

> ---
>  gnu/packages/compression.scm | 55 +++++++++++++++++++++++-------------
>  1 file changed, 36 insertions(+), 19 deletions(-)

Please add a commit log.  :-)

> +               `((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 o=
ut "/include"))
> +                                 (setenv "LIBRARY_PATH" (string-append o=
ut "/lib"))
> +                                 (setenv "BINARY_PATH" (string-append ou=
t "/bin"))
> +                                 #t))))
> +               `((replace 'configure
> +                          (lambda* (#:key outputs #:allow-other-keys)

Minor issue: could you adjust indentation to look like:

  (add-before 'x 'y
    (lambda* =E2=80=A6

?  guix.el should take care of that.

> -               (with-directory-excursion (string-append out "/lib")
> -                 (install-file "libz.a" (string-append static "/lib"))
> -                 (delete-file "libz.a")
> -                 #t)))))))
> +                    (lambda* (#:key outputs #:allow-other-keys)
> +                      (let ((out (assoc-ref outputs "out"))
> +                            (static (assoc-ref outputs "static")))
> +                        (with-directory-excursion (string-append out "/l=
ib")
> +                                                  (install-file "libz.a"=
 (string-append static "/lib"))

The =E2=80=98with-directory-excursion=E2=80=99 indentation went off here.

> +       ,@(if (target-mingw?)
> +             `(#:make-flags
> +               '("-fwin32/Makefile.gcc"
> +                 "SHARED_MODE=3D1"
> +                 ,(string-append "CC=3D" (%current-target-system) "-gcc")
> +                 ,(string-append "RC=3D" (%current-target-system) "-wind=
res")
> +                 ,(string-append "AR=3D" (%current-target-system) "-ar")=
))
> +             '())))

I wonder if we could have a single =E2=80=98if=E2=80=99:

  (arguments
    (if (target-mingw?)
        =E2=80=A6
        ))

?  Thoughts?

Otherwise LGTM, thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#37027; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Aug 2019 12:59:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 14 08:59:07 2019
Received: from localhost ([127.0.0.1]:49009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hxsrq-00049a-6A
	for submit <at> debbugs.gnu.org; Wed, 14 Aug 2019 08:59:06 -0400
Received: from lists.gnu.org ([209.51.188.17]:36884)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dthompson2@HIDDEN>) id 1hxsro-00049I-HC
 for submit <at> debbugs.gnu.org; Wed, 14 Aug 2019 08:59:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48029)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <dthompson2@HIDDEN>) id 1hxsrn-00079H-0U
 for guix-patches@HIDDEN; Wed, 14 Aug 2019 08:59:04 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dthompson2@HIDDEN>) id 1hxsrl-0004Ol-Ln
 for guix-patches@HIDDEN; Wed, 14 Aug 2019 08:59:02 -0400
Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:39655)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <dthompson2@HIDDEN>)
 id 1hxsrl-0004OW-GQ
 for guix-patches@HIDDEN; Wed, 14 Aug 2019 08:59:01 -0400
Received: by mail-qk1-x732.google.com with SMTP id 125so9362370qkl.6
 for <guix-patches@HIDDEN>; Wed, 14 Aug 2019 05:59:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=worcester-edu.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id;
 bh=/A/MrRhgaFSdrGV+QDwI17bvuzRXh0cQJo58BcTKWJw=;
 b=bmsx2zFNNYIMcfYfkE1zCkPdQN8aSWtAGyuU3VFUNg119J/jbxfHMM9+XJ1i2Fum/c
 vsh5EzrzQCqqY2RQa6Eh9fbuJ9cCAIOiRoYRl7Ycb+uWU5jypF8w1IbbuCcwPoYDGDSA
 t8VTpiDArXM5ofTOhvccf3m02/vGhaIPex8SUfH3vPRwJvSiTbsPPJ0zAJzBkv37lBm5
 rWArG0A5w9G0HAw+TZF61cv5A7XnOf1RUFoVnalTWVbPzUHg31ewfPak3YJZEKiV1zAz
 Sv3IqUR20ps1yAZWyUDAaXty4ZvYzAHKPKLibWsMrL6ubyoduyV7nIHYshbUfSc50s1G
 Bq9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id;
 bh=/A/MrRhgaFSdrGV+QDwI17bvuzRXh0cQJo58BcTKWJw=;
 b=pjvb18hvIUSekocRwNSH/hiCEHi+Wc9vJAUHy/h1SrldCIluo85lpl/LWFVWZxsD0O
 +ofcEK6LjIbr+Hahp5eMScjXKXp03K4H9H4YZVsoBCV/+O1y5EUNjbjnSeclCr+TrK5o
 ulA41mfAlgr/wDPBjSqky3aMuC5zRKHTMR9Nt05XsdeJTsPYmH8gbjcZRDqEpMqZk4Sb
 Q7RBfaO1AXy01etjSjDntdCMlWixK3gW60K06KeOLWrLSpgzijZFBW8/af859wTo/vLq
 GVJEX/0PfKVwj1qeRYRlZkpFgVzoSvMlUzTdRWpbmAjnvSoJqQy0kRiE/clhv0/bU2Qa
 WEKQ==
X-Gm-Message-State: APjAAAU1on+IEMNgTqK2Y1zIvGlcMlSqombAfhCjDpK4Yfx/agEquhg2
 bHsdWJwN00fcVhfWawLnifbRjsRPobPdqA==
X-Google-Smtp-Source: APXvYqxWExDhCwDML19s7CvKM+TwN/MnbgDMSm5HNu+qlasy5yCgL4ptglFpHvrrERwinvSKdPTp6w==
X-Received: by 2002:a37:464d:: with SMTP id t74mr36550501qka.342.1565787540596; 
 Wed, 14 Aug 2019 05:59:00 -0700 (PDT)
Received: from DT-ThinkPad-X1-Carbon-6th.lan
 (pool-72-74-52-43.bstnma.fios.verizon.net. [72.74.52.43])
 by smtp.gmail.com with ESMTPSA id q6sm14422053qke.109.2019.08.14.05.58.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2019 05:59:00 -0700 (PDT)
From: David Thompson <dthompson2@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: zlib: Add support for MinGW targets.
Date: Wed, 14 Aug 2019 08:58:53 -0400
Message-Id: <20190814125853.18488-1-dthompson2@HIDDEN>
X-Mailer: git-send-email 2.17.1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::732
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: David Thompson <dthompson2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

---
 gnu/packages/compression.scm | 55 +++++++++++++++++++++++-------------
 1 file changed, 36 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 9834fcbe63..092eb4a54a 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -87,26 +87,43 @@
     (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)))))
+         ,@(if (target-mingw?)
+               `((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))))
+               `((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)))))))
+                    (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?)
+             `(#: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")))
+             '())))
     (home-page "https://zlib.net/")
     (synopsis "Compression library")
     (description
-- 
2.17.1





Acknowledgement sent to David Thompson <dthompson2@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#37027; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.