Skip to contentSkip to conversation

libidn2: new package

PATCH New Fabrice Fontaine 3 participants 11 messages May 1, 2018 – May 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 libidn2: new package

Libidn2 is an implementation of the IDNA2008 + TR46 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893, TR 46).

http://www.gnu.org/software/libidn/

---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/libidn2/Config.in    | 17 +++++++++++++++++
 package/libidn2/libidn2.hash |  8 ++++++++
 package/libidn2/libidn2.mk   | 29 +++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk
DEVELOPERS +1 -0
index d27c03c96a..ea93da0508 100644
@@ -687,6 +687,7 @@ F:	package/libgee/
 F:	package/libglib2/
 F:	package/libgtk2/
 F:	package/libgtk3/
+F:	package/libidn2/
 F:	package/libmatroska/
 F:	package/libmpdclient/
 F:	package/libupnp/
package/Config.in +1 -0
index dd61789181..552cbf3ea2 100644
@@ -1410,6 +1410,7 @@ menu "Networking"
 	source "package/libgsasl/Config.in"
 	source "package/libhttpparser/Config.in"
 	source "package/libidn/Config.in"
+	source "package/libidn2/Config.in"
 	source "package/libiscsi/Config.in"
 	source "package/libkrb5/Config.in"
 	source "package/libldns/Config.in"
