all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 62916@debbugs.gnu.org
Subject: [bug#62916] [PATCH v2 1/1] gnu: p11-kit: fix build on mingw.
Date: Tue, 25 Apr 2023 17:50:13 +0200	[thread overview]
Message-ID: <a99229ce9b42800614b8a9976b24261ecc464d9e.1682439400.git.vivien@planete-kraus.eu> (raw)
In-Reply-To: <cover.1682439400.git.vivien@planete-kraus.eu>

* 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 <vivien@planete-kraus.eu>
+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
-- 
2.39.2




  reply	other threads:[~2023-04-25 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 22:20 [bug#62916] [PATCH core-updates 0/2] Try to fix p11-kit compilation to mingw Vivien Kraus via Guix-patches via
2023-04-17 22:09 ` [bug#62916] [PATCH core-updates 1/2] gnu: gcc: do not build gcov Vivien Kraus via Guix-patches via
2023-04-25 16:11   ` [bug#62916] [PATCH core-updates 0/2] Try to fix p11-kit compilation to mingw Ludovic Courtès
2023-04-25 16:16     ` [bug#62916] [PATCH v2 0/1] Fix p11-kit build system for mingw Vivien Kraus via Guix-patches via
2023-04-25 15:50       ` Vivien Kraus via Guix-patches via [this message]
2023-04-25 21:33       ` [bug#62916] [PATCH v3 0/1] Simpler fix for p11-kit@mingw Vivien Kraus via Guix-patches via
2023-04-25 15:50         ` [bug#62916] [PATCH v3 1/1] gnu: p11-kit: fix build on mingw Vivien Kraus via Guix-patches via
2023-04-17 22:17 ` [bug#62916] [PATCH core-updates 2/2] NOT WORKING gnu: p11-kit: switch to meson-build-system Vivien Kraus via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a99229ce9b42800614b8a9976b24261ecc464d9e.1682439400.git.vivien@planete-kraus.eu \
    --to=guix-patches@gnu.org \
    --cc=62916@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.