From patchwork Thu Jan 5 22:08:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 45875 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 AF84327BBEB; Thu, 5 Jan 2023 23:38:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 2C1F327BBE9 for ; Thu, 5 Jan 2023 23:38:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDZoM-00004w-6b; Thu, 05 Jan 2023 18:38:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDZoJ-0008VH-Ow for guix-patches@gnu.org; Thu, 05 Jan 2023 18:38:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDZoA-0004hf-Ev for guix-patches@gnu.org; Thu, 05 Jan 2023 18:38:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDZoA-0007WC-9c for guix-patches@gnu.org; Thu, 05 Jan 2023 18:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60586] [PATCH 1/1] gnu: p11-kit: Fix mingw cross-compilation. Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Jan 2023 23:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60586 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60586@debbugs.gnu.org Received: via spool by 60586-submit@debbugs.gnu.org id=B60586.167296184128849 (code B ref 60586); Thu, 05 Jan 2023 23:38:02 +0000 Received: (at 60586) by debbugs.gnu.org; 5 Jan 2023 23:37:21 +0000 Received: from localhost ([127.0.0.1]:53279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDZnU-0007VE-O5 for submit@debbugs.gnu.org; Thu, 05 Jan 2023 18:37:21 -0500 Received: from planete-kraus.eu ([89.234.140.182]:40590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDZnT-0007V6-06 for 60586@debbugs.gnu.org; Thu, 05 Jan 2023 18:37:19 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id e8bc3fd0 for <60586@debbugs.gnu.org>; Thu, 5 Jan 2023 23:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:in-reply-to:references:from:date:subject:to :mime-version; s=dkim; bh=BNdS2snVBottrkDAPpXLuznoKSw=; b=PctVoY MDhJ6FGlLYEOiNgxqgSxqtd7yS84b2tg3iph+2iXrnLIctyTRkSXZZ1QcxB5sfTU JS+fgSga+zT4pnN5if/k+uuJBoogRocLs/h4p6/4pKeVvnaIPZYmV5jy0/zD0c4X 6ySFvpQdNKFxIF/Z4fDICL5kXHzH3Q1ksPdsU= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 29ec553e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <60586@debbugs.gnu.org>; Thu, 5 Jan 2023 23:37:14 +0000 (UTC) Message-Id: <20f2359427de9bfa0cdaccfed5b1b4a0f24a01b6.1672961565.git.vivien@planete-kraus.eu> In-Reply-To: References: Date: Thu, 5 Jan 2023 23:08:18 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.46.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: , 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 Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/p11-kit-fix-mingw.patch: New patch. It removes undefined symbol errors. * gnu/packages/tls.scm (p11-kit) [native-inputs]: Add libtasn1 as a dependency for a code generator. The autotools are added when compiling for mingw. [inputs]: Add the mingw patch, similar to the hurd patch. [phases]: Add a new apply-mingw-patch phase, similar to apply-hurd-patch. The 'bootstrap phase replacement happens both for hurd and mingw. --- gnu/local.mk | 1 + gnu/packages/patches/p11-kit-fix-mingw.patch | 92 ++++++++++++++++++++ gnu/packages/tls.scm | 22 ++++- 3 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/p11-kit-fix-mingw.patch diff --git a/gnu/local.mk b/gnu/local.mk index 4a94c3b8c8..a35c2d2f33 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1649,6 +1649,7 @@ dist_patch_DATA = \ %D%/packages/patches/sqlite-hurd.patch \ %D%/packages/patches/strace-readlink-tests.patch \ %D%/packages/patches/sunxi-tools-remove-sys-io.patch \ + %D%/packages/patches/p11-kit-fix-mingw.patch \ %D%/packages/patches/p11-kit-hurd.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/perl-5.14-autosplit-default-time.patch \ diff --git a/gnu/packages/patches/p11-kit-fix-mingw.patch b/gnu/packages/patches/p11-kit-fix-mingw.patch new file mode 100644 index 0000000000..cfb8a3c9ba --- /dev/null +++ b/gnu/packages/patches/p11-kit-fix-mingw.patch @@ -0,0 +1,92 @@ +From de5a3522cc7dd28d9b12f26ad29803ae623dcf24 Mon Sep 17 00:00:00 2001 +From: Vivien Kraus +Date: Thu, 5 Jan 2023 22:56:35 +0100 +Subject: [PATCH] Make sure that libp11-kit does not have undefined symbols + +Under mingw, as a DLL, libp11-kit is not allowed to have undefined +symbols. It means that it should also add the COMMON_LIBS in addition +to the internal library. + +The programs must do that too, otherwise they have undefined symbols. +--- + p11-kit/Makefile.am | 13 ++++++++++--- + trust/Makefile.am | 3 ++- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am +index 7fe7a6c..11ec3da 100644 +--- a/p11-kit/Makefile.am ++++ b/p11-kit/Makefile.am +@@ -237,6 +237,8 @@ EXTRA_DIST += \ + + bin_PROGRAMS += p11-kit/p11-kit + ++p11_kit_p11_kit_CFLAGS = $(COMMON_CFLAGS) ++ + p11_kit_p11_kit_SOURCES = \ + p11-kit/lists.c \ + p11-kit/p11-kit.c \ +@@ -244,8 +246,9 @@ p11_kit_p11_kit_SOURCES = \ + + p11_kit_p11_kit_LDADD = \ + libp11-kit.la \ ++ libp11-kit-internal.la \ + libp11-tool.la \ +- libp11-common.la \ ++ $(COMMON_LIBS) \ + $(LTLIBINTL) \ + $(NULL) + +@@ -257,12 +260,14 @@ private_PROGRAMS += p11-kit/p11-kit-remote + + p11_kit_p11_kit_remote_SOURCES = \ + p11-kit/remote.c \ ++ $(libp11_kit_la_SOURCES) \ + $(NULL) + + p11_kit_p11_kit_remote_LDADD = \ + libp11-tool.la \ +- libp11-common.la \ + libp11-kit.la \ ++ libp11-kit-internal.la \ ++ $(COMMON_LIBS) \ + $(NULL) + + check_PROGRAMS += p11-kit/p11-kit-remote-testable +@@ -278,12 +283,14 @@ private_PROGRAMS += p11-kit/p11-kit-server + + p11_kit_p11_kit_server_SOURCES = \ + p11-kit/server.c \ ++ $(libp11_kit_la_SOURCES) \ + $(NULL) + + p11_kit_p11_kit_server_LDADD = \ + libp11-tool.la \ +- libp11-common.la \ + libp11-kit.la \ ++ libp11-kit-internal.la \ ++ $(COMMON_LIBS) \ + $(LIBSYSTEMD_LIBS) \ + $(NULL) + +diff --git a/trust/Makefile.am b/trust/Makefile.am +index 6ff5d12..4e99a80 100644 +--- a/trust/Makefile.am ++++ b/trust/Makefile.am +@@ -85,11 +85,12 @@ bin_PROGRAMS += trust/trust + trust_trust_LDADD = \ + libtrust-data.la \ + libp11-kit.la \ +- libp11-common.la \ ++ libp11-kit-internal.la \ + libp11-tool.la \ + $(LTLIBINTL) \ + $(LIBTASN1_LIBS) \ + $(HASH_LIBS) \ ++ $(COMMON_LIBS) \ + $(NULL) + + trust_trust_CFLAGS = \ +-- +2.38.1 + diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index a74b423ccf..d4220284e8 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -148,11 +148,13 @@ (define-public p11-kit (base32 "1dn6br4v033d3gp2max9lsr3y4q0nj6iyr1yq3kzi8ym7lal13wa")))) (build-system gnu-build-system) (native-inputs - `(,@(if (hurd-target?) + `(,@(if (or (hurd-target?) (target-mingw?)) `(("autoconf" ,autoconf) ("automake" ,automake) ("gettext" ,gettext-minimal) ;for autopoint - ("libtool" ,libtool)) + ("libtool" ,libtool) + ;libtasn1 is a code generator + ("libtasn1" ,libtasn1)) '()) ("pkg-config" ,pkg-config))) (inputs @@ -161,6 +163,9 @@ (define-public p11-kit `(("libbsd" ,libbsd) ("hurd-patch" ,(search-patch "p11-kit-hurd.patch"))) '()) + ,@(if (target-mingw?) + `(("mingw-patch" ,(search-patch "p11-kit-fix-mingw.patch"))) + '()) ("libtasn1" ,libtasn1))) (arguments `(#:configure-flags '("--without-trust-paths") @@ -170,8 +175,17 @@ (define-public p11-kit (lambda* (#:key inputs #:allow-other-keys) (let ((patch (assoc-ref inputs "hurd-patch"))) (invoke "patch" "-p1" "--batch" "-i" - patch)))) - (replace 'bootstrap + patch))))) + '()) + ,@(if (target-mingw?) + '((add-after 'unpack 'apply-mingw-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch (assoc-ref inputs "mingw-patch"))) + (invoke "patch" "-p1" "--batch" "-i" + patch))))) + '()) + ,@(if (or (hurd-target?) (target-mingw?)) + '((replace 'bootstrap (lambda _ (invoke "autoreconf" "-fiv")))) '())