package/libidn2/Config.in new file +17 -0
new file mode 100644
index 0000000000..38b1378990
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_LIBIDN2
+	bool "libidn2"
+	help
+	  Libidn2 is an implementation of the IDNA2008 + TR46
+	  specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893,
+	  TR 46).
+
+	  http://www.gnu.org/software/libidn/
+
+if BR2_PACKAGE_LIBIDN2
+
+config BR2_PACKAGE_LIBIDN2_BINARY
+	bool "idn2 binary"
+	help
+	  Install idn2 command line tool
+
+endif
package/libidn2/libidn2.hash new file +8 -0
new file mode 100644
index 0000000000..980f78f50d
@@ -0,0 +1,8 @@
+# From Calculated locally after checking signature
+sha256	644b6b03b285fb0ace02d241d59483d98bc462729d8bb3608d5cad5532f3d2f0	libidn2-2.0.4.tar.gz
+
+# Hash for license files:
+sha256	4fa501e804195b4136c9cec4bc510365b8cbaf4bc075d6401a77ae0213370457	COPYING
+sha256	8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643	COPYINGv2
+sha256	da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768	COPYING.LESSERv3
+sha256	01d621eef165cf4d3d3dbb737aa0699178d94c6f18cf87e9dde6db3ca7790f46	COPYING.unicode
package/libidn2/libidn2.mk new file +29 -0
new file mode 100644
index 0000000000..e6331d730c
@@ -0,0 +1,29 @@
+################################################################################
+#
+# libidn2
+#
+################################################################################
+
+LIBIDN2_VERSION = 2.0.4
+LIBIDN2_SITE = $(BR2_GNU_MIRROR)/libidn
+LIBIDN2_LICENSE = GPL-2.0+, LGPL-3.0+
+LIBIDN2_LICENSE_FILES = COPYING COPYINGv2 COPYING.LESSERv3 COPYING.unicode
+LIBIDN2_DEPENDENCIES = \
+	host-pkgconf \
+	$(TARGET_NLS_DEPENDENCIES) \
+	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
+LIBIDN2_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
+LIBIDN2_DEPENDENCIES += libunistring
+endif
+
+define LIBIDN2_REMOVE_BINARY
+	rm -f $(TARGET_DIR)/usr/bin/idn2
+endef
+
+ifneq ($(BR2_PACKAGE_LIBIDN2_BINARY),y)
+LIBIDN2_POST_INSTALL_TARGET_HOOKS += LIBIDN2_REMOVE_BINARY
+endif
+
+$(eval $(autotools-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/7 libcurl: replace libidn by libidn2

libidn has been replaced by libidn2 since 7.51.0 (October 2016):
https://github.com/curl/curl/commit/9c91ec778104ae3b744b39444d544e82d5ee9ece

---
 package/libcurl/libcurl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +7 -1
index a3e66d094c..b75e9fb2e9 100644
@@ -9,7 +9,6 @@ LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.xz
 LIBCURL_SITE = https://curl.haxx.se/download
 LIBCURL_DEPENDENCIES = host-pkgconf \
 	$(if $(BR2_PACKAGE_ZLIB),zlib) \
-	$(if $(BR2_PACKAGE_LIBIDN),libidn) \
 	$(if $(BR2_PACKAGE_RTMPDUMP),rtmpdump)
 LIBCURL_LICENSE = curl
 LIBCURL_LICENSE_FILES = COPYING
@@ -68,6 +67,13 @@ else
 LIBCURL_CONF_OPTS += --disable-ares
 endif
 
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+LIBCURL_DEPENDENCIES += libidn2
+LIBCURL_CONF_OPTS += --with-libidn2
+else
+LIBCURL_CONF_OPTS += --without-libidn2
+endif
+
 # Configure curl to support libssh2
 ifeq ($(BR2_PACKAGE_LIBSSH2),y)
 LIBCURL_DEPENDENCIES += libssh2
Signature · 1 line
2.14.1
#2 lore raw

PATCH 3/7 wget: add optional dependency for libidn2

In reply to Fabrice Fontaine
---
 package/wget/wget.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/wget/wget.mk +7 -0
index 23e4c8acca..c3c792f1e8 100644
@@ -26,6 +26,13 @@ else
 WGET_CONF_OPTS += --without-ssl
 endif
 
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+WGET_CONF_OPTS += --with-libidn
+WGET_DEPENDENCIES += libidn2
+else
+WGET_CONF_OPTS += --without-libidn
+endif
+
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
 WGET_DEPENDENCIES += util-linux
 endif
Signature · 1 line
2.14.1
#3 lore raw

PATCH 4/7 gnutls: add optional libidn2 support

In reply to Fabrice Fontaine
---
 package/gnutls/gnutls.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/gnutls/gnutls.mk +7 -0
index 6be7c6e27e..3d1a627781 100644
@@ -68,6 +68,13 @@ else
 GNUTLS_CONF_OPTS += --without-idn
 endif
 
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+GNUTLS_CONF_OPTS += --with-libidn2
+GNUTLS_DEPENDENCIES += libidn2
+else
+GNUTLS_CONF_OPTS += --without-libidn2
+endif
+
 ifeq ($(BR2_PACKAGE_P11_KIT),y)
 GNUTLS_CONF_OPTS += --with-p11-kit
 GNUTLS_DEPENDENCIES += p11-kit
Signature · 1 line
2.14.1
#4 lore raw

PATCH 5/6 lftp: switch from libidn to libidn2

In reply to Fabrice Fontaine

libidn has been removed since 4.8.1 (August 2017):
https://github.com/lavv17/lftp/commit/731abec393f3deff490c77d1d55eb7219bc6b556

---
 package/lftp/lftp.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/lftp/lftp.mk +4 -4
index e1ca0533ee..68f3dfce2c 100644
@@ -41,11 +41,11 @@ else
 LFTP_CONF_OPTS += --without-openssl
 endif
 
-ifeq ($(BR2_PACKAGE_LIBIDN),y)
-LFTP_DEPENDENCIES += libidn
-LFTP_CONF_OPTS += --with-libidn=$(STAGING_DIR)/usr
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+LFTP_DEPENDENCIES += libidn2
+LFTP_CONF_OPTS += --with-libidn2=$(STAGING_DIR)/usr
 else
-LFTP_CONF_OPTS += --without-libidn
+LFTP_CONF_OPTS += --without-libidn2
 endif
 
 # Remove /usr/share/lftp
Signature · 1 line
2.14.1
#5 lore raw

PATCH 6/7 systemd: add optional dependency on libidn2

In reply to Fabrice Fontaine
---
 package/systemd/systemd.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/systemd/systemd.mk +7 -0
index db7fb43636..bdf4fb32f2 100644
@@ -75,12 +75,19 @@ else
 SYSTEMD_CONF_OPTS += -Daudit=false
 endif
 
+# Both options can't be selected at the same time so prefer libidn2
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+SYSTEMD_DEPENDENCIES += libidn2
+SYSTEMD_CONF_OPTS += -Dlibidn2=true
+else
+SYSTEMD_CONF_OPTS += -Dlibidn2=false
 ifeq ($(BR2_PACKAGE_LIBIDN),y)
 SYSTEMD_DEPENDENCIES += libidn
 SYSTEMD_CONF_OPTS += -Dlibidn=true
 else
 SYSTEMD_CONF_OPTS += -Dlibidn=false
 endif
+endif
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
 SYSTEMD_DEPENDENCIES += libseccomp
Signature · 1 line
2.14.1
#6 lore raw

PATCH 6/7 systemd: add optional dependency on libidn2

Hello,

package/systemd/systemd.mk else · line 90

Quoted 13 lines · Fabrice Fontaine
package/systemd/systemd.mk +7 -0
+# Both options can't be selected at the same time so prefer libidn2
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+SYSTEMD_DEPENDENCIES += libidn2
+SYSTEMD_CONF_OPTS += -Dlibidn2=true
+else
+SYSTEMD_CONF_OPTS += -Dlibidn2=false
 ifeq ($(BR2_PACKAGE_LIBIDN),y)
 SYSTEMD_DEPENDENCIES += libidn
 SYSTEMD_CONF_OPTS += -Dlibidn=true
 else
 SYSTEMD_CONF_OPTS += -Dlibidn=false
 endif
+endif

This was a bit complicated so I've replaced with:

# Both options can't be selected at the same time so prefer libidn2 ifeq ($(BR2_PACKAGE_LIBIDN2),y)
SYSTEMD_DEPENDENCIES += libidn2
SYSTEMD_CONF_OPTS += -Dlibidn2=true -Dlibidn=false
else ifeq ($(BR2_PACKAGE_LIBIDN),y)
SYSTEMD_DEPENDENCIES += libidn
SYSTEMD_CONF_OPTS += -Dlibidn=true -Dlibidn2=false
else
SYSTEMD_CONF_OPTS += -Dlibidn=false -Dlibidn2=true
endif

which I believe is simpler and more in line with what we do in Buildroot usually.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH 7/7 whois: add libidn2 support

In reply to Fabrice Fontaine

libidn2 support is enabled since February 2017 (5.2.15):
https://github.com/rfc1036/whois/commit/8ed6d730959b1f988dd43a511c40b9419bb2b0db

---
 package/whois/whois.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/whois/whois.mk +5 -0
index 22117cf3aa..18071ab6bd 100644
@@ -27,6 +27,11 @@ WHOIS_DEPENDENCIES += libidn
 WHOIS_MAKE_ENV += HAVE_LIBIDN=1
 endif
 
+ifeq ($(BR2_PACKAGE_LIBIDN2),y)
+WHOIS_DEPENDENCIES += libidn2
+WHOIS_MAKE_ENV += HAVE_LIBIDN2=1
+endif
+
 ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
 WHOIS_BUILD_TARGETS =
 WHOIS_INSTALL_TARGETS = install
Signature · 1 line
2.14.1
#8 lore raw

PATCH 1/7 libidn2: new package

In reply to Fabrice Fontaine

Hi Fabrice,

Quoted 5 lines · Fabrice Fontaine

Libidn2 is an implementation of the IDNA2008 + TR46 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893, TR 46).

http://www.gnu.org/software/libidn/

So, basically libidn2 replaces libidn. Do we really want to support both? Yes,
obviously the API changed, but that happens all the time when bumping packages. So, the question is what gives the best user experience...

The problem with adding libidn2 is that a user who currently has libidn and
libcurl enabled, after updating Buildroot, will suddenly loose IDN support with no warning...

On the other hand, if a user has selected libidn and is using it in some
package outside of Buildroot, then that package will fail to build entirely, with no (easy) way to recovery. But how likely is it that libidn is used in an external package?

But first, of course, if we want to just bump libidn then we have to make sure
that all packages support libidn2. That means the following packages have to be
checked: dnsmasq, ghostscript, libgsasl, mutt, omxplayer, prosody.

Quoted 2 lines

[snip]

package/libidn2/Config.in line 2

Quoted 8 lines
package/libidn2/Config.in new file +2 -0
new file mode 100644
index 0000000000..38b1378990
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_LIBIDN2
+	bool "libidn2"

Can it be parallel-installed with libidn or does it need a depends on
!BR2_PACKAGE_LIBIDN?

Quoted 6 lines
package/libidn2/Config.in new file +6 -0
+	help
+	  Libidn2 is an implementation of the IDNA2008 + TR46
+	  specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893,
+	  TR 46).
+
+	  http://www.gnu.org/software/libidn/

