From patchwork Wed Jul 13 15:19:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 3708 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D238B27BBEA; Wed, 13 Jul 2022 16:20:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 417E827BBE9 for ; Wed, 13 Jul 2022 16:20:13 +0100 (BST) Received: from localhost ([::1]:36214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBe9s-0005Ay-ES for patchwork@mira.cbaines.net; Wed, 13 Jul 2022 11:20:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBe9j-0005Ai-0D for guix-patches@gnu.org; Wed, 13 Jul 2022 11:20:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBe9i-0003fh-JU for guix-patches@gnu.org; Wed, 13 Jul 2022 11:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBe9i-000543-FO for guix-patches@gnu.org; Wed, 13 Jul 2022 11:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56504] [PATCH] Mingw support for zlib Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Jul 2022 15:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56504 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler , 56504@debbugs.gnu.org Received: via spool by 56504-submit@debbugs.gnu.org id=B56504.165772558519439 (code B ref 56504); Wed, 13 Jul 2022 15:20:02 +0000 Received: (at 56504) by debbugs.gnu.org; 13 Jul 2022 15:19:45 +0000 Received: from localhost ([127.0.0.1]:47554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBe9Q-00053T-RP for submit@debbugs.gnu.org; Wed, 13 Jul 2022 11:19:45 -0400 Received: from planete-kraus.eu ([89.234.140.182]:43446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBe9P-00053K-Cn for 56504@debbugs.gnu.org; Wed, 13 Jul 2022 11:19:44 -0400 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 894ddff4; Wed, 13 Jul 2022 15:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:date:in-reply-to:references :content-type:mime-version; s=dkim; bh=tT3rv1qR5j3qikrazz6iENvwg d4=; b=XlmeaFH4wLPuFFWXsrHUzSZ6/9yz2oYkUbeT539qQPjOV11TPiQsbuxua 9f7N6BM0shyNcbWtI2sCyssP8wUQfbdqrlBSR4YE0DpDcOCmEb/0fRbvhbX+eevi 2mxTJFLhUhPwxl8soAAYuIIRLYyid9eFnm7oyel1eWx5MfdMMc= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id a76bd9a7 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Wed, 13 Jul 2022 15:19:38 +0000 (UTC) Message-ID: Date: Wed, 13 Jul 2022 17:19:36 +0200 In-Reply-To: References: <9418154f0a4f8c2b06b1b5bbce8df570ec4028de.camel@planete-kraus.eu> <29fa1e573d51f351796ba22d7344d9738d71c9be.camel@planete-kraus.eu> User-Agent: Evolution 3.42.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus X-getmail-retrieved-from-mailbox: Patches Le mercredi 13 juillet 2022 à 07:49 +0200, Liliana Marie Prikler a écrit : > Am Dienstag, dem 12.07.2022 um 18:45 +0200 schrieb Vivien Kraus: > > Le mardi 12 juillet 2022 à 08:07 +0200, Liliana Marie Prikler a > > écrit : > > > Am Dienstag, dem 12.07.2022 um 01:53 +0200 schrieb Vivien Kraus: > > > > +                     `((substitute* "win32/Makefile.gcc" > > > > +                         (("PREFIX =") > > > > +                          (string-append "PREFIX = " > > > > ,(%current- > > > > target-system) "-")) > > > > +                         (("prefix \\?= /usr/local") > > > > +                          (string-append "prefix ?= " out)) > > > > +                         (("# BINARY_PATH, INCLUDE_PATH and > > > > LIBRARY_PATH must be set.") > > > > +                          "\ > > > > +BINARY_PATH = $(prefix)/bin > > > > +INCLUDE_PATH = $(prefix)/include > > > > +LIBRARY_PATH = $(prefix)/lib")) > > > > +                       (rename-file "win32/Makefile.gcc" > > > > "Makefile")) > > > I think these can be conditionally added to #:make-flags > > I did it for all but prefix, because I have to have the output > > path. > > Is there a way to get it from within the make-flags? > With the gexp-style you'd write #$output, otherwise ,(assoc-ref > %build- > outputs "out"). Looking at the "-builder" scheme file that is generated for the derivation, it looks like what I want is simply %outputs, not %build- outputs. > > > > > +                     `((invoke "./configure" > > > > +                               (string-append "--prefix=" > > > > out))))))) > > > > > > > +         ,@(if (and (%current-target-system) > > > > +                    (string-suffix? "-mingw32" (%current- > > > > target- > > > > system))) > > > > +               `(add-after 'install 'install-mingw-shared > > > > +                  (lambda* (#:key make-flags #:allow-other- > > > > keys) > > > > +                    (apply invoke "make" > > > > +                           (append make-flags > > > > +                                   '("install" > > > > "SHARED_MODE=1"))))) > > > SHARED_MODE might likewise be conditionally added to #:make- > > > flags. > > I get both the DLL loader and the DLL in the default output, and > > the > > static lib in the static output, so it works. > Oh, so you mean the static output should be built without > SHARED_MODE? No, SHARED_MODE=1 means "please also install the DLL" and SHARED_MODE=0 means "please do not install the DLL". Reading the win32/Makefile.gcc, nothing special is done if SHARED_MODE=0. It is only used in the install and uninstall targets. I don’t really understand why you would want to set SHARED_MODE=0 (even weirder to set it as a default) but I guess it happens. From 6991416907cb2b3e8be639c18cecb6bf519da904 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Sat, 25 Jun 2022 16:33:44 +0200 Subject: [PATCH v3] gnu: zlib: Support mingw cross-compilation. * gnu/packages/compression.scm (zlib): Only run configure if not mingw. --- gnu/packages/compression.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index d5bd3abf0f..871f90656c 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -113,7 +113,16 @@ (define-public zlib (build-system gnu-build-system) (outputs '("out" "static")) (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 (replace 'configure (lambda* (#:key outputs #:allow-other-keys) @@ -125,8 +134,10 @@ (define-public zlib ,@(if (%current-target-system) `((setenv "CHOST" ,(%current-target-system))) '()) - (invoke "./configure" - (string-append "--prefix=" out))))) + ,@(if (target-mingw?) + `((rename-file "win32/Makefile.gcc" "Makefile")) + `((invoke "./configure" + (string-append "--prefix=" out))))))) (add-after 'install 'move-static-library (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) base-commit: dcf133587ac7d73ba306a314e1a496a7efb9960b -- 2.36.1