[arch-commits] Commit in dtc/trunk (PKGBUILD python310.patch)
Evangelos Foutras
foutrelis at gemini.archlinux.org
Thu Dec 2 00:29:53 UTC 2021
Date: Thursday, December 2, 2021 @ 00:29:52
Author: foutrelis
Revision: 1061530
Fix build with Python 3.10
Added:
dtc/trunk/python310.patch
Modified:
dtc/trunk/PKGBUILD
-----------------+
PKGBUILD | 7 +++++--
python310.patch | 28 ++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-12-01 23:58:15 UTC (rev 1061529)
+++ PKGBUILD 2021-12-02 00:29:52 UTC (rev 1061530)
@@ -10,11 +10,14 @@
license=(GPL2)
makedepends=(swig python)
checkdepends=(valgrind)
-source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz)
-sha256sums=('65cec529893659a49a89740bb362f507a3b94fc8cd791e76a8d6a2b6f3203473')
+source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz
+ python310.patch)
+sha256sums=('65cec529893659a49a89740bb362f507a3b94fc8cd791e76a8d6a2b6f3203473'
+ '767b6931887018a1dd7d41bfebebd16ab78a35de06a5689f530e376ab8c6b037')
prepare() {
cd dtc-$pkgver
+ patch -Np1 -i ../python310.patch
sed -i 's/-Werror//' Makefile
}
Added: python310.patch
===================================================================
--- python310.patch (rev 0)
+++ python310.patch 2021-12-02 00:29:52 UTC (rev 1061530)
@@ -0,0 +1,28 @@
+# Backported from https://github.com/dgibson/dtc/commit/383e148b70a4
+
+diff -upr dtc-1.6.1.orig/pylibfdt/libfdt.i dtc-1.6.1/pylibfdt/libfdt.i
+--- dtc-1.6.1.orig/pylibfdt/libfdt.i 2021-06-08 10:00:49.000000000 +0300
++++ dtc-1.6.1/pylibfdt/libfdt.i 2021-12-02 02:27:27.747063911 +0200
+@@ -1044,9 +1044,9 @@ typedef uint32_t fdt32_t;
+ $result = Py_None;
+ else
+ %#if PY_VERSION_HEX >= 0x03000000
+- $result = Py_BuildValue("y#", $1, *arg4);
++ $result = Py_BuildValue("y#", $1, (Py_ssize_t)*arg4);
+ %#else
+- $result = Py_BuildValue("s#", $1, *arg4);
++ $result = Py_BuildValue("s#", $1, (Py_ssize_t)*arg4);
+ %#endif
+ }
+
+diff -upr dtc-1.6.1.orig/pylibfdt/setup.py dtc-1.6.1/pylibfdt/setup.py
+--- dtc-1.6.1.orig/pylibfdt/setup.py 2021-06-08 10:00:49.000000000 +0300
++++ dtc-1.6.1/pylibfdt/setup.py 2021-12-02 02:28:05.914736698 +0200
+@@ -42,6 +42,7 @@ def get_version():
+ libfdt_module = Extension(
+ '_libfdt',
+ sources=[os.path.join(srcdir, 'libfdt.i')],
++ define_macros=[('PY_SSIZE_T_CLEAN', None)],
+ include_dirs=[os.path.join(srcdir, '../libfdt')],
+ libraries=['fdt'],
+ library_dirs=[os.path.join(top_builddir, 'libfdt')],
More information about the arch-commits
mailing list