[snip]

package/libidn2/Config.in

Quoted 12 lines
package/libidn2/Config.in new file +12 -0
+LIBIDN2_VERSION = 2.0.4
+LIBIDN2_SITE = $(BR2_GNU_MIRROR)/libidn
+LIBIDN2_LICENSE = GPL-2.0+, LGPL-3.0+
+LIBIDN2_LICENSE_FILES = COPYING COPYINGv2 COPYING.LESSERv3 COPYING.unicode
+LIBIDN2_DEPENDENCIES = \
+	host-pkgconf \
+	$(TARGET_NLS_DEPENDENCIES) \
+	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
+LIBIDN2_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
+LIBIDN2_DEPENDENCIES += libunistring

No --enable/disable option for this?

Also, don't the java and C# bindings exist any more?

package/libidn2/Config.in

Quoted 5 lines
package/libidn2/Config.in new file +5 -0
+endif
+
+define LIBIDN2_REMOVE_BINARY
+	rm -f $(TARGET_DIR)/usr/bin/idn2
+endef

Small nit: we prefer to have the define of the hook inside the condition as well.

Regards,
Arnout

Quoted 7 lines
package/libidn2/Config.in new file +6 -0
+
+ifneq ($(BR2_PACKAGE_LIBIDN2_BINARY),y)
+LIBIDN2_POST_INSTALL_TARGET_HOOKS += LIBIDN2_REMOVE_BINARY
+endif
+
+$(eval $(autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#9 lore raw

PATCH 1/7 libidn2: new package

Dear Arnout,

2018-05-02 23:51 GMT+02:00 Arnout Vandecappelle <[email protected]>:

Quoted 15 lines

Hi Fabrice,

Quoted 5 lines · Fabrice Fontaine

Libidn2 is an implementation of the IDNA2008 + TR46 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893, TR 46).

http://www.gnu.org/software/libidn/

So, basically libidn2 replaces libidn. Do we really want to support both?
Yes,
obviously the API changed, but that happens all the time when bumping packages.
So, the question is what gives the best user experience...

Quoted 6 lines

The problem with adding libidn2 is that a user who currently has libidn
and
libcurl enabled, after updating Buildroot, will suddenly loose IDN support with
no warning...

Actually, IDN support on libcurl is already broken in buildroot since November 2016 as libcurl only supports libidn2 since version 7.51.0:
https://github.com/curl/curl/commit/9c91ec778104ae3b744b39444d544e82d5ee9ece
.

Quoted 8 lines

On the other hand, if a user has selected libidn and is using it in some
package outside of Buildroot, then that package will fail to build entirely,
with no (easy) way to recovery. But how likely is it that libidn is used in an
external package?

Quoted 6 lines

But first, of course, if we want to just bump libidn then we have to make
sure
that all packages support libidn2. That means the following packages have to be
checked: dnsmasq, ghostscript, libgsasl, mutt, omxplayer, prosody.

Actually, that's what I have tried to do (see my patch's serie):
- dnsmaq supports both packages: libidn and libidn2 (and it prefers libidn2)
- systemd supports both packages but only one can enable at the same time (see my patch)
- ghostscript, ligsasl, mutt, omxplayer, prosody supports only libidn
- libcurl, wget, gnutls, lftp supports only libidn2 (again that means that IDN support is currently broken with libcurl/lftp)
- whois supports both packages in the version embedded in buildroot (5.2.17) but libidn supports will be removed if we bump to latest release (5.3.0).
So, I think the only option is to support both packages in buildroot. Most recent packages made the jump to libidn2 but old ones won't be updated any time soon.

