diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson_1.1.1.bb')
-rw-r--r-- | meta/recipes-devtools/meson/meson_1.1.1.bb | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson_1.1.1.bb b/meta/recipes-devtools/meson/meson_1.1.1.bb new file mode 100644 index 0000000000..500e13775f --- /dev/null +++ b/meta/recipes-devtools/meson/meson_1.1.1.bb | |||
@@ -0,0 +1,155 @@ | |||
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] = "d04b541f97ca439fb82fab7d0d480988be4bd4e62563a5ca35fadb5400727b1c" | ||
19 | |||
20 | inherit python_setuptools_build_meta github-releases | ||
21 | |||
22 | RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" | ||
23 | |||
24 | FILES:${PN} += "${datadir}/polkit-1" | ||
25 | |||
26 | do_install:append () { | ||
27 | # As per the same issue in the python recipe itself: | ||
28 | # Unfortunately the following pyc files are non-deterministc due to 'frozenset' | ||
29 | # being written without strict ordering, even with PYTHONHASHSEED = 0 | ||
30 | # Upstream is discussing ways to solve the issue properly, until then let's | ||
31 | # just not install the problematic files. | ||
32 | # More info: http://benno.id.au/blog/2013/01/15/python-determinism | ||
33 | rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* | ||
34 | } | ||
35 | |||
36 | BBCLASSEXTEND = "native nativesdk" | ||
37 | |||
38 | inherit meson-routines | ||
39 | |||
40 | # The cross file logic is similar but not identical to that in meson.bbclass, | ||
41 | # since it's generating for an SDK rather than a cross-compile. Important | ||
42 | # differences are: | ||
43 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with | ||
44 | # real paths by meson-setup.sh when the SDK is extracted. | ||
45 | # - Some overrides aren't needed, since the SDK injects paths that take care of | ||
46 | # them. | ||
47 | def var_list2str(var, d): | ||
48 | items = d.getVar(var).split() | ||
49 | return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) | ||
50 | |||
51 | def generate_native_link_template(d): | ||
52 | val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
53 | '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
54 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
55 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
56 | '-Wl,--allow-shlib-undefined' | ||
57 | ] | ||
58 | build_arch = d.getVar('BUILD_ARCH') | ||
59 | if 'x86_64' in build_arch: | ||
60 | loader = 'ld-linux-x86-64.so.2' | ||
61 | elif 'i686' in build_arch: | ||
62 | loader = 'ld-linux.so.2' | ||
63 | elif 'aarch64' in build_arch: | ||
64 | loader = 'ld-linux-aarch64.so.1' | ||
65 | elif 'ppc64le' in build_arch: | ||
66 | loader = 'ld64.so.2' | ||
67 | elif 'loongarch64' in build_arch: | ||
68 | loader = 'ld-linux-loongarch-lp64d.so.1' | ||
69 | |||
70 | if loader: | ||
71 | val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] | ||
72 | |||
73 | return repr(val) | ||
74 | |||
75 | install_templates() { | ||
76 | install -d ${D}${datadir}/meson | ||
77 | |||
78 | cat >${D}${datadir}/meson/meson.native.template <<EOF | ||
79 | [binaries] | ||
80 | c = ${@meson_array('BUILD_CC', d)} | ||
81 | cpp = ${@meson_array('BUILD_CXX', d)} | ||
82 | ar = ${@meson_array('BUILD_AR', d)} | ||
83 | nm = ${@meson_array('BUILD_NM', d)} | ||
84 | strip = ${@meson_array('BUILD_STRIP', d)} | ||
85 | readelf = ${@meson_array('BUILD_READELF', d)} | ||
86 | pkgconfig = 'pkg-config-native' | ||
87 | |||
88 | [built-in options] | ||
89 | c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
90 | c_link_args = ${@generate_native_link_template(d)} | ||
91 | cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
92 | cpp_link_args = ${@generate_native_link_template(d)} | ||
93 | [properties] | ||
94 | sys_root = '@OECORE_NATIVE_SYSROOT' | ||
95 | EOF | ||
96 | |||
97 | cat >${D}${datadir}/meson/meson.cross.template <<EOF | ||
98 | [binaries] | ||
99 | c = @CC | ||
100 | cpp = @CXX | ||
101 | ar = @AR | ||
102 | nm = @NM | ||
103 | strip = @STRIP | ||
104 | pkgconfig = 'pkg-config' | ||
105 | |||
106 | [built-in options] | ||
107 | c_args = @CFLAGS | ||
108 | c_link_args = @LDFLAGS | ||
109 | cpp_args = @CPPFLAGS | ||
110 | cpp_link_args = @LDFLAGS | ||
111 | |||
112 | [properties] | ||
113 | needs_exe_wrapper = true | ||
114 | sys_root = @OECORE_TARGET_SYSROOT | ||
115 | |||
116 | [host_machine] | ||
117 | system = '$host_system' | ||
118 | cpu_family = '$host_cpu_family' | ||
119 | cpu = '$host_cpu' | ||
120 | endian = '$host_endian' | ||
121 | EOF | ||
122 | } | ||
123 | |||
124 | do_install:append:class-nativesdk() { | ||
125 | host_system=${SDK_OS} | ||
126 | host_cpu_family=${@meson_cpu_family("SDK_ARCH", d)} | ||
127 | host_cpu=${SDK_ARCH} | ||
128 | host_endian=${@meson_endian("SDK", d)} | ||
129 | install_templates | ||
130 | |||
131 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d | ||
132 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ | ||
133 | |||
134 | # We need to wrap the real meson with a thin env setup wrapper. | ||
135 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real | ||
136 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson | ||
137 | } | ||
138 | |||
139 | FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" | ||
140 | |||
141 | do_install:append:class-native() { | ||
142 | host_system=${HOST_OS} | ||
143 | host_cpu_family=${@meson_cpu_family("HOST_ARCH", d)} | ||
144 | host_cpu=${HOST_ARCH} | ||
145 | host_endian=${@meson_endian("HOST", d)} | ||
146 | install_templates | ||
147 | |||
148 | install -d ${D}${datadir}/post-relocate-setup.d | ||
149 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${datadir}/post-relocate-setup.d/ | ||
150 | |||
151 | # We need to wrap the real meson with a thin wrapper that substitues native/cross files | ||
152 | # when running in a direct SDK environment. | ||
153 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real | ||
154 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson | ||
155 | } | ||