diff --git a/trunk/0001-meson-Fix-cell-overflow-tests-when-running-from-meso.patch b/trunk/0001-meson-Fix-cell-overflow-tests-when-running-from-meso.patch new file mode 100644 index 0000000..d60da94 --- /dev/null +++ b/trunk/0001-meson-Fix-cell-overflow-tests-when-running-from-meso.patch @@ -0,0 +1,32 @@ +From 32174a66efa4ad19fc6a2a6422e4af2ae4f055cb Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Tue, 28 Feb 2023 10:33:58 +1100 +Subject: [PATCH] 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 +--- + tests/run_tests.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/run_tests.sh b/tests/run_tests.sh +index 91350ad..f899d8c 100755 +--- 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 +-- +2.40.1 + diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index bc5f397..032c706 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -9,29 +9,31 @@ url='https://www.devicetree.org/' arch=(x86_64) license=(GPL2) depends=(libyaml) -makedepends=(swig) +makedepends=(meson swig python-setuptools-scm) checkdepends=(valgrind) -source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz) -sha256sums=('29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4') +source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz + 0001-meson-Fix-cell-overflow-tests-when-running-from-meso.patch + pyscm.patch) +sha256sums=('29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4' + '2a4c326e7150637e1c22f47699fd97e0f72d07969dee1f34aa4ee52405f9e475' + '3198c9e41cbebb0bcd9caa5de0940ccaf02b3b3bcc00fbc19bfdf3cdb8a075bb') prepare() { cd dtc-$pkgver - sed -i 's/-Werror//' Makefile + patch -Np1 < ../0001-meson-Fix-cell-overflow-tests-when-running-from-meso.patch + patch -Np1 < ../pyscm.patch + sed -i "s/@VERSION@/$pkgver/" setup.py } build() { - cd dtc-$pkgver - # python build fails as it requires a lot of extra dependencies. - # someone with more python experience needs to look at the proper way to build the python extension. - NO_PYTHON=1 make + arch-meson dtc-$pkgver build + meson compile -C build } check() { - cd dtc-$pkgver - NO_PYTHON=1 make check + meson test -C build --print-errorlogs } package() { - cd dtc-$pkgver - NO_PYTHON=1 DESTDIR="$pkgdir" make SETUP_PREFIX="$pkgdir/usr" PREFIX="$pkgdir/usr" install + meson install -C build --destdir "$pkgdir" } diff --git a/trunk/pyscm.patch b/trunk/pyscm.patch new file mode 100644 index 0000000..407bf05 --- /dev/null +++ b/trunk/pyscm.patch @@ -0,0 +1,18 @@ +diff --git a/setup.py b/setup.py +index e82a832..da01efd 100755 +--- a/setup.py ++++ b/setup.py +@@ -49,11 +49,8 @@ class build_py(_build_py): + + setup( + name='libfdt', +- use_scm_version={ +- "root": srcdir, +- }, + cmdclass = {'build_py' : build_py}, +- setup_requires = ['setuptools_scm'], ++ version="@VERSION@", + author='Simon Glass', + author_email='sjg@chromium.org', + description='Python binding for libfdt', +