diff options
-rw-r--r-- | recipes-kernel/dtc/files/setuptools.patch | 34 | ||||
-rw-r--r-- | recipes-kernel/dtc/files/ssize.patch | 35 | ||||
-rw-r--r-- | recipes-kernel/dtc/python3-dtc_1.6.1.bb | 14 |
3 files changed, 3 insertions, 80 deletions
diff --git a/recipes-kernel/dtc/files/setuptools.patch b/recipes-kernel/dtc/files/setuptools.patch deleted file mode 100644 index 3d37ebdc..00000000 --- a/recipes-kernel/dtc/files/setuptools.patch +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From c691776ddb26acbd3674722caafacaf7b6e3e807 Mon Sep 17 00:00:00 2001 | ||
5 | From: Rob Herring <robh@kernel.org> | ||
6 | Date: Wed, 10 Nov 2021 19:11:32 -0600 | ||
7 | Subject: [PATCH] pylibfdt: Use setuptools instead of distutils | ||
8 | |||
9 | The use of setuptools is favored over distutils. setuptools is needed to | ||
10 | support building Python 'wheels' and for pip support. | ||
11 | |||
12 | Signed-off-by: Rob Herring <robh@kernel.org> | ||
13 | Message-Id: <20211111011135.2386773-2-robh@kernel.org> | ||
14 | Signed-off-by: David Gibson <david@gibson.dropbear.id.au> | ||
15 | --- | ||
16 | pylibfdt/setup.py | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py | ||
20 | index ef40f15..f065a59 100755 | ||
21 | --- a/pylibfdt/setup.py | ||
22 | +++ b/pylibfdt/setup.py | ||
23 | @@ -10,7 +10,7 @@ Copyright (C) 2017 Google, Inc. | ||
24 | Written by Simon Glass <sjg@chromium.org> | ||
25 | """ | ||
26 | |||
27 | -from distutils.core import setup, Extension | ||
28 | +from setuptools import setup, Extension | ||
29 | import os | ||
30 | import re | ||
31 | import sys | ||
32 | -- | ||
33 | 2.25.1 | ||
34 | |||
diff --git a/recipes-kernel/dtc/files/ssize.patch b/recipes-kernel/dtc/files/ssize.patch deleted file mode 100644 index 3156896c..00000000 --- a/recipes-kernel/dtc/files/ssize.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | Python 3.10 has made it mandatory that the 'string+length` formats use ssize_t | ||
2 | instead of int, so define the magic symbol and upcast the ints from the libfdt | ||
3 | API to ssize_t. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
7 | |||
8 | diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i | ||
9 | index 51ee801..075ef70 100644 | ||
10 | --- a/pylibfdt/libfdt.i | ||
11 | +++ b/pylibfdt/libfdt.i | ||
12 | @@ -1044,9 +1044,9 @@ typedef uint32_t fdt32_t; | ||
13 | $result = Py_None; | ||
14 | else | ||
15 | %#if PY_VERSION_HEX >= 0x03000000 | ||
16 | - $result = Py_BuildValue("y#", $1, *arg4); | ||
17 | + $result = Py_BuildValue("y#", $1, (Py_ssize_t)*arg4); | ||
18 | %#else | ||
19 | - $result = Py_BuildValue("s#", $1, *arg4); | ||
20 | + $result = Py_BuildValue("s#", $1, (Py_ssize_t)*arg4); | ||
21 | %#endif | ||
22 | } | ||
23 | |||
24 | diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py | ||
25 | index ef40f15..88ff7d1 100755 | ||
26 | --- a/pylibfdt/setup.py | ||
27 | +++ b/pylibfdt/setup.py | ||
28 | @@ -42,6 +42,7 @@ def get_version(): | ||
29 | libfdt_module = Extension( | ||
30 | '_libfdt', | ||
31 | sources=[os.path.join(srcdir, 'libfdt.i')], | ||
32 | + define_macros=[('PY_SSIZE_T_CLEAN', None)], | ||
33 | include_dirs=[os.path.join(srcdir, '../libfdt')], | ||
34 | libraries=['fdt'], | ||
35 | library_dirs=[os.path.join(top_builddir, 'libfdt')], | ||
diff --git a/recipes-kernel/dtc/python3-dtc_1.6.1.bb b/recipes-kernel/dtc/python3-dtc_1.6.1.bb index 6e02db64..dd2c6e6e 100644 --- a/recipes-kernel/dtc/python3-dtc_1.6.1.bb +++ b/recipes-kernel/dtc/python3-dtc_1.6.1.bb | |||
@@ -4,27 +4,19 @@ DESCRIPTION = "A python library for the Device Tree Compiler, a tool used to man | |||
4 | SECTION = "bootloader" | 4 | SECTION = "bootloader" |
5 | LICENSE = "GPLv2 | BSD-2-Clause" | 5 | LICENSE = "GPLv2 | BSD-2-Clause" |
6 | 6 | ||
7 | DEPENDS = "flex-native bison-native swig-native libyaml dtc" | 7 | DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc" |
8 | 8 | ||
9 | SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \ | 9 | SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \ |
10 | file://setuptools.patch \ | 10 | " |
11 | file://ssize.patch" | ||
12 | 11 | ||
13 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" | 12 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |
14 | 13 | ||
15 | LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90" | 14 | LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90" |
16 | 15 | ||
17 | SRCREV = "ecaeb97fec013973360e94888a7de645f084345c" | 16 | SRCREV = "4048aed12b81c5a0154b9af438edc99ec7d2b6a1" |
18 | 17 | ||
19 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
20 | 19 | ||
21 | inherit setuptools3 pkgconfig | 20 | inherit setuptools3 pkgconfig |
22 | 21 | ||
23 | SETUPTOOLS_SETUP_PATH = "${S}/pylibfdt" | ||
24 | |||
25 | do_configure:prepend() { | ||
26 | oe_runmake -C "${S}" version_gen.h | ||
27 | mv "${S}/version_gen.h" "${SETUPTOOLS_SETUP_PATH}/" | ||
28 | } | ||
29 | |||
30 | BBCLASSEXTEND = "native nativesdk" | 22 | BBCLASSEXTEND = "native nativesdk" |