summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
commit8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch)
treeefdc32587159d0050a69009bdf2330a531727d95 /meta/recipes-devtools/meson
parentd412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff)
downloadpoky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz
The poky repository master branch is no longer being updated.
You can either: a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs b) use the new bitbake-setup You can find information about either approach in our documentation: https://docs.yoctoproject.org/ Note that "poky" the distro setting is still available in meta-yocto as before and we continue to use and maintain that. Long live Poky! Some further information on the background of this change can be found in: https://lists.openembedded.org/g/openembedded-architecture/message/2179 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/meson')
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch44
-rw-r--r--meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch37
-rw-r--r--meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch25
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-setup.py43
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-wrapper38
-rw-r--r--meta/recipes-devtools/meson/meson_1.9.1.bb159
6 files changed, 0 insertions, 346 deletions
diff --git a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
deleted file mode 100644
index 46754bf508..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 9854e557b77612afb095e9868bb7cba12bc1b1cb Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Tue, 3 Jul 2018 13:59:09 +0100
4Subject: [PATCH] Make CPU family warnings fatal
5
6Upstream-Status: Inappropriate [OE specific]
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8---
9 mesonbuild/envconfig.py | 4 ++--
10 mesonbuild/environment.py | 6 ++----
11 2 files changed, 4 insertions(+), 6 deletions(-)
12
13diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
14index 43fad0c..27be871 100644
15--- a/mesonbuild/envconfig.py
16+++ b/mesonbuild/envconfig.py
17@@ -287,8 +287,8 @@ class MachineInfo(HoldableObject):
18 'but is missing {}.'.format(minimum_literal - set(literal)))
19
20 cpu_family = literal['cpu_family']
21- if cpu_family not in known_cpu_families:
22- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new')
23+ if cpu_family not in known_cpu_families and cpu_family != "riscv":
24+ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family))
25
26 endian = literal['endian']
27 if endian not in ('little', 'big'):
28diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
29index 489ef50..1567efa 100644
30--- a/mesonbuild/environment.py
31+++ b/mesonbuild/environment.py
32@@ -438,10 +438,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
33 if compilers and not any_compiler_has_define(compilers, '__mips64'):
34 trial = 'mips'
35
36- if trial not in known_cpu_families:
37- mlog.warning(f'Unknown CPU family {trial!r}, please report this at '
38- 'https://github.com/mesonbuild/meson/issues/new with the '
39- 'output of `uname -a` and `cat /proc/cpuinfo`')
40+ if trial not in known_cpu_families and trail != "riscv":
41+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial)
42
43 return trial
44
diff --git a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
deleted file mode 100644
index c1b8293593..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From c0ffc404415a52bfa3358e32ecd17f064a241b38 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 19 Nov 2018 14:24:26 +0100
4Subject: [PATCH] python module: do not manipulate the environment when calling
5
6 pkg-config
7
8Upstream-Status: Inappropriate [oe-core specific]
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10---
11 mesonbuild/dependencies/python.py | 6 +-----
12 1 file changed, 1 insertion(+), 5 deletions(-)
13
14diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
15index b028d9f..3d7cd9b 100644
16--- a/mesonbuild/dependencies/python.py
17+++ b/mesonbuild/dependencies/python.py
18@@ -418,9 +418,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
19 empty.name = 'python'
20 return empty
21
22- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None)
23- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None)
24- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
25 try:
26 return PythonPkgConfigDependency(name, env, kwargs, installation, True)
27 finally:
28@@ -429,8 +426,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
29 os.environ[name] = value
30 elif name in os.environ:
31 del os.environ[name]
32- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir)
33- set_env('PKG_CONFIG_PATH', old_pkg_path)
34+ pass
35
36 # Otherwise this doesn't fulfill the interface requirements
37 wrap_in_pythons_pc_dir.log_tried = PythonPkgConfigDependency.log_tried # type: ignore[attr-defined]
diff --git a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
deleted file mode 100644
index 2e294b5b7f..0000000000
--- a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1From fac479734d7f6e04eba71c8193623465d9eb0228 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Thu, 26 Jul 2018 16:32:49 +0200
4Subject: [PATCH] Support building allarch recipes again
5
6This registers "allarch" as a known CPU family.
7
8Upstream-Status: Inappropriate [OE specific]
9Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
10---
11 mesonbuild/envconfig.py | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15index 27be871..994ac77 100644
16--- a/mesonbuild/envconfig.py
17+++ b/mesonbuild/envconfig.py
18@@ -31,6 +31,7 @@ if T.TYPE_CHECKING:
19
20
21 known_cpu_families = (
22+ 'allarch',
23 'aarch64',
24 'alpha',
25 'arc',
diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py
deleted file mode 100755
index daaa551de2..0000000000
--- a/meta/recipes-devtools/meson/meson/meson-setup.py
+++ /dev/null
@@ -1,43 +0,0 @@
1#!/usr/bin/env python3
2
3import os
4import string
5import sys
6
7class Template(string.Template):
8 delimiter = "@"
9
10class Environ():
11 def __getitem__(self, name):
12 val = os.environ[name]
13 val = val.split()
14 if len(val) > 1:
15 val = ["'%s'" % x for x in val]
16 val = ', '.join(val)
17 val = '[%s]' % val
18 elif val:
19 val = "'%s'" % val.pop()
20 return val
21
22try:
23 sysroot = os.environ['OECORE_NATIVE_SYSROOT']
24except KeyError:
25 print("Not in environment setup, bailing")
26 sys.exit(1)
27
28template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
29cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
30native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template')
31native_file = os.path.join(sysroot, 'usr/share/meson/meson.native')
32
33with open(template_file) as in_file:
34 template = in_file.read()
35 output = Template(template).substitute(Environ())
36 with open(cross_file, "w") as out_file:
37 out_file.write(output)
38
39with open(native_template_file) as in_file:
40 template = in_file.read()
41 output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']})
42 with open(native_file, "w") as out_file:
43 out_file.write(output)
diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
deleted file mode 100755
index 3aa1a93520..0000000000
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ /dev/null
@@ -1,38 +0,0 @@
1#!/bin/sh
2
3if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
4 exec "meson.real" "$@"
5fi
6
7if [ -z "$SSL_CERT_DIR" ]; then
8 export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/"
9fi
10
11# If these are set to a cross-compile path, meson will get confused and try to
12# use them as native tools. Unset them to prevent this, as all the cross-compile
13# config is already in meson.cross.
14unset CC CXX CPP LD AR NM STRIP
15
16case "$1" in
17setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help)
18 MESON_CMD="$1"
19 shift
20 ;;
21*)
22 MESON_CMD=setup
23 echo meson-wrapper: Implicit setup command assumed
24 ;;
25esac
26
27if [ "$MESON_CMD" = "setup" ]; then
28 MESON_SETUP_OPTS=" \
29 --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \
30 --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \
31 "
32 echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\"
33fi
34
35exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
36 $MESON_CMD \
37 $MESON_SETUP_OPTS \
38 "$@"
diff --git a/meta/recipes-devtools/meson/meson_1.9.1.bb b/meta/recipes-devtools/meson/meson_1.9.1.bb
deleted file mode 100644
index 4738484bbb..0000000000
--- a/meta/recipes-devtools/meson/meson_1.9.1.bb
+++ /dev/null
@@ -1,159 +0,0 @@
1HOMEPAGE = "http://mesonbuild.com"
2SUMMARY = "A high performance build system"
3DESCRIPTION = "Meson is a build system designed to increase programmer \
4productivity. It does this by providing a fast, simple and easy to use \
5interface for modern software development tools and practices."
6
7LICENSE = "Apache-2.0"
8LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9
10GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/"
11SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \
12 file://meson-setup.py \
13 file://meson-wrapper \
14 file://0001-python-module-do-not-manipulate-the-environment-when.patch \
15 file://0001-Make-CPU-family-warnings-fatal.patch \
16 file://0002-Support-building-allarch-recipes-again.patch \
17 "
18SRC_URI[sha256sum] = "4e076606f2afff7881d195574bddcd8d89286f35a17b4977a216f535dc0c74ac"
19UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$"
20
21inherit python_setuptools_build_meta github-releases
22
23RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources"
24
25FILES:${PN} += "${datadir}/polkit-1"
26
27BBCLASSEXTEND = "native nativesdk"
28
29inherit meson-routines
30
31# The cross file logic is similar but not identical to that in meson.bbclass,
32# since it's generating for an SDK rather than a cross-compile. Important
33# differences are:
34# - We can't set vars like CC, CXX, etc. yet because they will be filled in with
35# real paths by meson-setup.sh when the SDK is extracted.
36# - Some overrides aren't needed, since the SDK injects paths that take care of
37# them.
38def var_list2str(var, d):
39 items = d.getVar(var).split()
40 return repr(items[0]) if len(items) == 1 else ', '.join(repr(s) for s in items)
41
42def generate_native_link_template(d):
43 val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}',
44 '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
45 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}',
46 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
47 '-Wl,--allow-shlib-undefined'
48 ]
49 build_arch = d.getVar('BUILD_ARCH')
50 if 'x86_64' in build_arch:
51 loader = 'ld-linux-x86-64.so.2'
52 elif 'i686' in build_arch:
53 loader = 'ld-linux.so.2'
54 elif 'aarch64' in build_arch:
55 loader = 'ld-linux-aarch64.so.1'
56 elif 'ppc64le' in build_arch:
57 loader = 'ld64.so.2'
58 elif 'loongarch64' in build_arch:
59 loader = 'ld-linux-loongarch-lp64d.so.1'
60 elif 'riscv64' in build_arch:
61 loader = 'ld-linux-riscv64-lp64d.so.1'
62
63 if loader:
64 val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader]
65
66 return repr(val)
67
68install_native_template() {
69 install -d ${D}${datadir}/meson
70
71 cat >${D}${datadir}/meson/meson.native.template <<EOF
72[binaries]
73c = ${@meson_array('BUILD_CC', d)}
74cpp = ${@meson_array('BUILD_CXX', d)}
75ar = ${@meson_array('BUILD_AR', d)}
76nm = ${@meson_array('BUILD_NM', d)}
77strip = ${@meson_array('BUILD_STRIP', d)}
78readelf = ${@meson_array('BUILD_READELF', d)}
79pkg-config = 'pkg-config-native'
80
81[built-in options]
82c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
83c_link_args = ${@generate_native_link_template(d)}
84cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
85cpp_link_args = ${@generate_native_link_template(d)}
86EOF
87}
88
89install_nativesdk_template() {
90 install -d ${D}${datadir}/meson
91
92 cat >${D}${datadir}/meson/meson.native.template <<EOF
93[binaries]
94pkg-config = 'pkg-config-native'
95
96[built-in options]
97c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}']
98c_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',]
99cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}']
100cpp_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',]
101EOF
102}
103
104install_cross_template() {
105 install -d ${D}${datadir}/meson
106
107 cat >${D}${datadir}/meson/meson.cross.template <<EOF
108[binaries]
109c = @CC
110cpp = @CXX
111ar = @AR
112nm = @NM
113strip = @STRIP
114pkg-config = 'pkg-config'
115
116[built-in options]
117c_args = @CFLAGS
118c_link_args = @LDFLAGS
119cpp_args = @CPPFLAGS
120cpp_link_args = @LDFLAGS
121
122[properties]
123needs_exe_wrapper = true
124sys_root = @OECORE_TARGET_SYSROOT
125
126[host_machine]
127system = @OECORE_MESON_HOST_SYSTEM
128cpu_family = @OECORE_MESON_HOST_CPU_FAMILY
129cpu = @OECORE_MESON_HOST_CPU
130endian = @OECORE_MESON_HOST_ENDIAN
131EOF
132}
133
134do_install:append:class-nativesdk() {
135 install_nativesdk_template
136 install_cross_template
137
138 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
139 install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
140
141 # We need to wrap the real meson with a thin env setup wrapper.
142 mv ${D}${bindir}/meson ${D}${bindir}/meson.real
143 install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson
144}
145
146FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}"
147
148do_install:append:class-native() {
149 install_native_template
150 install_cross_template
151
152 install -d ${D}${datadir}/post-relocate-setup.d
153 install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${datadir}/post-relocate-setup.d/
154
155 # We need to wrap the real meson with a thin wrapper that substitues native/cross files
156 # when running in a direct SDK environment.
157 mv ${D}${bindir}/meson ${D}${bindir}/meson.real
158 install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson
159}