From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Cc: Marcus Folkesson <marcus.folkesson@gmail.com>,
Antoine Tenart <atenart@kernel.org>,
Angelo Compagnucci <angelo.compagnucci@gmail.com>,
Daniel Sangue <daniel.sangue@sangue.ch>,
James Hilliard <james.hilliard1@gmail.com>,
Giulio Benetti <giulio.benetti@benettiengineering.com>,
Pierre Floury <pierre.floury@gmail.com>
Subject: [Buildroot] [PATCH 2/7] package/libselinux: fix build with swig >= 4.5.0
Date: Sat, 5 Sep 2026 14:20:34 +0200 [thread overview]
Message-ID: <20260905122040.2054789-2-bernd@kuhls.net> (raw)
In-Reply-To: <20260905122040.2054789-1-bernd@kuhls.net>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
...ce-PyString_FromString-with-PyUnicod.patch | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 package/libselinux/0003-libselinux-Replace-PyString_FromString-with-PyUnicod.patch
diff --git a/package/libselinux/0003-libselinux-Replace-PyString_FromString-with-PyUnicod.patch b/package/libselinux/0003-libselinux-Replace-PyString_FromString-with-PyUnicod.patch
new file mode 100644
index 0000000000..a503a9cff4
--- /dev/null
+++ b/package/libselinux/0003-libselinux-Replace-PyString_FromString-with-PyUnicod.patch
@@ -0,0 +1,60 @@
+From fb518ff492cd6a286f35b415cbd7fd0f6e3faedb Mon Sep 17 00:00:00 2001
+From: Petr Lautrbach <lautrbach@redhat.com>
+Date: Thu, 6 Aug 2026 16:30:44 +0200
+Subject: [PATCH] libselinux: Replace PyString_FromString with
+ PyUnicode_FromString for SWIG 4.5.0 compatibility
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+SWIG 4.5.0 removed Python 2 C API compatibility macros (PyInt_*,
+PyString_*, SWIG_Python_str_*) from its runtime header pyhead.swg.
+These macros previously mapped deprecated Python 2 C API names to their
+Python 3 equivalents.
+
+Fixes: https://github.com/SELinuxProject/selinux/issues/538
+Authored-by: Jitka Plesníková <jplesnik@redhat.com>
+Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
+Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
+
+Upstream: https://github.com/SELinuxProject/selinux/commit/fb518ff492cd6a286f35b415cbd7fd0f6e3faedb
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/selinuxswig_python.i | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/selinuxswig_python.i b/src/selinuxswig_python.i
+index c8c08a40..74d923e4 100644
+--- a/src/selinuxswig_python.i
++++ b/src/selinuxswig_python.i
+@@ -69,7 +69,7 @@ def install(src, dest):
+ PyObject* list = PyList_New(*$2);
+ int i;
+ for (i = 0; i < *$2; i++) {
+- PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
++ PyList_SetItem(list, i, PyUnicode_FromString((*$1)[i]));
+ }
+ $result = SWIG_AppendOutput($result, list);
+ }
+@@ -123,7 +123,7 @@ def install(src, dest):
+ len++;
+ plist = PyList_New(len);
+ for (i = 0; i < len; i++) {
+- PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
++ PyList_SetItem(plist, i, PyUnicode_FromString((*$1)[i]));
+ }
+ } else {
+ plist = PyList_New(0);
+@@ -140,7 +140,7 @@ def install(src, dest):
+ if (*$1) {
+ plist = PyList_New(result);
+ for (i = 0; i < result; i++) {
+- PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
++ PyList_SetItem(plist, i, PyUnicode_FromString((*$1)[i]));
+ }
+ } else {
+ plist = PyList_New(0);
+--
+2.47.3
+
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-09-05 12:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 12:20 [Buildroot] [PATCH 1/7] package/{, lib}apparmor: bump to version 4.1.8 Bernd Kuhls
2026-09-05 12:20 ` Bernd Kuhls [this message]
2026-09-06 19:31 ` [Buildroot] [PATCH 2/7] package/libselinux: fix build with swig >= 4.5.0 Fiona Klute via buildroot
2026-09-05 12:20 ` [Buildroot] [PATCH 3/7] package/libcec: " Bernd Kuhls
2026-09-05 12:20 ` [Buildroot] [PATCH 4/7] package/libftdi1: " Bernd Kuhls
2026-09-05 12:44 ` Yegor Yefremov via buildroot
2026-09-05 12:20 ` [Buildroot] [PATCH 5/7] package/python-pylibfdt: " Bernd Kuhls
2026-09-05 12:20 ` [Buildroot] [PATCH 6/7] package/trace-cmd: " Bernd Kuhls
2026-09-05 12:20 ` [Buildroot] [PATCH 7/7] package/swig: bump version to 4.5.1 Bernd Kuhls
2026-09-05 12:45 ` Yegor Yefremov via buildroot
2026-09-06 19:33 ` Fiona Klute via buildroot
2026-09-18 19:55 ` [Buildroot] [PATCH 1/7] package/{, lib}apparmor: bump to version 4.1.8 Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260905122040.2054789-2-bernd@kuhls.net \
--to=bernd@kuhls.net \
--cc=angelo.compagnucci@gmail.com \
--cc=atenart@kernel.org \
--cc=buildroot@buildroot.org \
--cc=daniel.sangue@sangue.ch \
--cc=giulio.benetti@benettiengineering.com \
--cc=james.hilliard1@gmail.com \
--cc=marcus.folkesson@gmail.com \
--cc=pierre.floury@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox