Skip to contentSkip to conversation

package/x11r7/xlib_libXfont2: fix usage of libbsd

PATCH New Bernd Kuhls 2 participants 2 messages Oct 13, 2019 – Oct 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/x11r7/xlib_libXfont2: fix usage of libbsd

Upstream added optional support for libbsd:
"Add strlcat & strlcpy fallbacks if not provided by libc nor libbsd"
https://cgit.freedesktop.org/xorg/lib/libXfont/commit/?id=d4c941ea8b1dc07a14efce656bff58d31a14c985

and forgot to define HAVE_LIBBSD.

Also add libbsd as optional dependency because the build error occured only when libbsd was built before building xlib_libXfont2.

Fixes:
http://autobuild.buildroot.net/results/165/165f9f948419fc69fbf6b9281d759b37bb7d40c6/

---
 ...ne-HAVE_LIBBSD-when-libbsd-was-found.patch | 33 +++++++++++++++++++
 .../x11r7/xlib_libXfont2/xlib_libXfont2.mk    |  6 ++++
 2 files changed, 39 insertions(+)
 create mode 100644 package/x11r7/xlib_libXfont2/0001-configure-define-HAVE_LIBBSD-when-libbsd-was-found.patch
package/x11r7/xlib_libXfont2/0001-configure-define-HAVE_LIBBSD-when-libbsd-was-found.patch new file +33 -0
new file mode 100644
index 0000000000..ae2462e55d
@@ -0,0 +1,33 @@
+From 10202b813f86e3f4d477fd82ee7fceac3bc2ebd0 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Sun, 13 Oct 2019 21:21:28 +0200
+Subject: [PATCH] configure: define HAVE_LIBBSD when libbsd was found
+
+Source of the patch:
+http://lists.busybox.net/pipermail/buildroot/2019-October/261510.html
+
+Patch sent upstream:
+https://gitlab.freedesktop.org/xorg/lib/libxfont/merge_requests/6
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f507c28..131713d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,7 +52,8 @@ AC_CHECK_HEADERS([endian.h poll.h sys/poll.h])
+ 
+ # Checks for library functions.
+ AC_CHECK_FUNCS([poll readlink])
+-AC_SEARCH_LIBS([strlcat], [bsd])
++AC_SEARCH_LIBS([strlcat], [bsd],
++  [AC_DEFINE(HAVE_LIBBSD,1,[Has libbsd])])
+ AC_CONFIG_LIBOBJ_DIR([src/util])
+ AC_REPLACE_FUNCS([reallocarray strlcat strlcpy])
+ 
+-- 
+2.20.1
+
package/x11r7/xlib_libXfont2/xlib_libXfont2.mk +6 -0
index cc3f474c64..611b8af548 100644
@@ -10,6 +10,8 @@ XLIB_LIBXFONT2_SITE = http://xorg.freedesktop.org/releases/individual/lib
 XLIB_LIBXFONT2_LICENSE = MIT
 XLIB_LIBXFONT2_LICENSE_FILES = COPYING
 XLIB_LIBXFONT2_INSTALL_STAGING = YES
+# 0001-configure-define-HAVE_LIBBSD-when-libbsd-was-found.patch
+XLIB_LIBXFONT2_AUTORECONF = YES
 XLIB_LIBXFONT2_DEPENDENCIES = \
 	freetype \
 	xlib_libfontenc \
@@ -17,6 +19,10 @@ XLIB_LIBXFONT2_DEPENDENCIES = \
 	xorgproto \
 	xfont_encodings
 
+ifeq ($(BR2_PACKAGE_LIBBSD),y)
+XLIB_LIBXFONT2_DEPENDENCIES += libbsd
+endif
+
 HOST_XLIB_LIBXFONT2_DEPENDENCIES = \
 	host-freetype \
 	host-xlib_libfontenc \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/x11r7/xlib_libXfont2: fix usage of libbsd

Quoted 12 lines · On Sun, 13 Oct 2019 21:54:43 +0200 Bernd Kuhls <[email protected]> wrote:

Upstream added optional support for libbsd:
"Add strlcat & strlcpy fallbacks if not provided by libc nor libbsd"
https://cgit.freedesktop.org/xorg/lib/libXfont/commit/?id=d4c941ea8b1dc07a14efce656bff58d31a14c985

and forgot to define HAVE_LIBBSD.

Also add libbsd as optional dependency because the build error occured only when libbsd was built before building xlib_libXfont2.

Fixes:
http://autobuild.buildroot.net/results/165/165f9f948419fc69fbf6b9281d759b37bb7d40c6/

Quoted 6 lines
---
 ...ne-HAVE_LIBBSD-when-libbsd-was-found.patch | 33 +++++++++++++++++++
 .../x11r7/xlib_libXfont2/xlib_libXfont2.mk    |  6 ++++
 2 files changed, 39 insertions(+)
 create mode 100644 package/x11r7/xlib_libXfont2/0001-configure-define-HAVE_LIBBSD-when-libbsd-was-found.patch

Applied to master, thanks.

Thomas

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