diff options
| author | Crucible <crucible@localhost> | 2026-09-22 22:22:36 -0500 |
|---|---|---|
| committer | Crucible <crucible@localhost> | 2026-09-22 22:22:36 -0500 |
| commit | 979af70cb83395cab2f32ea1124be68ebaced6b6 (patch) | |
| tree | 18b16739f860a2a652c26c5499fad05922119e31 /dev-libs | |
| parent | 954147f7add6ada356dec519e829e0a2437da5af (diff) | |
| download | baldeagleos-repo-979af70cb83395cab2f32ea1124be68ebaced6b6.tar.gz baldeagleos-repo-979af70cb83395cab2f32ea1124be68ebaced6b6.tar.xz baldeagleos-repo-979af70cb83395cab2f32ea1124be68ebaced6b6.zip | |
Publish baldeagleos-repo candidate 0000000338-20260922-221634
Diffstat (limited to 'dev-libs')
| -rw-r--r-- | dev-libs/expat/expat-2.8.5.ebuild | 2 | ||||
| -rw-r--r-- | dev-libs/libratbag/files/libratbag-0.18-swig-4.5.patch | 87 | ||||
| -rw-r--r-- | dev-libs/libratbag/libratbag-0.18.ebuild | 1 |
3 files changed, 89 insertions, 1 deletions
diff --git a/dev-libs/expat/expat-2.8.5.ebuild b/dev-libs/expat/expat-2.8.5.ebuild index 527ab9bf0f69..3526fc8e1260 100644 --- a/dev-libs/expat/expat-2.8.5.ebuild +++ b/dev-libs/expat/expat-2.8.5.ebuild @@ -12,7 +12,7 @@ SRC_URI="https://github.com/libexpat/libexpat/releases/download/R_${PV//\./_}/ex LICENSE="MIT" SLOT="0" -KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris" IUSE="examples static-libs test unicode" RESTRICT="!test? ( test )" BDEPEND="unicode? ( ${AUTOTOOLS_DEPEND} )" diff --git a/dev-libs/libratbag/files/libratbag-0.18-swig-4.5.patch b/dev-libs/libratbag/files/libratbag-0.18-swig-4.5.patch new file mode 100644 index 000000000000..1a19a1cd57f3 --- /dev/null +++ b/dev-libs/libratbag/files/libratbag-0.18-swig-4.5.patch @@ -0,0 +1,87 @@ +https://bugs.gentoo.org/983043 +https://github.com/libratbag/libratbag/pull/1878 +https://github.com/libratbag/libratbag/commit/1f4efda9553a5efbbd5be49def22f993ef1410ca + +From 1f4efda9553a5efbbd5be49def22f993ef1410ca Mon Sep 17 00:00:00 2001 +From: Ayoze Torres <53948812+ayozetr@users.noreply.github.com> +Date: Wed, 12 Aug 2026 19:07:56 +0100 +Subject: [PATCH] swig: use the Python 3 C API instead of the removed PyInt_* + aliases (#1878) + +src/libratbag.i calls PyInt_Check(), PyInt_AsLong() and PyInt_FromLong(). +Those are Python 2 functions; they only ever worked because SWIG emitted +compatibility macros mapping them onto their PyLong_* counterparts in the +generated wrapper. SWIG 4.5.0 dropped those macros, so the generated +libratbag.c no longer compiles: + + libratbag.c: In function '_wrap_ratbag_device_get_vendor_id': + libratbag.c:4583:17: error: implicit declaration of function + 'PyInt_FromLong'; did you mean 'PyLong_FromLong'? + libratbag.c:4583:15: error: assignment to 'PyObject *' from 'int' makes + pointer from integer without a cast [-Wint-conversion] + +Call the PyLong_* functions directly. The bindings are generated with +swig -py3, so there is no Python 2 build to keep working, and the macros +they replace expanded to exactly these functions. + +Built and verified on Arch Linux with swig 4.5.0, Python 3.14, meson 1.12.0, gcc 15: `_libratbag.so` and `_hidpp.so` link cleanly with the change and fail without it. + +Co-authored-by: Jitka Plesnikova <jplesnik@redhat.com> +Signed-off-by: Stephen Kitt <skitt@debian.org> +--- a/src/libratbag.i ++++ b/src/libratbag.i +@@ -21,12 +21,12 @@ + $1 = (unsigned int *) malloc(($2 + 1) * sizeof(unsigned int)); + for (i = 0; i < $2; i++) { + PyObject *s = PyList_GetItem($input, i); +- if (!PyInt_Check(s)) { ++ if (!PyLong_Check(s)) { + free($1); + PyErr_SetString(PyExc_ValueError, "List items must be integers"); + return NULL; + } +- $1[i] = PyInt_AsLong(s); ++ $1[i] = PyLong_AsLong(s); + } + $1[i] = 0; + } +@@ -34,7 +34,7 @@ + %typemap(argout) (unsigned int *resolutions, size_t nres) { + unsigned int i; + for (i = 0; i < $2; i++) { +- PyList_SetItem($input, i, PyInt_FromLong($1[i])); ++ PyList_SetItem($input, i, PyLong_FromLong($1[i])); + } + } + +@@ -61,24 +61,24 @@ + + /* uintXX_t mapping: Python -> C */ + %typemap(in) uint8_t { +- $1 = (uint8_t) PyInt_AsLong($input); ++ $1 = (uint8_t) PyLong_AsLong($input); + } + %typemap(in) uint16_t { +- $1 = (uint16_t) PyInt_AsLong($input); ++ $1 = (uint16_t) PyLong_AsLong($input); + } + %typemap(in) uint32_t { +- $1 = (uint32_t) PyInt_AsLong($input); ++ $1 = (uint32_t) PyLong_AsLong($input); + } + + /* uintXX_t mapping: C -> Python */ + %typemap(out) uint8_t { +- $result = PyInt_FromLong((long) $1); ++ $result = PyLong_FromLong((long) $1); + } + %typemap(out) uint16_t { +- $result = PyInt_FromLong((long) $1); ++ $result = PyLong_FromLong((long) $1); + } + %typemap(out) uint32_t { +- $result = PyInt_FromLong((long) $1); ++ $result = PyLong_FromLong((long) $1); + } + + /* Parse the header file to generate wrappers */ diff --git a/dev-libs/libratbag/libratbag-0.18.ebuild b/dev-libs/libratbag/libratbag-0.18.ebuild index 95061afdda37..60ceae257e0c 100644 --- a/dev-libs/libratbag/libratbag-0.18.ebuild +++ b/dev-libs/libratbag/libratbag-0.18.ebuild @@ -71,6 +71,7 @@ CONFIG_CHECK="~HIDRAW" PATCHES=( "${FILESDIR}"/${PN}-0.17-basename.patch + "${FILESDIR}"/${PN}-0.18-swig-4.5.patch ) pkg_setup() { |