Quoted 4 lines
Quoted 2 lines

[snip]

Quoted 12 lines

package/libidn2/Config.in line 2

Quoted 8 lines
package/libidn2/Config.in new file +2 -0
new file mode 100644
index 0000000000..38b1378990
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_LIBIDN2
+     bool "libidn2"

Can it be parallel-installed with libidn or does it need a depends on
!BR2_PACKAGE_LIBIDN?

Yes, it can be parallel-installed.

Quoted 13 lines
Quoted 7 lines
package/libidn2/Config.in new file +6 -0
+     help
+       Libidn2 is an implementation of the IDNA2008 + TR46
+       specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893,
+       TR 46).
+
+       http://www.gnu.org/software/libidn/

[snip]

package/libidn2/Config.in

Quoted 4 lines
package/libidn2/Config.in new file +4 -0
+LIBIDN2_VERSION = 2.0.4
+LIBIDN2_SITE = $(BR2_GNU_MIRROR)/libidn
+LIBIDN2_LICENSE = GPL-2.0+, LGPL-3.0+
+LIBIDN2_LICENSE_FILES = COPYING COPYINGv2 COPYING.LESSERv3

COPYING.unicode

Quoted 11 lines

package/libidn2/Config.in

Quoted 8 lines
package/libidn2/Config.in new file +8 -0
+LIBIDN2_DEPENDENCIES = \
+     host-pkgconf \
+     $(TARGET_NLS_DEPENDENCIES) \
+     $(if $(BR2_PACKAGE_LIBICONV),libiconv)
+LIBIDN2_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_LIBUNISTRING),y)
+LIBIDN2_DEPENDENCIES += libunistring

