GNU bug report logs - #62916
[PATCH core-updates 0/2] Try to fix p11-kit compilation to mingw

Previous Next

Package: guix-patches;

Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>

Date: Mon, 17 Apr 2023 22:27:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 62916 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Mon, 17 Apr 2023 22:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 17 Apr 2023 22:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH core-updates 0/2] Try to fix p11-kit compilation to mingw
Date: Tue, 18 Apr 2023 00:20:07 +0200
Dear guix,

On core-updates, p11-kit still uses the gnu build system. However, it does not
seem to be recommended anymore: the README now documents the meson build
system, and the makefiles are broken when targetting mingw.

For reference, on AUR:
https://aur.archlinux.org/packages/mingw-w64-p11-kit

p11-kit comes early in the dependency chain. It being broken means that
we can’t cross-compile gnutls, curl and other packages.

However, there is some kind of dependency cycle when using the meson build
system (modules? Packages? I don’t know). Can someone help me sort that out?

Best regards,

Vivien

Vivien Kraus (2):
  gnu: gcc: do not build gcov.
  NOT WORKING gnu: p11-kit: switch to meson-build-system.

 gnu/packages/gcc.scm |  4 ++++
 gnu/packages/tls.scm | 19 ++++---------------
 2 files changed, 8 insertions(+), 15 deletions(-)


base-commit: a6d2b54d3920d8858b5b36e4e4364088ed340107
-- 
2.39.2




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Mon, 17 Apr 2023 22:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: 62916 <at> debbugs.gnu.org
Subject: [PATCH core-updates 1/2] gnu: gcc: do not build gcov.
Date: Tue, 18 Apr 2023 00:09:55 +0200
* gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Disable gcov when
targetting mingw.
---
 gnu/packages/gcc.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 5b1ef83ce6..c6575bf9db 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -88,6 +88,10 @@ (define (gcc-configure-flags-for-triplet target)
              (string-prefix? "powerpc-" target))
          '("--with-long-double-128"))
 
