sys-apps/dtc: Sync with Gentoo

It's from Gentoo commit 391b81f99d578887755bac0df5ecc719334b1505.
This commit is contained in:
Flatcar Buildbot 2024-11-25 07:08:48 +00:00 committed by Krzesimir Nowak
parent b449da6b2d
commit b5420310c5
7 changed files with 8 additions and 211 deletions

View File

@ -1,3 +1,2 @@
DIST dtc-1.6.0.tar.xz 158584 BLAKE2B 47b15b5df7f5d87369d6daaad87f2989a80865f2fab19f89d050d390a9f8319bcd86a36e12f7cc8d62947bb4d1335769071d0e3ea0a6e16861aea163e78f4696 SHA512 15433b24f1d6b7ed1f8066d050bd1bcbf988731aa38147564e3dd04b5f69af8d69e03befdc621a768526c620425a9bdd24aad4f9ff135930d6a1eeb0625f7de3
DIST dtc-1.7.0.tar.xz 165548 BLAKE2B de433a1034b7ef75559bf39f85695d0b275cfd17bf100c12b6186e226a65659053f9b5a053f20e64a5a0670ea3e728edd0e624c26287bd264594569408065bab SHA512 d3ba6902a9a2f2cdbaff55f12fca3cfe4a1ec5779074a38e3d8b88097c7abc981835957e8ce72971e10c131e05fde0b1b961768e888ff96d89e42c75edb53afb
DIST dtc-1.7.1.tar.xz 169524 BLAKE2B c9d9d7c60ce13c8e138ab8ddf3e8166d7cf3867ca4e5ea53621bf73514319faf6a6bac09fb96c971554db9f77dd3428e01d53990586041092a64849685d8854b SHA512 3195924b374680e367d7be6b9793691efc0441858068c8bc8d8a908db00bbae781a99184b5c5e272af39045ec58cb0f92adbdd00ff808480b635bd632aa74719
DIST dtc-1.7.2.tar.xz 169668 BLAKE2B d345027614a4caff9912b39286e35c1a889bbfd88630bac1c9c48223a6171bd6a8661342c89355e63301b395d1c238be82d21d870b0dd5fc05ae5dd552e730a6 SHA512 30f3611175a5c29556282f3f2894701a5837eb869608d89d78c280af448bbc3a5b6c83f51c28f991847c0eb7c42aa57599bbc31433f1b3b2c8d162cb2169b91f

View File

@ -1,82 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
inherit git-r3
else
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
fi
DESCRIPTION="Open Firmware device tree compiler"
HOMEPAGE="https://devicetree.org/ https://git.kernel.org/cgit/utils/dtc/dtc.git/"
LICENSE="GPL-2"
SLOT="0"
IUSE="static-libs yaml"
BDEPEND="
app-alternatives/yacc
app-alternatives/lex
virtual/pkgconfig
"
RDEPEND="yaml? ( dev-libs/libyaml )"
DEPEND="${RDEPEND}"
DOCS="
Documentation/dt-object-internal.txt
Documentation/dts-format.txt
Documentation/manual.txt
"
_emake() {
# valgrind is used only in 'make checkm'
emake \
NO_PYTHON=1 \
NO_VALGRIND=1 \
NO_YAML=$(usex !yaml 1 0) \
\
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
PKG_CONFIG="$(tc-getPKG_CONFIG)" \
\
V=1 \
\
PREFIX="${EPREFIX}/usr" \
\
LIBDIR="\$(PREFIX)/$(get_libdir)" \
\
"$@"
}
src_prepare() {
default
sed -i \
-e '/^CFLAGS =/s:=:+=:' \
-e '/^CPPFLAGS =/s:=:+=:' \
-e 's:-Werror::' \
-e 's:-g -Os::' \
Makefile || die
tc-export AR CC PKG_CONFIG
}
src_compile() {
_emake
}
src_test() {
_emake check
}
src_install() {
_emake DESTDIR="${D}" install
use static-libs || find "${ED}" -name '*.a' -delete
}

View File

