package/libdnet: fix python build
PATCH 1/1 package/libdnet: fix python build
Fix the following build failure raised with python >= 3.11 by backporting a patch and adding libbsd dependency as suggested by upstream in https://github.com/ofalk/libdnet/issues/74:
./dnet.c: In function '__Pyx_AddTraceback':
./dnet.c:456:62: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct _frame'}
456 | #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
| ^~
./dnet.c:25190:5: note: in expansion of macro '__Pyx_PyFrame_SetLineNumber'
25190 | __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~Fixes:
- http://autobuild.buildroot.org/results/78dff4b514fb7c510f5a745ee6cbbc049ceb2794
--- ...02-Correct-path-to-string-h-from-bsd.patch | 26 +++++++++++++++++++ package/libdnet/Config.in | 11 ++++++++ package/libdnet/libdnet.mk | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 package/libdnet/0002-Correct-path-to-string-h-from-bsd.patch
package/libdnet/0002-Correct-path-to-string-h-from-bsd.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 347c23da1ec6f19b0b0143d53edcc209e522bbf2 Mon Sep 17 00:00:00 2001 +From: Oliver Falk <[email protected]> +Date: Wed, 29 Jun 2022 13:27:45 +0200 +Subject: [PATCH] Correct path to string.h (from bsd); Fixes #74 + +[Retrieved (and backported) from: +https://github.com/ofalk/libdnet/commit/347c23da1ec6f19b0b0143d53edcc209e522bbf2] +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + python/dnet.c | 64 +++++++++++++++++++++++-------------------------- + python/dnet.pyx | 2 +- + 2 files changed, 31 insertions(+), 35 deletions(-) + +diff --git a/python/dnet.pyx b/python/dnet.pyx +index d9cbc90..af65a11 100644 +--- a/python/dnet.pyx ++++ b/python/dnet.pyx +@@ -40,7 +40,7 @@ cdef extern from *: + unsigned long htonl(unsigned long n) + unsigned long ntohl(unsigned long n) + +-cdef extern from "string.h": ++cdef extern from "bsd/string.h": + int strlcpy(char *dst, char *src, int size) + + cdef __memcpy(char *dst, object src, int n):
package/libdnet/Config.in +11 -0
@@ -10,11 +10,22 @@ if BR2_PACKAGE_LIBDNET config BR2_PACKAGE_LIBDNET_PYTHON bool "libdnet python module" + depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS depends on BR2_PACKAGE_PYTHON3 + depends on !BR2_STATIC_LIBS # libbsd + depends on BR2_TOOLCHAIN_HAS_THREADS # libbsd + depends on BR2_USE_WCHAR # libbsd + select BR2_PACKAGE_LIBBSD help dnet module for python comment "dnet module for python requires python3 package" + depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS depends on !BR2_PACKAGE_PYTHON3 +comment "dnet module for python needs a toolchain w/ dynamic library, threads, wchar" + depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_USE_WCHAR + endif
package/libdnet/libdnet.mk +1 -1
@@ -17,7 +17,7 @@ LIBDNET_CONFIG_SCRIPTS = dnet-config LIBDNET_DEPENDENCIES = host-pkgconf ifeq ($(BR2_PACKAGE_LIBDNET_PYTHON),y) -LIBDNET_DEPENDENCIES += host-python-cython python3 +LIBDNET_DEPENDENCIES += libbsd host-python-cython python3 LIBDNET_CONF_OPTS += --with-python=$(HOST_DIR)/bin LIBDNET_MAKE_ENV += $(PKG_PYTHON_DISTUTILS_ENV) LIBDNET_INSTALL_TARGET_OPTS = $(LIBDNET_MAKE_OPTS) DESTDIR=$(TARGET_DIR) INSTALL_STRIP_FLAG=-s install-exec
Signature · 6 lines
2.35.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni via buildroot
AppliedQuoted 15 lines · On Wed, 28 Dec 2022 23:00:44 +0100 Fabrice Fontaine…
Fix the following build failure raised with python >= 3.11 by backporting a patch and adding libbsd dependency as suggested by upstream in https://github.com/ofalk/libdnet/issues/74:
./dnet.c: In function '
__Pyx_AddTraceback':
./dnet.c:456:62: error: invalid use of incomplete typedef 'PyFrameObject' {aka 'struct_frame'}
456 | #define__Pyx_PyFrame_SetLineNumber(frame, lineno)(frame)->f_lineno = (lineno)
| ^~
./dnet.c:25190:5: note: in expansion of macro '__Pyx_PyFrame_SetLineNumber'25190 | __Pyx_PyFrame_SetLineNumber(py_frame, py_line); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~Fixes:
- http://autobuild.buildroot.org/results/78dff4b514fb7c510f5a745ee6cbbc049ceb2794
Quoted 7 lines
Signed-off-by Fabrice Fontaine <[email protected]>--- ...02-Correct-path-to-string-h-from-bsd.patch | 26 +++++++++++++++++++ package/libdnet/Config.in | 11 ++++++++ package/libdnet/libdnet.mk | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 package/libdnet/0002-Correct-path-to-string-h-from-bsd.patch
Applied to master, thanks.
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot