From patchwork Tue Apr 25 15:50:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 49506 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 851D227BBE2; Tue, 25 Apr 2023 17:26: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=-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 863C727BBE9 for ; Tue, 25 Apr 2023 17:26:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prLUT-0004He-6v; Tue, 25 Apr 2023 12:26:05 -0400 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 1prLUQ-0004Em-Kz for guix-patches@gnu.org; Tue, 25 Apr 2023 12:26:02 -0400 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 1prLUQ-0006UN-3y for guix-patches@gnu.org; Tue, 25 Apr 2023 12:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prLUP-0003ic-VU for guix-patches@gnu.org; Tue, 25 Apr 2023 12:26:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62916] [PATCH v2 1/1] gnu: p11-kit: fix build on mingw. Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 Apr 2023 16:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62916 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 62916@debbugs.gnu.org Received: via spool by 62916-submit@debbugs.gnu.org id=B62916.168243993714256 (code B ref 62916); Tue, 25 Apr 2023 16:26:01 +0000 Received: (at 62916) by debbugs.gnu.org; 25 Apr 2023 16:25:37 +0000 Received: from localhost ([127.0.0.1]:53443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prLTx-0003hk-6K for submit@debbugs.gnu.org; Tue, 25 Apr 2023 12:25:36 -0400 Received: from planete-kraus.eu ([89.234.140.182]:47470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prLTr-0003hZ-U5 for 62916@debbugs.gnu.org; Tue, 25 Apr 2023 12:25:31 -0400 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id ead47980; Tue, 25 Apr 2023 16:25:26 +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:mime-version :content-type:content-transfer-encoding:to:cc; s=dkim; bh=xcIunU b8WM7WWkOfXhJIq49eEyM=; b=S/9OSY+2Dx1VpwB6O00yvIo0F0Ab/PiYHVH9fw YEa3gBRCNHZ7M7YI2/M+8/tkVVqBG4m9h8mf3Zu8puYS7qC2MdQJlIBeti9KTZw9 y1I7kcDdN/ayzrDz8lALHYw+xt2p9qym+dfbRzM3w8h0B3UVm71eBk7ZrglqT4lP OOT6A= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id a12c4e04 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 25 Apr 2023 16:25:24 +0000 (UTC) Message-Id: In-Reply-To: References: <87ildkym9z.fsf_-_@gnu.org> Date: Tue, 25 Apr 2023 17:50:13 +0200 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-build-system-for-mingw.patch: New patch. It makes sure that all symbols are defined when linking objects. * gnu/packages/tls.scm (p11-kit) [on target-mingw?] [phase 'apply-mingw-patch]: New phase, similar to what’s done with hurd. * gnu/packages/tls.scm (p11-kit) [native-inputs]: also add the autotools on mingw. --- gnu/local.mk | 3 +- .../p11-kit-fix-build-system-for-mingw.patch | 108 ++++++++++++++++++ gnu/packages/tls.scm | 14 ++- 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/p11-kit-fix-build-system-for-mingw.patch diff --git a/gnu/local.mk b/gnu/local.mk index 66dd240ba9..355c09caa4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1696,7 +1696,8 @@ 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-hurd.patch \ + %D%/packages/patches/p11-kit-hurd.patch \ + %D%/packages/patches/p11-kit-fix-build-system-for-mingw.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/perl-5.14-autosplit-default-time.patch \ %D%/packages/patches/perl-5.14-module-pluggable-search.patch \ diff --git a/gnu/packages/patches/p11-kit-fix-build-system-for-mingw.patch b/gnu/packages/patches/p11-kit-fix-build-system-for-mingw.patch new file mode 100644 index 0000000000..cc02fdf1b3 --- /dev/null +++ b/gnu/packages/patches/p11-kit-fix-build-system-for-mingw.patch @@ -0,0 +1,108 @@ +From e350540c9e2259e2f66cbaf7c6dc347f03acac40 Mon Sep 17 00:00:00 2001 +From: Vivien Kraus +Date: Tue, 25 Apr 2023 17:41:47 +0200 +Subject: [PATCH] Fix the build system to avoid undefined references on mingw. + +--- + p11-kit/Makefile.am | 23 ++++++++++++----------- + trust/Makefile.am | 5 ++--- + 2 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am +index 7fe7a6c..017edd3 100644 +--- a/p11-kit/Makefile.am ++++ b/p11-kit/Makefile.am +@@ -13,6 +13,7 @@ COMMON_SRCS = \ + p11-kit/conf.c p11-kit/conf.h \ + p11-kit/iter.c \ + p11-kit/log.c p11-kit/log.h \ ++ p11-kit/lists.c \ + p11-kit/filter.c p11-kit/filter.h \ + p11-kit/modules.c p11-kit/modules.h \ + p11-kit/pkcs11.h \ +@@ -80,6 +81,7 @@ COMMON_CFLAGS = \ + COMMON_LIBS = \ + libp11-common.la \ + libp11-library.la \ ++ libp11-tool.la \ + $(LIBFFI_LIBS) \ + $(LTLIBINTL) \ + $(NULL) +@@ -125,7 +127,8 @@ libp11_kit_testable_la_SOURCES = \ + $(libp11_kit_internal_la_SOURCES) \ + $(libp11_kit_la_SOURCES) \ + $(NULL) +-libp11_kit_testable_la_LIBADD = $(COMMON_LIBS) ++libp11_kit_testable_la_LIBADD = $(COMMON_LIBS) \ ++ libp11-tool.la + + pkcs11_gnu_sources = \ + p11-kit/uri.gnu.c \ +@@ -238,14 +241,12 @@ EXTRA_DIST += \ + bin_PROGRAMS += p11-kit/p11-kit + + p11_kit_p11_kit_SOURCES = \ +- p11-kit/lists.c \ + p11-kit/p11-kit.c \ + $(NULL) + + p11_kit_p11_kit_LDADD = \ +- libp11-kit.la \ +- libp11-tool.la \ +- libp11-common.la \ ++ libp11-kit-internal.la \ ++ $(COMMON_LIBS) \ + $(LTLIBINTL) \ + $(NULL) + +@@ -257,12 +258,12 @@ 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 +279,12 @@ 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..f5d87f5 100644 +--- a/trust/Makefile.am ++++ b/trust/Makefile.am +@@ -84,9 +84,8 @@ bin_PROGRAMS += trust/trust + + trust_trust_LDADD = \ + libtrust-data.la \ +- libp11-kit.la \ +- libp11-common.la \ +- libp11-tool.la \ ++ libp11-kit-internal.la \ ++ $(COMMON_LIBS) \ + $(LTLIBINTL) \ + $(LIBTASN1_LIBS) \ + $(HASH_LIBS) \ +-- +2.39.2 + diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index e0da7757e0..2cd43c6957 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -153,7 +153,7 @@ (define-public p11-kit (build-system gnu-build-system) (native-inputs (append (list pkg-config) - (if (hurd-target?) + (if (or (target-mingw?) (hurd-target?)) (list autoconf automake gettext-minimal libtool) '()))) (inputs @@ -179,6 +179,18 @@ (define patch (lambda _ (invoke "autoreconf" "-fiv")))) #~()) + #$@(if (target-mingw?) + #~((add-after 'unpack 'apply-mingw-patch + (lambda* (#:key inputs #:allow-other-keys) + (define patch + #$(local-file + (search-patch "p11-kit-fix-build-system-for-mingw.patch"))) + (invoke "patch" "-p1" "--batch" "-i" + patch))) + (replace 'bootstrap + (lambda _ + (invoke "autoreconf" "-fiv")))) + #~()) (add-before 'check 'prepare-tests (lambda _ ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up