summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-kernel/dtc/files/setuptools.patch34
-rw-r--r--recipes-kernel/dtc/files/ssize.patch35
-rw-r--r--recipes-kernel/dtc/python3-dtc_1.6.1.bb14
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 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From c691776ddb26acbd3674722caafacaf7b6e3e807 Mon Sep 17 00:00:00 2001
5From: Rob Herring <robh@kernel.org>
6Date: Wed, 10 Nov 2021 19:11:32 -0600
7Subject: [PATCH] pylibfdt: Use setuptools instead of distutils
8
9The use of setuptools is favored over distutils. setuptools is needed to
10support building Python 'wheels' and for pip support.
11
12Signed-off-by: Rob Herring <robh@kernel.org>
13Message-Id: <20211111011135.2386773-2-robh@kernel.org>
14Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
15---
16 pylibfdt/setup.py | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py
20index 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--
332.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 @@
1Python 3.10 has made it mandatory that the 'string+length` formats use ssize_t
2instead of int, so define the magic symbol and upcast the ints from the libfdt
3API to ssize_t.
4
5Upstream-Status: Pending
6Signed-off-by: Ross Burton <ross.burton@arm.com>
7
8diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
9index 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
24diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py
25index 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
4SECTION = "bootloader" 4SECTION = "bootloader"
5LICENSE = "GPLv2 | BSD-2-Clause" 5LICENSE = "GPLv2 | BSD-2-Clause"
6 6
7DEPENDS = "flex-native bison-native swig-native libyaml dtc" 7DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc"
8 8
9SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \ 9SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \
10 file://setuptools.patch \ 10 "
11 file://ssize.patch"
12 11
13UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" 12UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
14 13
15LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90" 14LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90"
16 15
17SRCREV = "ecaeb97fec013973360e94888a7de645f084345c" 16SRCREV = "4048aed12b81c5a0154b9af438edc99ec7d2b6a1"
18 17
19S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
20 19
21inherit setuptools3 pkgconfig 20inherit setuptools3 pkgconfig
22 21
23SETUPTOOLS_SETUP_PATH = "${S}/pylibfdt"
24
25do_configure:prepend() {
26 oe_runmake -C "${S}" version_gen.h
27 mv "${S}/version_gen.h" "${SETUPTOOLS_SETUP_PATH}/"
28}
29
30BBCLASSEXTEND = "native nativesdk" 22BBCLASSEXTEND = "native nativesdk"