Skip to contentSkip to conversation

Add host packages of gnupg2 and its dependencies

PATCH Applied Ben Hutchings via buildroot 1 participant 13 messages Apr 12, 2024 – Jul 15, 2024

lore
Share & tools
lore
#0 lore raw

cover Add host packages of gnupg2 and its dependencies

Currently we can build a host package of the obsolete GnuPG 1 but not GnuPG 2. This series adds host packages of gnupg2 and the various libraries it depends on, but with only the host gnupg2 package being directly selectable.

Ben.

Ben Hutchings (6):
package/libgpg-error: Add host package
package/libnpth: Add host package
package/libassuan: Add host package
package/libgcrypt: Add host package
package/libksba: Add host package
package/gnupg2: Add host package

 package/Config.in.host               |  1 +
 package/gnupg2/Config.in.host        | 13 +++++++++++++
 package/gnupg2/gnupg2.mk             | 11 +++++++++++
 package/libassuan/libassuan.mk       |  5 +++++
 package/libgcrypt/libgcrypt.mk       |  4 ++++
 package/libgpg-error/libgpg-error.mk |  4 ++++
 package/libksba/libksba.mk           |  4 ++++
 package/libnpth/libnpth.mk           |  1 +
 8 files changed, 43 insertions(+)
 create mode 100644 package/gnupg2/Config.in.host
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/6 package/libgpg-error: Add host package

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libgpg-error/libgpg-error.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libgpg-error/libgpg-error.mk +4 -0
index 60e3da9de1..9c8233b492 100644
@@ -19,6 +19,9 @@ LIBGPG_ERROR_CONF_OPTS = \
 	--enable-install-gpg-error-config \
 	--disable-tests \
 	--disable-languages
+HOST_LIBGPG_ERROR_CONF_OPTS = \
+	--enable-install-gpg-error-config \
+	--disable-languages
 
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 LIBGPG_ERROR_CONF_OPTS += --enable-threads
@@ -27,3 +30,4 @@ LIBGPG_ERROR_CONF_OPTS += --disable-threads
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 1/6] package/libgpg-error: Add host package

Hello Ben,

Quoted 7 lines · On Fri, 12 Apr 2024 23:43:05 +0200 Ben Hutchings via buildroot…

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libgpg-error/libgpg-error.mk | 4 ++++
 1 file changed, 4 insertions(+)

Thanks a lot, but I merger an earlier patch from Yann E. Morin that did the same and also added --enable-threads, because we always have thread support on the host.

So I marked this patch as Not Applicable.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 2/6 package/libnpth: Add host package

In reply to Ben Hutchings via buildroot

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libnpth/libnpth.mk | 1 +
 1 file changed, 1 insertion(+)
package/libnpth/libnpth.mk +1 -0
index ecfef863f4..5109bb53f9 100644
@@ -12,3 +12,4 @@ LIBNPTH_LICENSE_FILES = COPYING.LIB
 LIBNPTH_INSTALL_STAGING = YES
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH 2/6] package/libnpth: Add host package

Quoted 7 lines · On Fri, 12 Apr 2024 23:43:06 +0200 Ben Hutchings via buildroot…

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libnpth/libnpth.mk | 1 +
 1 file changed, 1 insertion(+)

I've added:

+HOST_LIBNPTH_CONF_OPTS = --disable-tests

and applied. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH 3/6 package/libassuan: Add host package

In reply to Ben Hutchings via buildroot

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libassuan/libassuan.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libassuan/libassuan.mk +5 -0
index fb95a6fd67..d4800d698f 100644
@@ -14,9 +14,14 @@ LIBASSUAN_DEPENDENCIES = libgpg-error
 LIBASSUAN_CONF_OPTS = \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr
 LIBASSUAN_CONFIG_SCRIPTS = libassuan-config
+HOST_LIBASSUAN_DEPENDENCIES = host-libgpg-error
+HOST_LIBASSUAN_CONF_OPTS = \
+	--with-gpg-error-prefix=$(HOST_DIR)
 
 # Force the path to "gpgrt-config" (from the libgpg-error package) to
 # avoid using the one on host, if present.
 LIBASSUAN_CONF_ENV += GPGRT_CONFIG=$(STAGING_DIR)/usr/bin/gpgrt-config
+HOST_LIBASSUAN_CONF_ENV += GPGRT_CONFIG=$(HOST_DIR)/bin/gpgrt-config
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

Re: [Buildroot] [PATCH 3/6] package/libassuan: Add host package

