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