Skip to content

Commit

Permalink
add webos-gnutls: gnutls 3.3.30 for target only
Browse files Browse the repository at this point in the history
Should be compatible back to webOS 3.0. LG is unwilling to use later
versions of gnutls because some parts were relicensed under the GPLv3.
(However, only the tools and OpenSSL compatibility layer are GPLv3, and
LG does not ship those. The issue may be dependencies such as nettle and
gmp.)

gnutls 2.x (libgnutls.so.26):
- webOS 1, 2: 2.12.23

gnutls 3.x (libgnutls.so.28):
- webOS 3.x: 3.3.5
- webOS 4.x: 3.3.27
- webOS 5-8: 3.3.30
  • Loading branch information
throwaway96 committed Feb 5, 2024
1 parent 86f2762 commit d661e06
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 1 deletion.
1 change: 1 addition & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,7 @@ menu "WebOS"
source "package/luna-service2/Config.in"
source "package/umediaserver/Config.in"
source "package/webos-gmp/Config.in"
source "package/webos-gnutls/Config.in"
source "package/webos-userland/Config.in"
source "package/webos-wayland-extensions/Config.in"
source "package/webos-userland/Config.in"
Expand Down
2 changes: 1 addition & 1 deletion package/glib-networking/glib-networking.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GLIB_NETWORKING_LICENSE_FILES = COPYING
GLIB_NETWORKING_CPE_ID_VENDOR = gnome

ifeq ($(BR2_PACKAGE_GNUTLS),y)
GLIB_NETWORKING_DEPENDENCIES += gnutls
GLIB_NETWORKING_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GNUTLS),webos-gnutls,gnutls)
GLIB_NETWORKING_CONF_OPTS += -Dgnutls=enabled
else
GLIB_NETWORKING_CONF_OPTS += -Dgnutls=disabled
Expand Down
3 changes: 3 additions & 0 deletions package/gnutls/gnutls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,8 @@ endif

GNUTLS_CONF_ENV += LIBS="$(GNUTLS_LIBS)"

# Don't build for target if using webOS package instead
ifneq ($(BR2_PACKAGE_WEBOS_GNUTLS),y)
$(eval $(autotools-package))
endif
$(eval $(host-autotools-package))
15 changes: 15 additions & 0 deletions package/webos-gnutls/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config BR2_PACKAGE_WEBOS_GNUTLS
bool "gnutls 3.3.30"
depends on BR2_WEBOS_COMPAT
depends on BR2_PACKAGE_GNUTLS
help
The version of gnutls used on webOS 5-8. It should be compatible
back to webOS 3.x in theory.

webOS 1, 2: 2.12.23 (libgnutls.so.26)
webOS 3.x: 3.3.5 (libgnutls.so.28)
webOS 4.x: 3.3.27 (libgnutls.so.28)
webOS 5-8: 3.3.30 (libgnutls.so.28)

This replaces the normal buildroot gnutls on the target (but
not host).
5 changes: 5 additions & 0 deletions package/webos-gnutls/webos-gnutls.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Locally calculated after checking pgp signature
sha256 41d70107ead3de2f12390909a05eefc9a88def6cd1f0d90ea82a7dac8b8effee gnutls-3.3.30.tar.xz
# Locally calculated
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
sha256 6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3 COPYING.LESSER
75 changes: 75 additions & 0 deletions package/webos-gnutls/webos-gnutls.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
################################################################################
#
# webos-gnutls
#
################################################################################

WEBOS_GNUTLS_VERSION_MAJOR = 3.3
WEBOS_GNUTLS_VERSION = $(WEBOS_GNUTLS_VERSION_MAJOR).30
WEBOS_GNUTLS_SOURCE = gnutls-$(WEBOS_GNUTLS_VERSION).tar.xz
WEBOS_GNUTLS_SITE = https://www.gnupg.org/ftp/gcrypt/gnutls/v$(WEBOS_GNUTLS_VERSION_MAJOR)
WEBOS_GNUTLS_LICENSE = LGPL-2.1+ (core library)
WEBOS_GNUTLS_LICENSE_FILES = COPYING.LESSER
WEBOS_GNUTLS_DEPENDENCIES = host-pkgconf nettle
WEBOS_GNUTLS_CPE_ID_VENDOR = gnu
# Yocto meta-gplv2 sets --disable-crywrap.
# libgnutls-openssl is not present on webOS (also GPLv3).
# libtasn1 is statically linked on at least webOS 4.0+ but not on webOS 1.
# libp11-kit is not present on webOS.
# There does not seem to be a default trust store.
WEBOS_GNUTLS_CONF_OPTS = \
--disable-crywrap \
--disable-openssl-compatibility \
--with-included-libtasn1 \
--without-p11-kit \
--with-default-trust-store-file=no \
--disable-doc \
--disable-libdane \
--disable-rpath \
--disable-tests \
--disable-guile \
--with-libnettle-prefix=$(STAGING_DIR)/usr \
--without-libdl-prefix \
--without-libiconv-prefix \
--without-libintl-prefix \
--without-libnsl-prefix \
--without-libpthread-prefix \
--without-librt-prefix \
--without-libz-prefix \
--without-tpm
WEBOS_GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
ac_cv_header_wchar_h=$(if $(BR2_USE_WCHAR),yes,no) \
gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no) \
gt_cv_c_wint_t=$(if $(BR2_USE_WCHAR),yes,no) \
gl_cv_func_gettimeofday_clobber=no
WEBOS_GNUTLS_INSTALL_STAGING = YES

# libidn support for nommu must exclude the crywrap wrapper (uses fork)
WEBOS_GNUTLS_CONF_OPTS += $(if $(BR2_USE_MMU),,--disable-crywrap)

ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
WEBOS_GNUTLS_CONF_OPTS += --enable-cryptodev
WEBOS_GNUTLS_DEPENDENCIES += cryptodev-linux
endif

ifeq ($(BR2_PACKAGE_ZLIB),y)
WEBOS_GNUTLS_CONF_OPTS += --with-zlib
WEBOS_GNUTLS_DEPENDENCIES += zlib
else
WEBOS_GNUTLS_CONF_OPTS += --without-zlib
endif

# Some examples in doc/examples use wchar
define WEBOS_GNUTLS_DISABLE_DOCS
$(SED) 's/ doc / /' $(@D)/Makefile.in
endef

define WEBOS_GNUTLS_DISABLE_TOOLS
$(SED) 's/\$$(PROGRAMS)//' $(@D)/src/Makefile.in
$(SED) 's/) install-exec-am/)/' $(@D)/src/Makefile.in
endef

WEBOS_GNUTLS_POST_PATCH_HOOKS += WEBOS_GNUTLS_DISABLE_DOCS
WEBOS_GNUTLS_POST_PATCH_HOOKS += WEBOS_GNUTLS_DISABLE_TOOLS

$(eval $(autotools-package))

0 comments on commit d661e06

Please sign in to comment.