Quoted 7 lines · On Fri, 12 Apr 2024 23:43:07 +0200 Ben Hutchings via buildroot…

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libassuan/libassuan.mk | 5 +++++
 1 file changed, 5 insertions(+)

I merged another similar patch from Yann. But your patch made me realize Yann patches had mistakenly added some HOST_*_CONFIG_SCRIPTS variables, which were not relevant, so I cooked some commits to drop them.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH 4/6 package/libgcrypt: Add host package

In reply to Ben Hutchings via buildroot

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libgcrypt/libgcrypt.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libgcrypt/libgcrypt.mk +4 -0
index 2e4bf7448e..af342c6948 100644
@@ -13,6 +13,7 @@ LIBGCRYPT_INSTALL_STAGING = YES
 LIBGCRYPT_DEPENDENCIES = libgpg-error
 LIBGCRYPT_CONFIG_SCRIPTS = libgcrypt-config
 LIBGCRYPT_CPE_ID_VENDOR = gnupg
+HOST_LIBGCRYPT_DEPENDENCIES = host-libgpg-error
 
 # Patching configure.ac and Makefile.am in 0001
 LIBGCRYPT_AUTORECONF = YES
@@ -20,6 +21,8 @@ LIBGCRYPT_CONF_OPTS = \
 	--disable-tests \
 	$(if $(BR2_OPTIMIZE_0),--disable-ppc-crypto-support,) \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr
+HOST_LIBGCRYPT_CONF_OPTS = \
+	--with-gpg-error-prefix=$(HOST_DIR)
 
 # disable asm for broken archs
 ifeq ($(BR2_i386)$(BR2_m68k_cf),y)
@@ -32,3 +35,4 @@ LIBGCRYPT_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

Re: [Buildroot] [PATCH 4/6] package/libgcrypt: Add host package

Quoted 21 lines · On Fri, 12 Apr 2024 23:43:08 +0200 Ben Hutchings via buildroot…

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libgcrypt/libgcrypt.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libgcrypt/libgcrypt.mk +1 -0
index 2e4bf7448e..af342c6948 100644
@@ -13,6 +13,7 @@ LIBGCRYPT_INSTALL_STAGING = YES
 LIBGCRYPT_DEPENDENCIES = libgpg-error
 LIBGCRYPT_CONFIG_SCRIPTS = libgcrypt-config
 LIBGCRYPT_CPE_ID_VENDOR = gnupg
+HOST_LIBGCRYPT_DEPENDENCIES = host-libgpg-error
 
 # Patching configure.ac and Makefile.am in 0001
 LIBGCRYPT_AUTORECONF = YES

package/libgcrypt/libgcrypt.mk LIBGCRYPT_CONF_OPTS = \ · line 25

Quoted 5 lines
package/libgcrypt/libgcrypt.mk +2 -0
@@ -20,6 +21,8 @@ LIBGCRYPT_CONF_OPTS = \
 	--disable-tests \
 	$(if $(BR2_OPTIMIZE_0),--disable-ppc-crypto-support,) \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr
+HOST_LIBGCRYPT_CONF_OPTS = \
+	--with-gpg-error-prefix=$(HOST_DIR)

I've added --disable-tests here, and applied. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

PATCH 5/6 package/libksba: Add host package

In reply to Ben Hutchings via buildroot

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libksba/libksba.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libksba/libksba.mk +4 -0
index 52ad5fbeec..dc4ad8d241 100644
@@ -13,9 +13,13 @@ LIBKSBA_CPE_ID_VENDOR = gnupg
 LIBKSBA_INSTALL_STAGING = YES
 LIBKSBA_DEPENDENCIES = libgpg-error
 LIBKSBA_CONF_OPTS = --with-gpg-error-prefix=$(STAGING_DIR)/usr
+HOST_LIBKSBA_DEPENDENCIES = host-libgpg-error
+HOST_LIBKSBA_CONF_OPTS = --with-gpg-error-prefix=$(HOST_DIR)
 
 # Force the path to "gpgrt-config" (from the libgpg-error package) to
 # avoid using the one on host, if present.
 LIBKSBA_CONF_ENV += GPGRT_CONFIG=$(STAGING_DIR)/usr/bin/gpgrt-config
+HOST_LIBKSBA_CONF_ENV += GPGRT_CONFIG=$(HOST_DIR)/bin/gpgrt-config
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

Re: [Buildroot] [PATCH 5/6] package/libksba: Add host package

Quoted 7 lines · On Fri, 12 Apr 2024 23:43:09 +0200 Ben Hutchings via buildroot…

This is needed to support a host build of gnupg2. It is not directly selectable.

---
 package/libksba/libksba.mk | 4 ++++
 1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#11 lore raw

PATCH 6/6 package/gnupg2: Add host package

In reply to Ben Hutchings via buildroot
---
 package/Config.in.host        |  1 +
 package/gnupg2/Config.in.host | 13 +++++++++++++
 package/gnupg2/gnupg2.mk      | 11 +++++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 package/gnupg2/Config.in.host
package/Config.in.host +1 -0
index f03ca16b7b..635a7ebc13 100644
@@ -43,6 +43,7 @@ menu "Host utilities"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
 	source "package/gnupg/Config.in.host"
+	source "package/gnupg2/Config.in.host"
 	source "package/go/Config.in.host"
 	source "package/go-bootstrap-stage1/Config.in.host"
 	source "package/go-bootstrap-stage2/Config.in.host"
package/gnupg2/Config.in.host new file +13 -0
new file mode 100644
index 0000000000..c636cbee8b
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_HOST_GNUPG2
+	bool "host gnupg2"
+	depends on !BR2_PACKAGE_HOST_GNUPG
+	help
+	  GnuPG is the GNU project's complete and free implementation
+	  of the OpenPGP standard as defined by RFC4880. GnuPG allows
+	  to encrypt and sign your data and communication, features a
+	  versatile key management system as well as access modules
+	  for all kinds of public key directories. GnuPG, also known
+	  as GPG, is a command line tool with features for easy
+	  integration with other applications.
+
+	  http://gnupg.org/
package/gnupg2/gnupg2.mk +11 -0
index 986da4790c..b7aa50f801 100644
@@ -14,6 +14,8 @@ GNUPG2_CPE_ID_PRODUCT = gnupg
 GNUPG2_SELINUX_MODULES = gpg
 GNUPG2_DEPENDENCIES = zlib libgpg-error libgcrypt libassuan libksba libnpth \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
+HOST_GNUPG2_DEPENDENCIES = host-zlib host-libgpg-error host-libgcrypt host-libassuan \
+	host-libksba host-libnpth host-pkgconf
 
 GNUPG2_CONF_OPTS = \
 	--disable-rpath \
@@ -23,9 +25,17 @@ GNUPG2_CONF_OPTS = \
 	--with-ksba-prefix=$(STAGING_DIR)/usr \
 	--with-npth-prefix=$(STAGING_DIR)/usr
 
+HOST_GNUPG2_CONF_OPTS = \
+	--with-gpg-error-prefix=$(HOST_DIR) \
+	--with-libgcrypt-prefix=$(HOST_DIR) \
+	--with-libassuan-prefix=$(HOST_DIR) \
+	--with-ksba-prefix=$(HOST_DIR) \
+	--with-npth-prefix=$(HOST_DIR)
+
 # Force the path to "gpgrt-config" (from the libgpg-error package) to
 # avoid using the one on host, if present.
 GNUPG2_CONF_ENV += GPGRT_CONFIG=$(STAGING_DIR)/usr/bin/gpgrt-config
+HOST_GNUPG2_CONF_ENV += GPGRT_CONFIG=$(HOST_DIR)/bin/gpgrt-config
 
 ifneq ($(BR2_PACKAGE_GNUPG2_GPGV),y)
 define GNUPG2_REMOVE_GPGV
@@ -71,3 +81,4 @@ GNUPG2_CONF_OPTS += --disable-sqlite
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

Re: [Buildroot] [PATCH 6/6] package/gnupg2: Add host package

package/gnupg2/gnupg2.mk GNUPG2_CONF_OPTS = \ · line 33

Quoted 6 lines · On Fri, 12 Apr 2024 23:43:10 +0200 Ben Hutchings via buildroot…
package/gnupg2/gnupg2.mk +6 -0
+HOST_GNUPG2_CONF_OPTS = \
+	--with-gpg-error-prefix=$(HOST_DIR) \
+	--with-libgcrypt-prefix=$(HOST_DIR) \
+	--with-libassuan-prefix=$(HOST_DIR) \
+	--with-ksba-prefix=$(HOST_DIR) \
+	--with-npth-prefix=$(HOST_DIR)

I've added a whole bunch of --disable/--without to disable optional features that we don't support in the host package, to avoid the ./configure from mistakenly detecting stuff provided by the system:

+       --disable-bzip2 \
+       --disable-gnutls \
+       --disable-ccid-driver \
+       --without-readline \
+       --disable-sqlite

Applied with this change. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot