From 56b49691abf4625d3d5915f3956b02f0fbd2ed4b Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Wed, 2 Mar 2022 22:01:50 +0100 Subject: [PATCH] package/{gnupg, gnupg2}: use gnupg2 by default This patch reverses the logic to select gnupg2 by default, while still allowing to select gnupg (v1). Quoting: https://gnupg.org/download/index.html """ GnuPG 1.4 is the old, single binary version which still support the unsafe PGP-2 keys. This branch has no dependencies on the above listed libraries or the Pinentry. However, it lacks many modern features and will receive only important updates. """ gnupg 1.4 is kept in Buildroot for now, as the package is still maintained upstream. It might still be useful is some specific cases: - it has a smaller footprint (compared to v2), - it has less dependencies (only zlib), - it has less build dependencies (can build static, no need for MMU/threads, ...) Most Linux distributions are now shipping gnupg2 by default. gnupg v1 is now more for legacy/compatibility/specific cases. There is currently only two packages selecting gnupg in Buildroot: gpgme and python-gnupg This commit also reverses the logic for those packages. However, this means we also need to propagate the dependencies of gnupg2, and still select gnupg if those dependencies are not met. To simplify this, add a blind option BR2_PACKAGE_GNUPG2_DEPENDS. Note that due to the intricacies of Kconfig dependencies, "depends on !BR2_PACKAGE_GNUPG" must *not* be part of BR2_PACKAGE_GNUPG2_DEPENDS. Signed-off-by: Julien Olivain [Arnout: rework dependency handling to make sure gnupg2 dependencies are properly propagated] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/gnupg/Config.in | 1 - package/gnupg2/Config.in | 14 ++++++++++++-- package/libgpgme/Config.in | 4 ++-- package/python-gnupg/Config.in | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/package/gnupg/Config.in b/package/gnupg/Config.in index 2db46318f1..e92fca709d 100644 --- a/package/gnupg/Config.in +++ b/package/gnupg/Config.in @@ -1,6 +1,5 @@ config BR2_PACKAGE_GNUPG bool "gnupg" - depends on !BR2_PACKAGE_GNUPG2 select BR2_PACKAGE_ZLIB help GnuPG is the GNU project's complete and free implementation diff --git a/package/gnupg2/Config.in b/package/gnupg2/Config.in index ef1817ef02..043d53554c 100644 --- a/package/gnupg2/Config.in +++ b/package/gnupg2/Config.in @@ -2,12 +2,22 @@ comment "gnupg2 needs a toolchain w/ threads and dynamic library support" depends on BR2_USE_MMU depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS -config BR2_PACKAGE_GNUPG2 - bool "gnupg2" +# helper to make it easier to select gnupg2 or gnupg; usage: +# select BR2_PACKAGE_GNUPG2 if BR2_PACKAGE_GNUPG2_DEPENDS && !BR2_PACKAGE_GNUPG +# select BR2_PACKAGE_GNUPG if !BR2_PACKAGE_GNUPG2_DEPENDS + +config BR2_PACKAGE_GNUPG2_DEPENDS + bool + default y depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpg-error depends on BR2_TOOLCHAIN_HAS_THREADS # libnpth depends on BR2_USE_MMU # libassuan, libnpth depends on !BR2_STATIC_LIBS + +config BR2_PACKAGE_GNUPG2 + bool "gnupg2" + depends on BR2_PACKAGE_GNUPG2_DEPENDS + depends on !BR2_PACKAGE_GNUPG select BR2_PACKAGE_ZLIB select BR2_PACKAGE_LIBGPG_ERROR select BR2_PACKAGE_LIBGCRYPT diff --git a/package/libgpgme/Config.in b/package/libgpgme/Config.in index 4aabd06367..16ce27d0ef 100644 --- a/package/libgpgme/Config.in +++ b/package/libgpgme/Config.in @@ -2,8 +2,8 @@ config BR2_PACKAGE_LIBGPGME bool "libgpgme" depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgpg-error depends on BR2_USE_MMU # libassuan - #gnupg is not needed to build, but at runtime. - select BR2_PACKAGE_GNUPG if !BR2_PACKAGE_GNUPG2 + select BR2_PACKAGE_GNUPG2 if BR2_PACKAGE_GNUPG2_DEPENDS && !BR2_PACKAGE_GNUPG # runtime + select BR2_PACKAGE_GNUPG if !BR2_PACKAGE_GNUPG2_DEPENDS # runtime select BR2_PACKAGE_LIBGPG_ERROR select BR2_PACKAGE_LIBASSUAN help diff --git a/package/python-gnupg/Config.in b/package/python-gnupg/Config.in index 038a940778..234792977a 100644 --- a/package/python-gnupg/Config.in +++ b/package/python-gnupg/Config.in @@ -1,6 +1,7 @@ config BR2_PACKAGE_PYTHON_GNUPG bool "python-gnupg" - select BR2_PACKAGE_GNUPG if !BR2_PACKAGE_GNUPG2 # runtime + select BR2_PACKAGE_GNUPG2 if BR2_PACKAGE_GNUPG2_DEPENDS && !BR2_PACKAGE_GNUPG # runtime + select BR2_PACKAGE_GNUPG if !BR2_PACKAGE_GNUPG2_DEPENDS # runtime help A wrapper for the Gnu Privacy Guard (GPG or GnuPG).