author | Evangelos Foutras
<foutrelis@archlinux.org> 2021-12-02 00:29:52 UTC |
committer | Evangelos Foutras
<foutrelis@archlinux.org> 2021-12-02 00:29:52 UTC |
parent | c523a42eb4e89934ded25557cc854bcfbee1bacb |
PKGBUILD | +5 | -2 |
python310.patch | +28 | -0 |
diff --git a/PKGBUILD b/PKGBUILD index ba54222..358612e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -10,11 +10,14 @@ arch=(x86_64) 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 } diff --git a/python310.patch b/python310.patch new file mode 100644 index 0000000..174b0b0 --- /dev/null +++ b/python310.patch @@ -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')],