Skip to contentSkip to conversation

package/gnutls: make the OpenSSL compatibility library optional

PATCH New unixmania at gmail.com 2 participants 2 messages Aug 15, 2019 – Aug 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gnutls: make the OpenSSL compatibility library optional

From: Carlos Santos <[email protected]>

Add a BR2_PACKAGE_GNUTLS_OPENSSL option, disabled by default since it is not used by any package that depends on gnutls.

The library is licensed under GPLv3, which can be a problem for embedded systems due to the so-called anti-tivoization clause.

---
Tested building all packages that depend on gnutls.

---
 package/gnutls/Config.in | 5 +++++
 package/gnutls/gnutls.mk | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
package/gnutls/Config.in +5 -0
index 7e8dcc1e4f..15b930b6bd 100644
@@ -16,6 +16,11 @@ config BR2_PACKAGE_GNUTLS
 
 if BR2_PACKAGE_GNUTLS
 
+config BR2_PACKAGE_GNUTLS_OPENSSL
+	bool "OpenSSL compatibility library"
+	help
+	  Install OpenSSL compatibility library.
+
 config BR2_PACKAGE_GNUTLS_TOOLS
 	bool "install tools"
 	select BR2_PACKAGE_ARGP_STANDALONE \
package/gnutls/gnutls.mk +7 -1
index 4f40b896ff..f3f430ead0 100644
@@ -8,8 +8,13 @@ GNUTLS_VERSION_MAJOR = 3.6
 GNUTLS_VERSION = $(GNUTLS_VERSION_MAJOR).8
 GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
 GNUTLS_SITE = https://www.gnupg.org/ftp/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
+ifeq ($(BR2_PACKAGE_GNUTLS_OPENSSL),y)
 GNUTLS_LICENSE = LGPL-2.1+ (core library), GPL-3.0+ (gnutls-openssl library)
-GNUTLS_LICENSE_FILES = doc/COPYING doc/COPYING.LESSER
+GNUTLS_LICENSE_FILES = doc/COPYING.LESSER doc/COPYING
+else
+GNUTLS_LICENSE = LGPL-2.1+ (core library)
+GNUTLS_LICENSE_FILES = doc/COPYING.LESSER
+endif
 GNUTLS_DEPENDENCIES = host-pkgconf libtasn1 nettle pcre
 GNUTLS_CONF_OPTS = \
 	--disable-doc \
@@ -20,6 +25,7 @@ GNUTLS_CONF_OPTS = \
 	--enable-openssl-compatibility \
 	--with-librt-prefix=$(STAGING_DIR) \
 	--without-tpm \
+	$(if $(BR2_PACKAGE_GNUTLS_OPENSSL),--enable,--disable)-openssl-compatibility \
 	$(if $(BR2_PACKAGE_GNUTLS_TOOLS),--enable-tools,--disable-tools)
 GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
 	ac_cv_header_wchar_h=$(if $(BR2_USE_WCHAR),yes,no) \
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 package/gnutls: make the OpenSSL compatibility library optional

Quoted 9 lines · On Thu, 15 Aug 2019 19:19:33 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

Add a BR2_PACKAGE_GNUTLS_OPENSSL option, disabled by default since it is not used by any package that depends on gnutls.

The library is licensed under GPLv3, which can be a problem for embedded systems due to the so-called anti-tivoization clause.

We normally don't apply such changes in master after -rc1, but considering the fact that it allows to disable a GPLv3 part of the library, I found it important enough to have in master.

package/gnutls/gnutls.mk GNUTLS_VERSION_MAJOR = 3.6 · line 17

Quoted 8 lines
package/gnutls/gnutls.mk +6 -1
+ifeq ($(BR2_PACKAGE_GNUTLS_OPENSSL),y)
 GNUTLS_LICENSE = LGPL-2.1+ (core library), GPL-3.0+ (gnutls-openssl library)
-GNUTLS_LICENSE_FILES = doc/COPYING doc/COPYING.LESSER
+GNUTLS_LICENSE_FILES = doc/COPYING.LESSER doc/COPYING
+else
+GNUTLS_LICENSE = LGPL-2.1+ (core library)
+GNUTLS_LICENSE_FILES = doc/COPYING.LESSER
+endif

You don't need to repeat the license details for both cases, you can simply append to them when the gnutls-openssl library is enabled. For the _LICENSE variable, this requires a trick:

FOO_LICENSE := $(FOO_LICENSE), GPL-3.0+ (gnutls-openssl library)

Applied to master with this changed. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com