diff options
author | Peter Marko <peter.marko@siemens.com> | 2023-12-16 19:55:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-21 10:38:30 +0000 |
commit | b2585b54b1aff0cb218be8f307c3069778c3a4bb (patch) | |
tree | 5d027db3e318a02ae4d434724f5d6cac587a2239 /meta/recipes-kernel/dtc | |
parent | b1ff67062a5a8077dcb3386f7b5f9237d23b5784 (diff) | |
download | poky-b2585b54b1aff0cb218be8f307c3069778c3a4bb.tar.gz |
dtc: preserve version also from shallow git clones
Since switch from Makefile to meson based build,
the version is no longer hardcoded but queried from git tag.
This works only if git history is available.
When shallow tarballs are used, tag is not available.
Example error for trusted-firmware-a from meta-arm:
dtc version too old (039a994), you need at least version 1.4.4
Backport also patch to fix version in meson file.
(From OE-Core rev: 319f5d8a32d1f4a71ac997ce4522249b08f84945)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/dtc')
3 files changed, 72 insertions, 1 deletions
diff --git a/meta/recipes-kernel/dtc/dtc/0001-meson.build-bump-version-to-1.7.0.patch b/meta/recipes-kernel/dtc/dtc/0001-meson.build-bump-version-to-1.7.0.patch new file mode 100644 index 0000000000..79a3b92b44 --- /dev/null +++ b/meta/recipes-kernel/dtc/dtc/0001-meson.build-bump-version-to-1.7.0.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 9153522103bd4ed7e3299c4d073f66bb37cb2d42 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nikolay Letov <letov.nikolay@gmail.com> | ||
3 | Date: Wed, 22 Feb 2023 13:36:07 +0300 | ||
4 | Subject: [PATCH 1/2] meson.build: bump version to 1.7.0 | ||
5 | |||
6 | [This was botched in the actual 1.7.0 release :( - David Gibson] | ||
7 | |||
8 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=64a907f08b9bedd89833c1eee674148cff2343c6] | ||
9 | |||
10 | Signed-off-by: Nikolay Letov <letov.nikolay@gmail.com> | ||
11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
12 | --- | ||
13 | meson.build | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/meson.build b/meson.build | ||
17 | index 78251eb..d88cd9f 100644 | ||
18 | --- a/meson.build | ||
19 | +++ b/meson.build | ||
20 | @@ -1,5 +1,5 @@ | ||
21 | project('dtc', 'c', | ||
22 | - version: '1.6.0', | ||
23 | + version: '1.7.0', | ||
24 | license: ['GPL2+', 'BSD-2'], | ||
25 | default_options: 'werror=true', | ||
26 | ) | ||
27 | -- | ||
28 | 2.30.2 | ||
29 | |||
diff --git a/meta/recipes-kernel/dtc/dtc/0002-meson-allow-building-from-shallow-clones.patch b/meta/recipes-kernel/dtc/dtc/0002-meson-allow-building-from-shallow-clones.patch new file mode 100644 index 0000000000..0284905913 --- /dev/null +++ b/meta/recipes-kernel/dtc/dtc/0002-meson-allow-building-from-shallow-clones.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 4415b0baece3c4351a6d3637c2754abbefd4795d Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Marko <peter.marko@siemens.com> | ||
3 | Date: Sat, 16 Dec 2023 18:58:31 +0100 | ||
4 | Subject: [PATCH 2/2] meson: allow building from shallow clones | ||
5 | |||
6 | When building from shallow clone, tag is not available | ||
7 | and version defaults to git hash. | ||
8 | Problem is that some builds check DTC version and fail the comparison. | ||
9 | Example is https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git | ||
10 | Which fails to build with following error: | ||
11 | dtc version too old (039a994), you need at least version 1.4.4 | ||
12 | |||
13 | Drop --always from git describe command, see | ||
14 | https://github.com/mesonbuild/meson/blob/1.3.0/mesonbuild/utils/universal.py#L773 | ||
15 | This will make it more closer to build via Makefile. | ||
16 | |||
17 | Upstream-Status: Submitted [https://github.com/dgibson/dtc/pull/122] | ||
18 | |||
19 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
20 | --- | ||
21 | meson.build | 1 + | ||
22 | 1 file changed, 1 insertion(+) | ||
23 | |||
24 | diff --git a/meson.build b/meson.build | ||
25 | index 78251eb..fc0c92a 100644 | ||
26 | --- a/meson.build | ||
27 | +++ b/meson.build | ||
28 | @@ -56,6 +56,7 @@ py = py.find_installation(required: get_option('python')) | ||
29 | swig = find_program('swig', required: get_option('python')) | ||
30 | |||
31 | version_gen_h = vcs_tag( | ||
32 | + command: ['git', 'describe', '--dirty=+'], | ||
33 | input: 'version_gen.h.in', | ||
34 | output: 'version_gen.h', | ||
35 | ) | ||
36 | -- | ||
37 | 2.30.2 | ||
38 | |||
diff --git a/meta/recipes-kernel/dtc/dtc_1.7.0.bb b/meta/recipes-kernel/dtc/dtc_1.7.0.bb index 1a78a0c079..0702fc16df 100644 --- a/meta/recipes-kernel/dtc/dtc_1.7.0.bb +++ b/meta/recipes-kernel/dtc/dtc_1.7.0.bb | |||
@@ -8,7 +8,11 @@ LIC_FILES_CHKSUM = "file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | |||
8 | file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 \ | 8 | file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 \ |
9 | file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e" | 9 | file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e" |
10 | 10 | ||
11 | SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https" | 11 | SRC_URI = " \ |
12 | git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https \ | ||
13 | file://0001-meson.build-bump-version-to-1.7.0.patch \ | ||
14 | file://0002-meson-allow-building-from-shallow-clones.patch \ | ||
15 | " | ||
12 | SRCREV = "039a99414e778332d8f9c04cbd3072e1dcc62798" | 16 | SRCREV = "039a99414e778332d8f9c04cbd3072e1dcc62798" |
13 | 17 | ||
14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" | 18 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" |