+        ;; See https://bugs.gentoo.org/show_bug.cgi?id=843989
+        ((target-mingw? target)
+         '("--disable-gcov"))
+
         (else
          ;; TODO: Add `arm.*-gnueabi', etc.
          '())))
-- 
2.39.2




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Mon, 17 Apr 2023 22:33:01 GMT) Full text and rfc822 format available.

Message #11 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: 62916 <at> debbugs.gnu.org
Subject: [PATCH core-updates 2/2] NOT WORKING gnu: p11-kit: switch to
 meson-build-system.
Date: Tue, 18 Apr 2023 00:17:30 +0200
* gnu/packages/tls.scm (p11-kit): Switch to meson build system.
---
 gnu/packages/tls.scm | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index d41efe23b0..eaa18b9064 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -150,12 +150,9 @@ (define-public p11-kit
                            "download/" version "/p11-kit-" version ".tar.xz"))
        (sha256
         (base32 "1y5fm9gwhkh902r26p90qf1g2h1ziqrk4hgf9i9sxm2wzlz7ignq"))))
-    (build-system gnu-build-system)
+    (build-system meson-build-system)
     (native-inputs
-     (append (list pkg-config)
-             (if (hurd-target?)
-                 (list autoconf automake gettext-minimal libtool)
-                 '())))
+     (list pkg-config))
     (inputs
      (append (list libffi libtasn1)
              (if (hurd-target?)
@@ -165,7 +162,7 @@ (define-public p11-kit
      (list #:configure-flags
            ;; Use the default certificates so that users such as flatpak
            ;; find them.  See <https://issues.guix.gnu.org/49957>.
-           #~'("--with-trust-paths=/etc/ssl/certs/ca-certificates.crt")
+           #~'("-Dtrust_paths=/etc/ssl/certs/ca-certificates.crt")
            #:phases #~(modify-phases %standard-phases
                         #$@(if (hurd-target?)
                                #~((add-after 'unpack 'apply-hurd-patch
@@ -178,15 +175,7 @@ (define patch
                                   (replace 'bootstrap
                                     (lambda _
                                       (invoke "autoreconf" "-fiv"))))
-                               #~())
-                        (add-before 'check 'prepare-tests
-                          (lambda _
-                            ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
-                            ;; and looks for .cache and other directories (only).
-                            ;; For simplicity just drop it since it is irrelevant
-                            ;; in the build container.
-                            (substitute* "Makefile"
-                              (("test-runtime\\$\\(EXEEXT\\)") "")))))))
+                               #~()))))
     (home-page "https://p11-glue.github.io/p11-glue/p11-kit.html")
     (synopsis "PKCS#11 library")
     (description
-- 
2.39.2




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Tue, 25 Apr 2023 16:12:01 GMT) Full text and rfc822 format available.

Message #14 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vivien Kraus <vivien <at> planete-kraus.eu>
Cc: 62916 <at> debbugs.gnu.org
Subject: Re: bug#62916: [PATCH core-updates 0/2] Try to fix p11-kit
 compilation to mingw
Date: Tue, 25 Apr 2023 18:11:36 +0200
Hi,

Vivien Kraus <vivien <at> planete-kraus.eu> skribis:

> * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Disable gcov when
> targetting mingw.

Pushed this one as 74038cf66e3a8cdcd9d97a81d9176c3cdefdaaf7.

The p11-kit story isn’t good, but I’m not sure how to address it.  When
we find a way, we can add a feature branch to rebuild everything that
depends on it though.

Thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Tue, 25 Apr 2023 16:25:01 GMT) Full text and rfc822 format available.

Message #17 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 62916 <at> debbugs.gnu.org
Subject: [PATCH v2 0/1] Fix p11-kit build system for mingw
Date: Tue, 25 Apr 2023 18:16:40 +0200
Hi!

> The p11-kit story isn’t good, but I’m not sure how to address it.  When
> we find a way, we can add a feature branch to rebuild everything that
> depends on it though.

I just found out how to fix the makefiles, and the moment I was about to send
the patch, I received your reply. This V2 does not fix the core issue, but at
least it builds on mingw now! The core problem in the build system is that
every auxiliary program is a mix of re-compiled common sources, static
libraries, and the main shared object. I decided to use static libraries
everywhere I can. This is gross but at least it links now, so this is a W I
guess?

What do you think?

Best regards,

Vivien

Vivien Kraus (1):
  gnu: p11-kit: fix build 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


base-commit: 74038cf66e3a8cdcd9d97a81d9176c3cdefdaaf7
-- 
2.39.2




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Tue, 25 Apr 2023 16:26:01 GMT) Full text and rfc822 format available.

Message #20 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 62916 <at> debbugs.gnu.org
Subject: [PATCH v2 1/1] gnu: p11-kit: fix build on mingw.
Date: Tue, 25 Apr 2023 17:50:13 +0200
* 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 <at> 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




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Tue, 25 Apr 2023 21:36:02 GMT) Full text and rfc822 format available.

Message #23 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 62916 <at> debbugs.gnu.org
Subject: [PATCH v3 0/1] Simpler fix for p11-kit <at> mingw
Date: Tue, 25 Apr 2023 23:33:12 +0200
I noticed that the only problem was the way to generate the list of symbols
for the DLL. So I don’t have to fix anything in the build system.

Vivien Kraus (1):
  gnu: p11-kit: fix build on mingw.

 gnu/packages/tls.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


base-commit: 74038cf66e3a8cdcd9d97a81d9176c3cdefdaaf7
-- 
2.39.2




Information forwarded to guix-patches <at> gnu.org:
bug#62916; Package guix-patches. (Tue, 25 Apr 2023 21:37:01 GMT) Full text and rfc822 format available.

Message #26 received at 62916 <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 62916 <at> debbugs.gnu.org
Subject: [PATCH v3 1/1] gnu: p11-kit: fix build on mingw.
Date: Tue, 25 Apr 2023 17:50:13 +0200
* 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/packages/tls.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index e0da7757e0..38126e2326 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -165,7 +165,10 @@ (define-public p11-kit
      (list #:configure-flags
            ;; Use the default certificates so that users such as flatpak
            ;; find them.  See <https://issues.guix.gnu.org/49957>.
-           #~'("--with-trust-paths=/etc/ssl/certs/ca-certificates.crt")
+           #~'("--with-trust-paths=/etc/ssl/certs/ca-certificates.crt"
+               #$@(if (target-mingw?)
+                      #~("--disable-ld-version-script")
+                      #~()))
            #:phases #~(modify-phases %standard-phases
                         #$@(if (hurd-target?)
                                #~((add-after 'unpack 'apply-hurd-patch
-- 
2.39.2




This bug report was last modified 337 days ago.

Previous Next


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