kumquat-buildroot/package/libdnet/0002-Correct-path-to-string-h-from-bsd.patch
Fabrice Fontaine 14bb74b461 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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-12-29 09:59:12 +01:00

27 lines
958 B
Diff

From 347c23da1ec6f19b0b0143d53edcc209e522bbf2 Mon Sep 17 00:00:00 2001
From: Oliver Falk <oliver@linux-kernel.at>
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 <fontaine.fabrice@gmail.com>
---
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):