author | Antonio Rojas
<arojas@archlinux.org> 2024-04-06 19:43:01 UTC |
committer | Antonio Rojas
<arojas@archlinux.org> 2024-04-06 19:43:01 UTC |
parent | b4d518b2426f0223d8d9e43573a3fa1913ddec42 |
.SRCINFO | +29 | -0 |
PKGBUILD | +6 | -3 |
fix-tests-for-Python3.12.patch | +43 | -0 |
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..45edfef --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = dtc + pkgdesc = Device Tree Compiler + pkgver = 1.7.0 + pkgrel = 5 + url = https://www.devicetree.org/ + arch = x86_64 + license = GPL2 + checkdepends = valgrind + makedepends = meson + makedepends = swig + makedepends = python-setuptools-scm + depends = bash + depends = glibc + depends = libyaml + depends = python + source = https://www.kernel.org/pub/software/utils/dtc/dtc-1.7.0.tar.xz + source = fix_test.patch::https://github.com/dgibson/dtc/commit/32174a66efa4ad19fc6a2a6422e4af2ae4f055cb.patch + source = fix_meson_version.patch::https://github.com/dgibson/dtc/commit/64a907f08b9bedd89833c1eee674148cff2343c6.patch + source = fix_meson_version2.patch::https://github.com/dgibson/dtc/pull/95.patch + source = pyscm.patch + source = fix-tests-for-Python3.12.patch + sha256sums = 29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4 + sha256sums = 4538d60e5837cc1b7ead839eab2062a8677cf1ee7582fed76d3c4f043b3c0765 + sha256sums = 31ba6e7191cdb88a12f3ffa3016006cdc820c7588a54214e34326a67b68bd984 + sha256sums = 1c6f13e57e4b635a21dbb6b515e556bb9d28564b6f119edd852e41c019410bb6 + sha256sums = 3198c9e41cbebb0bcd9caa5de0940ccaf02b3b3bcc00fbc19bfdf3cdb8a075bb + sha256sums = c2786c6c4bbd7031394ab534ceca2fa6832142dd0cb3c74750388be9374b22fa + +pkgname = dtc diff --git a/PKGBUILD b/PKGBUILD index 2cdf3da..caaa27a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgname=dtc pkgver=1.7.0 -pkgrel=4 +pkgrel=5 pkgdesc='Device Tree Compiler' url='https://www.devicetree.org/' arch=(x86_64) @@ -15,12 +15,14 @@ source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz fix_test.patch::https://github.com/dgibson/dtc/commit/32174a66efa4ad19fc6a2a6422e4af2ae4f055cb.patch fix_meson_version.patch::https://github.com/dgibson/dtc/commit/64a907f08b9bedd89833c1eee674148cff2343c6.patch fix_meson_version2.patch::https://github.com/dgibson/dtc/pull/95.patch - pyscm.patch) + pyscm.patch + fix-tests-for-Python3.12.patch) sha256sums=('29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4' '4538d60e5837cc1b7ead839eab2062a8677cf1ee7582fed76d3c4f043b3c0765' '31ba6e7191cdb88a12f3ffa3016006cdc820c7588a54214e34326a67b68bd984' '1c6f13e57e4b635a21dbb6b515e556bb9d28564b6f119edd852e41c019410bb6' - '3198c9e41cbebb0bcd9caa5de0940ccaf02b3b3bcc00fbc19bfdf3cdb8a075bb') + '3198c9e41cbebb0bcd9caa5de0940ccaf02b3b3bcc00fbc19bfdf3cdb8a075bb' + 'c2786c6c4bbd7031394ab534ceca2fa6832142dd0cb3c74750388be9374b22fa') prepare() { cd dtc-$pkgver @@ -29,6 +31,7 @@ prepare() { patch -Np1 < ../fix_meson_version2.patch patch -Np1 < ../pyscm.patch sed -i "s/@VERSION@/$pkgver/" setup.py + patch -Np1 -i ../fix-tests-for-Python3.12.patch # Debian patch } build() { diff --git a/fix-tests-for-Python3.12.patch b/fix-tests-for-Python3.12.patch new file mode 100644 index 0000000..7a08648 --- /dev/null +++ b/fix-tests-for-Python3.12.patch @@ -0,0 +1,43 @@ +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'):