python3-dtc: update to version v1.6.1-39-g4048aed

As part of this update:

  - we drop our backported patches
  - simplify the recipe to use setuptools-scm
  - remove the need to generate version_gen.h
  - adapt to setup.py at ${S}
  - and include following commits:

    4048aed setup.py: fix out of tree build
    ff5afb9 Handle integer overflow in check_property_phandle_args()
    ca72944 README: Explain how to add a new API function
    c0c2e11 Fix a UB when fdt_get_string return null
    cd5f69c tests: setprop_inplace: use xstrdup instead of unchecked strdup
    a04f690 pylibfdt: add Property.as_*int*_array()
    8310271 pylibfdt: add Property.as_stringlist()
    d152126 Fix Python crash on getprop deallocation
    17739b7 Support 'r' format for printing raw bytes with fdtget
    45f3d1a libfdt: overlay: make overlay_get_target() public
    c19a4ba libfdt: fix an incorrect integer promotion
    1cc41b1 pylibfdt: Add packaging metadata
    db72398 README: Update pylibfdt install instructions
    383e148 pylibfdt: fix with Python 3.10
    23b56cb pylibfdt: Move setup.py to the top level
    69a7607 pylibfdt: Split setup.py author name and email
    0b106a7 pylibfdt: Use setuptools_scm for the version
    c691776 pylibfdt: Use setuptools instead of distutils
    5216f3f libfdt: Add static lib to meson build
    4eda259 CI: Cirrus: bump used FreeBSD from 12.1 to 13.0
    0a3a9d3 checks: Add an interrupt-map check
    8fd2474 checks: Ensure '#interrupt-cells' only exists in interrupt providers
    d8d1a9a checks: Drop interrupt provider '#address-cells' check
    52a16fd checks: Make interrupt_provider check dependent on interrupts_extended_is_cell
    37fd700 treesource: Maintain phandle label/path on output
    e33ce1d flattree: Use '\n', not ';' to separate asm pseudo-ops
    d24cc18 asm: Use assembler macros instead of cpp macros
    ff3a30c asm: Use .asciz and .ascii instead of .string
    5eb5927 fdtdump: fix -Werror=int-to-pointer-cast
    0869f82 libfdt: Add ALIGNMENT error string
    69595a1 checks: Fix bus-range check
    72d09e2 Makefile: add -Wsign-compare to warning options
    b587787 checks: Fix signedness comparisons warnings
    69bed6c dtc: Wrap phandle validity check
    9102211 fdtget: Fix signedness comparisons warnings
    d966f08 tests: Fix signedness comparisons warnings
    ecfb438 dtc: Fix signedness comparisons warnings: pointer diff
    5bec74a dtc: Fix signedness comparisons warnings: reservednum
    24e7f51 fdtdump: Fix signedness comparisons warnings
    b6910be Bump version to v1.6.1

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2022-01-17 11:33:49 -05:00
parent 34c2f32ec1
commit cb0884d16e
3 changed files with 3 additions and 80 deletions

View File

@ -1,34 +0,0 @@
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
From c691776ddb26acbd3674722caafacaf7b6e3e807 Mon Sep 17 00:00:00 2001
From: Rob Herring <robh@kernel.org>
Date: Wed, 10 Nov 2021 19:11:32 -0600
Subject: [PATCH] pylibfdt: Use setuptools instead of distutils
The use of setuptools is favored over distutils. setuptools is needed to
support building Python 'wheels' and for pip support.
Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20211111011135.2386773-2-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
pylibfdt/setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py
index ef40f15..f065a59 100755
--- a/pylibfdt/setup.py
+++ b/pylibfdt/setup.py
@@ -10,7 +10,7 @@ Copyright (C) 2017 Google, Inc.
Written by Simon Glass <sjg@chromium.org>
"""
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
import os
import re
import sys
--
2.25.1

View File

@ -1,35 +0,0 @@
Python 3.10 has made it mandatory that the 'string+length` formats use ssize_t
instead of int, so define the magic symbol and upcast the ints from the libfdt
API to ssize_t.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
index 51ee801..075ef70 100644
--- a/pylibfdt/libfdt.i
+++ b/pylibfdt/libfdt.i
@@ -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 --git a/pylibfdt/setup.py b/pylibfdt/setup.py
index ef40f15..88ff7d1 100755
--- a/pylibfdt/setup.py
+++ b/pylibfdt/setup.py
@@ -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')],

View File

@ -4,27 +4,19 @@ DESCRIPTION = "A python library for the Device Tree Compiler, a tool used to man
SECTION = "bootloader"
LICENSE = "GPLv2 | BSD-2-Clause"
DEPENDS = "flex-native bison-native swig-native libyaml dtc"
DEPENDS = "flex-native bison-native swig-native python3-setuptools-scm-native libyaml dtc"
SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=master \
file://setuptools.patch \
file://ssize.patch"
"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
LIC_FILES_CHKSUM = "file://pylibfdt/libfdt.i;beginline=1;endline=6;md5=afda088c974174a29108c8d80b5dce90"
SRCREV = "ecaeb97fec013973360e94888a7de645f084345c"
SRCREV = "4048aed12b81c5a0154b9af438edc99ec7d2b6a1"
S = "${WORKDIR}/git"
inherit setuptools3 pkgconfig
SETUPTOOLS_SETUP_PATH = "${S}/pylibfdt"
do_configure:prepend() {
oe_runmake -C "${S}" version_gen.h
mv "${S}/version_gen.h" "${SETUPTOOLS_SETUP_PATH}/"
}
BBCLASSEXTEND = "native nativesdk"