@ -31,9 +31,11 @@ BDEPEND="
"
RDEPEND="
python? ( ${PYTHON_DEPS} )
yaml? ( dev-libs/libyaml )
yaml? ( >=dev-libs/libyaml-0.2.3[static-libs?] )
"
DEPEND="
${RDEPEND}
"
DEPEND="${RDEPEND}"
DOCS=(
Documentation/dt-object-internal.txt
@ -41,12 +43,6 @@ DOCS=(
Documentation/manual.txt
)
PATCHES=(
"${FILESDIR}"/${P}-meson-tests.patch
"${FILESDIR}"/${P}-meson-macos.patch
"${FILESDIR}"/fix-tests-for-Python3.12.patch
)
pkg_setup() {
if use python ; then
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
@ -54,19 +50,12 @@ pkg_setup() {
fi
}
src_prepare() {
default
if ! use test ; then
sed -i -e "/subdir('tests')/d" meson.build || die
fi
}
src_configure() {
local emesonargs=(
-Dtools=true
-Dvalgrind=disabled # only used for some tests
$(meson_feature python)
$(meson_use test tests)
$(meson_feature yaml)
)

View File

@ -11,7 +11,7 @@ if [[ ${PV} == 9999 ]] ; then
inherit git-r3
else
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
fi
DESCRIPTION="Open Firmware device tree compiler"
@ -31,7 +31,7 @@ BDEPEND="
"
RDEPEND="
python? ( ${PYTHON_DEPS} )
yaml? ( >=dev-libs/libyaml-0.2.3 )
yaml? ( >=dev-libs/libyaml-0.2.3[static-libs?] )
"
DEPEND="
${RDEPEND}

View File

@ -1,39 +0,0 @@
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=71a8b8ef0adf01af4c78c739e04533a35c1dc89c
From 71a8b8ef0adf01af4c78c739e04533a35c1dc89c Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Wed, 31 May 2023 11:41:42 -0300
Subject: libfdt: meson: Fix linking on macOS linker
-undefined error is the equivalent of --no-undefined for the macOS
linker, but -undefined would also be understood as a valid argument for
GNU ld so we use the supported linker variant.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
--- a/libfdt/meson.build
+++ b/libfdt/meson.build
@@ -16,10 +16,20 @@ sources = files(
'fdt_wip.c',
)
+link_args = []
+if cc.has_link_argument('-Wl,--no-undefined')
+ link_args += '-Wl,--no-undefined'
+else
+ # -undefined error is the equivalent of --no-undefined for the macOS linker,
+ # but -undefined would also be understood as a valid argument for GNU ld!
+ link_args += cc.get_supported_link_arguments('-Wl,-undefined,error')
+endif
+
+link_args += version_script
libfdt = library(
'fdt', sources,
version: '1.6.0',
- link_args: ['-Wl,--no-undefined', version_script],
+ link_args: link_args,
link_depends: 'version.lds',
install: true,
)
--
cgit

View File

@ -1,27 +0,0 @@
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=32174a66efa4ad19fc6a2a6422e4af2ae4f055cb
From 32174a66efa4ad19fc6a2a6422e4af2ae4f055cb Mon Sep 17 00:00:00 2001
From: David Gibson <david@gibson.dropbear.id.au>
Date: Tue, 28 Feb 2023 10:33:58 +1100
Subject: meson: Fix cell overflow tests when running from meson
Because meson always builds out-of-tree we need to reference things in the
original source tree via $SRCDIR from run_tests.sh. We forgot a couple of
cases for the cell overflow tests. Fix them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -519,8 +519,8 @@ libfdt_tests () {
check_tests "$SRCDIR/phandle-args-overflow.dts" clocks_property
## https://github.com/dgibson/dtc/issues/74
- run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb cell-overflow-results.dts
- run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb cell-overflow.dts
+ run_dtc_test -I dts -O dtb -o cell-overflow-results.test.dtb "$SRCDIR/cell-overflow-results.dts"
+ run_dtc_test -I dts -O dtb -o cell-overflow.test.dtb "$SRCDIR/cell-overflow.dts"
run_test dtbs_equal_ordered cell-overflow.test.dtb cell-overflow-results.test.dtb
# check full tests
--
cgit

View File

@ -1,43 +0,0 @@
Description: Python3.12 causes breakage for get_mem_rsv in pylibfdt.
Author: Héctor Orón Martínez <zumbi@debian.org>
---
Bug: https://github.com/dgibson/dtc/issues/123
Bug-Debian: https://bugs.debian.org/1061318
Bug-Ubuntu: https://launchpad.net/bugs/2051399
Last-Update: 2024-01-30
--- device-tree-compiler-1.7.0.orig/tests/pylibfdt_tests.py
+++ device-tree-compiler-1.7.0/tests/pylibfdt_tests.py
@@ -418,9 +418,14 @@ class PyLibfdtBasicTests(unittest.TestCa
def testReserveMap(self):
"""Test that we can access the memory reserve map"""
self.assertEqual(2, self.fdt.num_mem_rsv())
- self.assertEqual([ 0xdeadbeef00000000, 0x100000],
- self.fdt.get_mem_rsv(0))
- self.assertEqual([123456789, 0o10000], self.fdt.get_mem_rsv(1))
+ if sys.version_info.major >= 3 and sys.version_info.minor >= 12:
+ self.assertEqual([0, 0xdeadbeef00000000, 0x100000],
+ self.fdt.get_mem_rsv(0))
+ self.assertEqual([0, 123456789, 0o10000], self.fdt.get_mem_rsv(1))
+ else:
+ self.assertEqual([0xdeadbeef00000000, 0x100000],
+ self.fdt.get_mem_rsv(0))
+ self.assertEqual([123456789, 0o10000], self.fdt.get_mem_rsv(1))
def testEmpty(self):
"""Test that we can create an empty tree"""
@@ -615,7 +620,10 @@ class PyLibfdtSwTests(unittest.TestCase)
fdt = sw.as_fdt()
self.assertEqual(2, fdt.num_mem_rsv())
- self.assertEqual([TEST_ADDR_1, TEST_SIZE_1], fdt.get_mem_rsv(0))
+ if sys.version_info.major >= 3 and sys.version_info.minor >= 12:
+ self.assertEqual([0, TEST_ADDR_1, TEST_SIZE_1], fdt.get_mem_rsv(0))
+ else:
+ self.assertEqual([TEST_ADDR_1, TEST_SIZE_1], fdt.get_mem_rsv(0))
# Make sure we can add a few more things
with sw.add_node('another'):