diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson_1.8.2.bb')
-rw-r--r-- | meta/recipes-devtools/meson/meson_1.8.2.bb | 159 |
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 @@ | |||
1 | HOMEPAGE = "http://mesonbuild.com" | ||
2 | SUMMARY = "A high performance build system" | ||
3 | DESCRIPTION = "Meson is a build system designed to increase programmer \ | ||
4 | productivity. It does this by providing a fast, simple and easy to use \ | ||
5 | interface for modern software development tools and practices." | ||
6 | |||
7 | LICENSE = "Apache-2.0" | ||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
9 | |||
10 | GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/" | ||
11 | SRC_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 | " | ||
18 | SRC_URI[sha256sum] = "c105816d8158c76b72adcb9ff60297719096da7d07f6b1f000fd8c013cd387af" | ||
19 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$" | ||
20 | |||
21 | inherit python_setuptools_build_meta github-releases | ||
22 | |||
23 | RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" | ||
24 | |||
25 | FILES:${PN} += "${datadir}/polkit-1" | ||
26 | |||
27 | BBCLASSEXTEND = "native nativesdk" | ||
28 | |||
29 | inherit 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. | ||
38 | def 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 | |||
42 | def 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 | |||
68 | install_native_template() { | ||
69 | install -d ${D}${datadir}/meson | ||
70 | |||
71 | cat >${D}${datadir}/meson/meson.native.template <<EOF | ||
72 | [binaries] | ||
73 | c = ${@meson_array('BUILD_CC', d)} | ||
74 | cpp = ${@meson_array('BUILD_CXX', d)} | ||
75 | ar = ${@meson_array('BUILD_AR', d)} | ||
76 | nm = ${@meson_array('BUILD_NM', d)} | ||
77 | strip = ${@meson_array('BUILD_STRIP', d)} | ||
78 | readelf = ${@meson_array('BUILD_READELF', d)} | ||
79 | pkg-config = 'pkg-config-native' | ||
80 | |||
81 | [built-in options] | ||
82 | c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
83 | c_link_args = ${@generate_native_link_template(d)} | ||
84 | cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
85 | cpp_link_args = ${@generate_native_link_template(d)} | ||
86 | EOF | ||
87 | } | ||
88 | |||
89 | install_nativesdk_template() { | ||
90 | install -d ${D}${datadir}/meson | ||
91 | |||
92 | cat >${D}${datadir}/meson/meson.native.template <<EOF | ||
93 | [binaries] | ||
94 | pkg-config = 'pkg-config-native' | ||
95 | |||
96 | [built-in options] | ||
97 | c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}'] | ||
98 | c_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',] | ||
99 | cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}'] | ||
100 | cpp_link_args = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',] | ||
101 | EOF | ||
102 | } | ||
103 | |||
104 | install_cross_template() { | ||
105 | install -d ${D}${datadir}/meson | ||
106 | |||
107 | cat >${D}${datadir}/meson/meson.cross.template <<EOF | ||
108 | [binaries] | ||
109 | c = @CC | ||
110 | cpp = @CXX | ||
111 | ar = @AR | ||
112 | nm = @NM | ||
113 | strip = @STRIP | ||
114 | pkg-config = 'pkg-config' | ||
115 | |||
116 | [built-in options] | ||
117 | c_args = @CFLAGS | ||
118 | c_link_args = @LDFLAGS | ||
119 | cpp_args = @CPPFLAGS | ||
120 | cpp_link_args = @LDFLAGS | ||
121 | |||
122 | [properties] | ||
123 | needs_exe_wrapper = true | ||
124 | sys_root = @OECORE_TARGET_SYSROOT | ||
125 | |||
126 | [host_machine] | ||
127 | system = @OECORE_MESON_HOST_SYSTEM | ||
128 | cpu_family = @OECORE_MESON_HOST_CPU_FAMILY | ||
129 | cpu = @OECORE_MESON_HOST_CPU | ||
130 | endian = @OECORE_MESON_HOST_ENDIAN | ||
131 | EOF | ||
132 | } | ||
133 | |||
134 | do_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 | |||
146 | FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" | ||
147 | |||
148 | do_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 | } | ||