summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson/meson_1.8.2.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/meson/meson_1.8.2.bb')
-rw-r--r--meta/recipes-devtools/meson/meson_1.8.2.bb159
1 files changed, 159 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson_1.8.2.bb b/meta/recipes-devtools/meson/meson_1.8.2.bb
new file mode 100644
index 0000000000..bfeaab0a79
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson_1.8.2.bb
@@ -0,0 +1,159 @@
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] = "c105816d8158c76b72adcb9ff60297719096da7d07f6b1f000fd8c013cd387af"
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}