diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-19 11:40:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-20 11:57:28 +0000 |
commit | bc0c43cf16d846187e8069938222261fc1838f5f (patch) | |
tree | e62d4c2e2591d83c7d21e9b61782390420d63c19 /meta/recipes-devtools | |
parent | 4f24d5daa63feba1849f9c6295597b97c3a42035 (diff) | |
download | poky-bc0c43cf16d846187e8069938222261fc1838f5f.tar.gz |
meson: fold nativesdk into the main recipe
This allows automated version updates when possible, and reduces friction in manual ones.
(From OE-Core rev: 54d4a767ab7beaa64cfc4c221317ea03b0b119ab)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/meson/meson.inc | 37 | ||||
-rw-r--r-- | meta/recipes-devtools/meson/meson_0.60.3.bb | 135 | ||||
-rw-r--r-- | meta/recipes-devtools/meson/nativesdk-meson_0.60.3.bb | 104 |
3 files changed, 133 insertions, 143 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc deleted file mode 100644 index 042cf130e4..0000000000 --- a/meta/recipes-devtools/meson/meson.inc +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
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 | SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ | ||
11 | file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ | ||
12 | file://0001-python-module-do-not-manipulate-the-environment-when.patch \ | ||
13 | file://disable-rpath-handling.patch \ | ||
14 | file://0001-Make-CPU-family-warnings-fatal.patch \ | ||
15 | file://0002-Support-building-allarch-recipes-again.patch \ | ||
16 | file://0001-is_debianlike-always-return-False.patch \ | ||
17 | " | ||
18 | SRC_URI[sha256sum] = "87ca5fa9358a01864529392bd64e027158eb94afca7c7766b1866ef27eccb98e" | ||
19 | |||
20 | UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" | ||
21 | UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar" | ||
22 | |||
23 | inherit setuptools3 | ||
24 | |||
25 | RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" | ||
26 | |||
27 | FILES:${PN} += "${datadir}/polkit-1" | ||
28 | |||
29 | do_install:append () { | ||
30 | # As per the same issue in the python recipe itself: | ||
31 | # Unfortunately the following pyc files are non-deterministc due to 'frozenset' | ||
32 | # being written without strict ordering, even with PYTHONHASHSEED = 0 | ||
33 | # Upstream is discussing ways to solve the issue properly, until then let's | ||
34 | # just not install the problematic files. | ||
35 | # More info: http://benno.id.au/blog/2013/01/15/python-determinism | ||
36 | rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* | ||
37 | } | ||
diff --git a/meta/recipes-devtools/meson/meson_0.60.3.bb b/meta/recipes-devtools/meson/meson_0.60.3.bb index de9b905c12..62ca09465b 100644 --- a/meta/recipes-devtools/meson/meson_0.60.3.bb +++ b/meta/recipes-devtools/meson/meson_0.60.3.bb | |||
@@ -1,4 +1,135 @@ | |||
1 | include meson.inc | 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." | ||
2 | 6 | ||
3 | BBCLASSEXTEND = "native" | 7 | LICENSE = "Apache-2.0" |
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
4 | 9 | ||
10 | SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ | ||
11 | file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ | ||
12 | file://0001-python-module-do-not-manipulate-the-environment-when.patch \ | ||
13 | file://disable-rpath-handling.patch \ | ||
14 | file://0001-Make-CPU-family-warnings-fatal.patch \ | ||
15 | file://0002-Support-building-allarch-recipes-again.patch \ | ||
16 | file://0001-is_debianlike-always-return-False.patch \ | ||
17 | " | ||
18 | SRC_URI[sha256sum] = "87ca5fa9358a01864529392bd64e027158eb94afca7c7766b1866ef27eccb98e" | ||
19 | |||
20 | UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" | ||
21 | UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar" | ||
22 | |||
23 | inherit setuptools3 | ||
24 | |||
25 | RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" | ||
26 | |||
27 | FILES:${PN} += "${datadir}/polkit-1" | ||
28 | |||
29 | do_install:append () { | ||
30 | # As per the same issue in the python recipe itself: | ||
31 | # Unfortunately the following pyc files are non-deterministc due to 'frozenset' | ||
32 | # being written without strict ordering, even with PYTHONHASHSEED = 0 | ||
33 | # Upstream is discussing ways to solve the issue properly, until then let's | ||
34 | # just not install the problematic files. | ||
35 | # More info: http://benno.id.au/blog/2013/01/15/python-determinism | ||
36 | rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* | ||
37 | } | ||
38 | |||
39 | BBCLASSEXTEND = "native nativesdk" | ||
40 | |||
41 | inherit meson-routines | ||
42 | |||
43 | SRC_URI:append:class-nativesdk = " file://meson-setup.py \ | ||
44 | file://meson-wrapper" | ||
45 | |||
46 | # The cross file logic is similar but not identical to that in meson.bbclass, | ||
47 | # since it's generating for an SDK rather than a cross-compile. Important | ||
48 | # differences are: | ||
49 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with | ||
50 | # real paths by meson-setup.sh when the SDK is extracted. | ||
51 | # - Some overrides aren't needed, since the SDK injects paths that take care of | ||
52 | # them. | ||
53 | def var_list2str(var, d): | ||
54 | items = d.getVar(var).split() | ||
55 | return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) | ||
56 | |||
57 | def generate_native_link_template(d): | ||
58 | val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
59 | '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
60 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
61 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
62 | '-Wl,--allow-shlib-undefined' | ||
63 | ] | ||
64 | build_arch = d.getVar('BUILD_ARCH') | ||
65 | if 'x86_64' in build_arch: | ||
66 | loader = 'ld-linux-x86-64.so.2' | ||
67 | elif 'i686' in build_arch: | ||
68 | loader = 'ld-linux.so.2' | ||
69 | elif 'aarch64' in build_arch: | ||
70 | loader = 'ld-linux-aarch64.so.1' | ||
71 | elif 'ppc64le' in build_arch: | ||
72 | loader = 'ld64.so.2' | ||
73 | |||
74 | if loader: | ||
75 | val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] | ||
76 | |||
77 | return repr(val) | ||
78 | |||
79 | do_install:append:class-nativesdk() { | ||
80 | install -d ${D}${datadir}/meson | ||
81 | |||
82 | cat >${D}${datadir}/meson/meson.native.template <<EOF | ||
83 | [binaries] | ||
84 | c = ${@meson_array('BUILD_CC', d)} | ||
85 | cpp = ${@meson_array('BUILD_CXX', d)} | ||
86 | ar = ${@meson_array('BUILD_AR', d)} | ||
87 | nm = ${@meson_array('BUILD_NM', d)} | ||
88 | strip = ${@meson_array('BUILD_STRIP', d)} | ||
89 | readelf = ${@meson_array('BUILD_READELF', d)} | ||
90 | pkgconfig = 'pkg-config-native' | ||
91 | |||
92 | [built-in options] | ||
93 | c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
94 | c_link_args = ${@generate_native_link_template(d)} | ||
95 | cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
96 | cpp_link_args = ${@generate_native_link_template(d)} | ||
97 | [properties] | ||
98 | sys_root = '@OECORE_NATIVE_SYSROOT' | ||
99 | EOF | ||
100 | |||
101 | cat >${D}${datadir}/meson/meson.cross.template <<EOF | ||
102 | [binaries] | ||
103 | c = @CC | ||
104 | cpp = @CXX | ||
105 | ar = @AR | ||
106 | nm = @NM | ||
107 | strip = @STRIP | ||
108 | pkgconfig = 'pkg-config' | ||
109 | |||
110 | [built-in options] | ||
111 | c_args = @CFLAGS | ||
112 | c_link_args = @LDFLAGS | ||
113 | cpp_args = @CPPFLAGS | ||
114 | cpp_link_args = @LDFLAGS | ||
115 | |||
116 | [properties] | ||
117 | needs_exe_wrapper = true | ||
118 | sys_root = @OECORE_TARGET_SYSROOT | ||
119 | |||
120 | [host_machine] | ||
121 | system = '${SDK_OS}' | ||
122 | cpu_family = '${@meson_cpu_family("SDK_ARCH", d)}' | ||
123 | cpu = '${SDK_ARCH}' | ||
124 | endian = '${@meson_endian("SDK", d)}' | ||
125 | EOF | ||
126 | |||
127 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d | ||
128 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ | ||
129 | |||
130 | # We need to wrap the real meson with a thin env setup wrapper. | ||
131 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real | ||
132 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson | ||
133 | } | ||
134 | |||
135 | FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" | ||
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.60.3.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.60.3.bb deleted file mode 100644 index 7b77041c7e..0000000000 --- a/meta/recipes-devtools/meson/nativesdk-meson_0.60.3.bb +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | include meson.inc | ||
2 | |||
3 | inherit meson-routines | ||
4 | inherit nativesdk | ||
5 | |||
6 | SRC_URI += "file://meson-setup.py \ | ||
7 | file://meson-wrapper" | ||
8 | |||
9 | # The cross file logic is similar but not identical to that in meson.bbclass, | ||
10 | # since it's generating for an SDK rather than a cross-compile. Important | ||
11 | # differences are: | ||
12 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with | ||
13 | # real paths by meson-setup.sh when the SDK is extracted. | ||
14 | # - Some overrides aren't needed, since the SDK injects paths that take care of | ||
15 | # them. | ||
16 | def var_list2str(var, d): | ||
17 | items = d.getVar(var).split() | ||
18 | return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) | ||
19 | |||
20 | def generate_native_link_template(d): | ||
21 | val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
22 | '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
23 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', | ||
24 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', | ||
25 | '-Wl,--allow-shlib-undefined' | ||
26 | ] | ||
27 | build_arch = d.getVar('BUILD_ARCH') | ||
28 | if 'x86_64' in build_arch: | ||
29 | loader = 'ld-linux-x86-64.so.2' | ||
30 | elif 'i686' in build_arch: | ||
31 | loader = 'ld-linux.so.2' | ||
32 | elif 'aarch64' in build_arch: | ||
33 | loader = 'ld-linux-aarch64.so.1' | ||
34 | elif 'ppc64le' in build_arch: | ||
35 | loader = 'ld64.so.2' | ||
36 | |||
37 | if loader: | ||
38 | val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] | ||
39 | |||
40 | return repr(val) | ||
41 | |||
42 | do_install:append() { | ||
43 | install -d ${D}${datadir}/meson | ||
44 | |||
45 | cat >${D}${datadir}/meson/meson.native.template <<EOF | ||
46 | [binaries] | ||
47 | c = ${@meson_array('BUILD_CC', d)} | ||
48 | cpp = ${@meson_array('BUILD_CXX', d)} | ||
49 | ar = ${@meson_array('BUILD_AR', d)} | ||
50 | nm = ${@meson_array('BUILD_NM', d)} | ||
51 | strip = ${@meson_array('BUILD_STRIP', d)} | ||
52 | readelf = ${@meson_array('BUILD_READELF', d)} | ||
53 | pkgconfig = 'pkg-config-native' | ||
54 | |||
55 | [built-in options] | ||
56 | c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
57 | c_link_args = ${@generate_native_link_template(d)} | ||
58 | cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] | ||
59 | cpp_link_args = ${@generate_native_link_template(d)} | ||
60 | [properties] | ||
61 | sys_root = '@OECORE_NATIVE_SYSROOT' | ||
62 | EOF | ||
63 | |||
64 | cat >${D}${datadir}/meson/meson.cross.template <<EOF | ||
65 | [binaries] | ||
66 | c = @CC | ||
67 | cpp = @CXX | ||
68 | ar = @AR | ||
69 | nm = @NM | ||
70 | strip = @STRIP | ||
71 | pkgconfig = 'pkg-config' | ||
72 | |||
73 | [built-in options] | ||
74 | c_args = @CFLAGS | ||
75 | c_link_args = @LDFLAGS | ||
76 | cpp_args = @CPPFLAGS | ||
77 | cpp_link_args = @LDFLAGS | ||
78 | |||
79 | [properties] | ||
80 | needs_exe_wrapper = true | ||
81 | sys_root = @OECORE_TARGET_SYSROOT | ||
82 | |||
83 | [host_machine] | ||
84 | system = '${SDK_OS}' | ||
85 | cpu_family = '${@meson_cpu_family("SDK_ARCH", d)}' | ||
86 | cpu = '${SDK_ARCH}' | ||
87 | endian = '${@meson_endian("SDK", d)}' | ||
88 | EOF | ||
89 | |||
90 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d | ||
91 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ | ||
92 | |||
93 | # We need to wrap the real meson with a thin env setup wrapper. | ||
94 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real | ||
95 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson | ||
96 | } | ||
97 | |||
98 | RDEPENDS:${PN} += "\ | ||
99 | nativesdk-ninja \ | ||
100 | nativesdk-python3 \ | ||
101 | nativesdk-python3-setuptools \ | ||
102 | " | ||
103 | |||
104 | FILES:${PN} += "${datadir}/meson ${SDKPATHNATIVE}" | ||