Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 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://meson-setup.py \ |
| 12 | file://meson-wrapper \ |
| 13 | file://0001-python-module-do-not-manipulate-the-environment-when.patch \ |
| 14 | file://disable-rpath-handling.patch \ |
| 15 | file://0001-Make-CPU-family-warnings-fatal.patch \ |
| 16 | file://0002-Support-building-allarch-recipes-again.patch \ |
| 17 | file://0001-is_debianlike-always-return-False.patch \ |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 18 | file://0001-Check-for-clang-before-guessing-gcc-or-lcc.patch \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 19 | " |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 20 | SRC_URI[sha256sum] = "a7669e4c4110b06b743d57cc5d6432591a6677ef2402139fe4f3d42ac13380b0" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 21 | |
| 22 | UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" |
| 23 | UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar" |
| 24 | |
| 25 | inherit python_setuptools_build_meta |
| 26 | |
| 27 | RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" |
| 28 | |
| 29 | FILES:${PN} += "${datadir}/polkit-1" |
| 30 | |
| 31 | do_install:append () { |
| 32 | # As per the same issue in the python recipe itself: |
| 33 | # Unfortunately the following pyc files are non-deterministc due to 'frozenset' |
| 34 | # being written without strict ordering, even with PYTHONHASHSEED = 0 |
| 35 | # Upstream is discussing ways to solve the issue properly, until then let's |
| 36 | # just not install the problematic files. |
| 37 | # More info: http://benno.id.au/blog/2013/01/15/python-determinism |
| 38 | rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* |
| 39 | } |
| 40 | |
| 41 | BBCLASSEXTEND = "native nativesdk" |
| 42 | |
| 43 | inherit meson-routines |
| 44 | |
| 45 | # The cross file logic is similar but not identical to that in meson.bbclass, |
| 46 | # since it's generating for an SDK rather than a cross-compile. Important |
| 47 | # differences are: |
| 48 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with |
| 49 | # real paths by meson-setup.sh when the SDK is extracted. |
| 50 | # - Some overrides aren't needed, since the SDK injects paths that take care of |
| 51 | # them. |
| 52 | def var_list2str(var, d): |
| 53 | items = d.getVar(var).split() |
| 54 | return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) |
| 55 | |
| 56 | def generate_native_link_template(d): |
| 57 | val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', |
| 58 | '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', |
| 59 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', |
| 60 | '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', |
| 61 | '-Wl,--allow-shlib-undefined' |
| 62 | ] |
| 63 | build_arch = d.getVar('BUILD_ARCH') |
| 64 | if 'x86_64' in build_arch: |
| 65 | loader = 'ld-linux-x86-64.so.2' |
| 66 | elif 'i686' in build_arch: |
| 67 | loader = 'ld-linux.so.2' |
| 68 | elif 'aarch64' in build_arch: |
| 69 | loader = 'ld-linux-aarch64.so.1' |
| 70 | elif 'ppc64le' in build_arch: |
| 71 | loader = 'ld64.so.2' |
| 72 | |
| 73 | if loader: |
| 74 | val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] |
| 75 | |
| 76 | return repr(val) |
| 77 | |
| 78 | do_install:append:class-nativesdk() { |
| 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 | pkgconfig = '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 | pkgconfig = '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 = '${SDK_OS}' |
| 121 | cpu_family = '${@meson_cpu_family("SDK_ARCH", d)}' |
| 122 | cpu = '${SDK_ARCH}' |
| 123 | endian = '${@meson_endian("SDK", d)}' |
| 124 | EOF |
| 125 | |
| 126 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 127 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ |
| 128 | |
| 129 | # We need to wrap the real meson with a thin env setup wrapper. |
| 130 | mv ${D}${bindir}/meson ${D}${bindir}/meson.real |
| 131 | install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson |
| 132 | } |
| 133 | |
| 134 | FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" |