No --enable/disable option for this?

Nope, there is only a test "$ac_cv_libunistring" = "yes" in configure.ac

Quoted 3 lines

Also, don't the java and C# bindings exist any more?

Yes, these bindings don't exist anymore

Quoted 10 lines

package/libidn2/Config.in

Quoted 6 lines
package/libidn2/Config.in new file +5 -0
+endif
+
+define LIBIDN2_REMOVE_BINARY
+     rm -f $(TARGET_DIR)/usr/bin/idn2
+endef

Small nit: we prefer to have the define of the hook inside the condition
as well.

OK, I can fix this if you want, I have just copy/paste libidn.mk.

Quoted 13 lines

Regards,
Arnout

package/libidn2/Config.in

Quoted 7 lines
package/libidn2/Config.in new file +6 -0
+
+ifneq ($(BR2_PACKAGE_LIBIDN2_BINARY),y)
+LIBIDN2_POST_INSTALL_TARGET_HOOKS += LIBIDN2_REMOVE_BINARY
+endif
+
+$(eval $(autotools-package))

--

Quoted 7 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

Best Regards,

Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180503/a5746874/attachment.html>

#10 lore raw

PATCH 1/7 libidn2: new package

In reply to Fabrice Fontaine

Hello,

Quoted 7 lines · Fabrice Fontaine

Libidn2 is an implementation of the IDNA2008 + TR46 specifications (RFC 5890, RFC 5891, RFC 5892, RFC 5893, TR 46).

http://www.gnu.org/software/libidn/

Quoted 10 lines
---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/libidn2/Config.in    | 17 +++++++++++++++++
 package/libidn2/libidn2.hash |  8 ++++++++
 package/libidn2/libidn2.mk   | 29 +++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 package/libidn2/Config.in
 create mode 100644 package/libidn2/libidn2.hash
 create mode 100644 package/libidn2/libidn2.mk

I've applied the entire series to next. I've made a few changes, so I'll comment on the two patches on which I did changes.

On this patch, here are the changes I made:

[Thomas:
- Use positive logic to test the BR2_PACKAGE_LIBIDN2_BINARY condition.
- Put the definition of LIBIDN2_REMOVE_BINARY inside the BR2_PACKAGE_LIBIDN2_BINARY condition, as suggested by Arnout.
- Adjust license details: library is under GPL-2.0+ or LGPL-3.0+, while the command line tool is under GPL-3.0+.]

Best regards,

Thomas

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