diff options
Diffstat (limited to 'meta/recipes-devtools/meson')
11 files changed, 219 insertions, 298 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc deleted file mode 100644 index f383ad9f74..0000000000 --- a/meta/recipes-devtools/meson/meson.inc +++ /dev/null @@ -1,37 +0,0 @@ -HOMEPAGE = "http://mesonbuild.com" -SUMMARY = "A high performance build system" -DESCRIPTION = "Meson is a build system designed to increase programmer \ -productivity. It does this by providing a fast, simple and easy to use \ -interface for modern software development tools and practices." - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" - -SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ - file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ - file://0001-python-module-do-not-manipulate-the-environment-when.patch \ - file://disable-rpath-handling.patch \ - file://0001-Make-CPU-family-warnings-fatal.patch \ - file://0002-Support-building-allarch-recipes-again.patch \ - file://0001-is_debianlike-always-return-False.patch \ - " -SRC_URI[sha256sum] = "5add789c953d984b500858b2851ee3d7add0460cf1a6f852f0a721af17384e13" - -UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases" -UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar" - -inherit setuptools3 - -RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" - -FILES:${PN} += "${datadir}/polkit-1" - -do_install:append () { - # As per the same issue in the python recipe itself: - # Unfortunately the following pyc files are non-deterministc due to 'frozenset' - # being written without strict ordering, even with PYTHONHASHSEED = 0 - # Upstream is discussing ways to solve the issue properly, until then let's - # just not install the problematic files. - # More info: http://benno.id.au/blog/2013/01/15/python-determinism - rm ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* -} diff --git a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch index c5be526b10..94129b2f25 100644 --- a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch +++ b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch @@ -1,40 +1,43 @@ -From 6c4eef1d92e9e42fdbc888365cab3c95fb33c605 Mon Sep 17 00:00:00 2001 +From c61c93f43b70ba0670d41e841bff9f2a7186cc2f Mon Sep 17 00:00:00 2001 From: Ross Burton <ross.burton@intel.com> Date: Tue, 3 Jul 2018 13:59:09 +0100 Subject: [PATCH] Make CPU family warnings fatal Upstream-Status: Inappropriate [OE specific] Signed-off-by: Ross Burton <ross.burton@intel.com> - --- - mesonbuild/envconfig.py | 2 +- - mesonbuild/environment.py | 4 +--- - 2 files changed, 2 insertions(+), 4 deletions(-) + mesonbuild/envconfig.py | 4 ++-- + mesonbuild/environment.py | 6 ++---- + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index 307aac3..66fb7ec 100644 +index 0e9cd23..b44e60c 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -267,7 +267,7 @@ class MachineInfo(HoldableObject): +@@ -276,8 +276,8 @@ class MachineInfo(HoldableObject): + 'but is missing {}.'.format(minimum_literal - set(literal))) cpu_family = literal['cpu_family'] - if cpu_family not in known_cpu_families: +- if cpu_family not in known_cpu_families: - mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new') ++ if cpu_family not in known_cpu_families and cpu_family != "riscv": + raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) endian = literal['endian'] if endian not in ('little', 'big'): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index 71286a5..179917e 100644 +index af69f64..248d6dd 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -352,9 +352,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: - trial = 'ppc64' +@@ -379,10 +379,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str: + if compilers and not any_compiler_has_define(compilers, '__mips64'): + trial = 'mips' - if trial not in known_cpu_families: +- if trial not in known_cpu_families: - mlog.warning(f'Unknown CPU family {trial!r}, please report this at ' - 'https://github.com/mesonbuild/meson/issues/new with the ' - 'output of `uname -a` and `cat /proc/cpuinfo`') ++ if trial not in known_cpu_families and trail != "riscv": + raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) return trial diff --git a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch deleted file mode 100644 index b098c4a123..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ /dev/null @@ -1,39 +0,0 @@ -From bbdd6679e49bcba5ec022b240ac234a87b451e41 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 4 Aug 2017 16:16:41 +0300 -Subject: [PATCH] gtkdoc: add support for a binary wrapper - -Make it possible to specify a wrapper for executing binaries -in cross-compiling scenarios. -(usually, some kind of target hardware emulator, such as qemu) - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/9627] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/modules/gnome.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index 1c6952d..5a6ff94 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -35,7 +35,7 @@ from ..mesonlib import ( - from ..dependencies import Dependency, PkgConfigDependency, InternalDependency - from ..interpreterbase import noPosargs, noKwargs, permittedKwargs, FeatureNew, FeatureNewKwargs, FeatureDeprecatedKwargs, FeatureDeprecated - from ..interpreterbase import typed_kwargs, KwargInfo, ContainerTypeInfo --from ..programs import ExternalProgram, OverrideProgram -+from ..programs import ExternalProgram, OverrideProgram, EmptyExternalProgram - from ..build import CustomTarget, CustomTargetIndex, GeneratedList - - if T.TYPE_CHECKING: -@@ -1103,6 +1103,9 @@ class GnomeModule(ExtensionModule): - args.append(f'--{program_name}={path}') - if namespace: - args.append('--namespace=' + namespace) -+ if state.environment.need_exe_wrapper() and not isinstance(state.environment.get_exe_wrapper(), EmptyExternalProgram): -+ args.append('--run=' + ' '.join(state.environment.get_exe_wrapper().get_command())) -+ - args += self._unpack_args('--htmlargs=', 'html_args', kwargs) - args += self._unpack_args('--scanargs=', 'scan_args', kwargs) - args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs) diff --git a/meta/recipes-devtools/meson/meson/0001-is_debianlike-always-return-False.patch b/meta/recipes-devtools/meson/meson/0001-is_debianlike-always-return-False.patch deleted file mode 100644 index 83c4782a61..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-is_debianlike-always-return-False.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 667b9ede638677fb37911306937ea62f05897581 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex@linutronix.de> -Date: Mon, 18 Oct 2021 15:55:59 +0200 -Subject: [PATCH] is_debianlike(): always return False - -Otherwise, host contamination happens. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex@linutronix.de> ---- - mesonbuild/mesonlib/universal.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py -index d670d04..47d1b52 100644 ---- a/mesonbuild/mesonlib/universal.py -+++ b/mesonbuild/mesonlib/universal.py -@@ -651,7 +651,7 @@ def is_cygwin() -> bool: - - - def is_debianlike() -> bool: -- return os.path.isfile('/etc/debian_version') -+ return False - - - def is_dragonflybsd() -> bool: diff --git a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch index 86abfa9d52..9f3f516a5c 100644 --- a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch +++ b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -1,4 +1,4 @@ -From dd5b4a200cd2fdf7fef627c4b6752f90c00b863a Mon Sep 17 00:00:00 2001 +From b4c0602a56d3517ab66b98a7dbb69defe77d29a3 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 19 Nov 2018 14:24:26 +0100 Subject: [PATCH] python module: do not manipulate the environment when calling @@ -6,33 +6,31 @@ Subject: [PATCH] python module: do not manipulate the environment when calling Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - --- - mesonbuild/modules/python.py | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) + mesonbuild/dependencies/python.py | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index f479ab9..b934bc6 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -239,10 +239,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', - # If python-X.Y.pc exists in LIBPC, we will try to use it - def wrap_in_pythons_pc_dir(name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], - installation: 'PythonInstallation') -> 'ExternalDependency': -- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) -- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) -- if pkg_libdir: +diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py +index b9b17f8..a305afb 100644 +--- a/mesonbuild/dependencies/python.py ++++ b/mesonbuild/dependencies/python.py +@@ -381,9 +381,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + empty.name = 'python' + return empty + +- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) +- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) - os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir - try: - return PythonPkgConfigDependency(name, env, kwargs, installation) - finally: -@@ -251,8 +247,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', - os.environ[name] = value - elif name in os.environ: - del os.environ[name] -- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) -- set_env('PKG_CONFIG_PATH', old_pkg_path) -+ pass + try: + return PythonPkgConfigDependency(name, env, kwargs, installation, True) + finally: +@@ -392,8 +389,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + os.environ[name] = value + elif name in os.environ: + del os.environ[name] +- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) +- set_env('PKG_CONFIG_PATH', old_pkg_path) ++ pass - candidates.extend([ - functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation), + candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation)) + # We only need to check both, if a python install has a LIBPC. It might point to the wrong location, diff --git a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch index dcc1ce9c27..fa5ea57d5b 100644 --- a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch +++ b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch @@ -1,7 +1,7 @@ -From 656bf55fed01df2d2e2ad6d9d9887173cb16b85c Mon Sep 17 00:00:00 2001 +From 7f69bfabb87d311d7409ea6699f7dee8e9b3a95b Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt <pkj@axis.com> Date: Thu, 26 Jul 2018 16:32:49 +0200 -Subject: [PATCH 2/2] Support building allarch recipes again +Subject: [PATCH] Support building allarch recipes again This registers "allarch" as a known CPU family. @@ -12,10 +12,10 @@ Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> 1 file changed, 1 insertion(+) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index 4d58c91..ff01ad1 100644 +index b44e60c..c70e8cb 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -36,6 +36,7 @@ from pathlib import Path +@@ -28,6 +28,7 @@ from pathlib import Path known_cpu_families = ( @@ -23,6 +23,3 @@ index 4d58c91..ff01ad1 100644 'aarch64', 'alpha', 'arc', --- -2.24.0 - diff --git a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch b/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch deleted file mode 100644 index 7aaed8b4a3..0000000000 --- a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 18600f7a1cddf23aeabd188f86e66983f27ccfe3 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Fri, 23 Nov 2018 15:28:28 +0000 -Subject: [PATCH] meson: Disable rpath stripping at install time - -We need to allow our rpaths generated through the compiler flags to make it into -our binaries. Therefore disable the meson manipulations of these unless there -is a specific directive to do something differently in the project. - -RP 2018/11/23 - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567] ---- - mesonbuild/minstall.py | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py -index 7d0da13..17d50db 100644 ---- a/mesonbuild/minstall.py -+++ b/mesonbuild/minstall.py -@@ -718,8 +718,11 @@ class Installer: - if file_copied: - self.did_install_something = True - try: -- self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, -- install_name_mappings, verbose=False) -+ if install_rpath: -+ self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, -+ install_name_mappings, verbose=False) -+ else: -+ print("RPATH changes at install time disabled") - except SystemExit as e: - if isinstance(e.code, int) and e.code == 0: - pass --- -2.20.1 - diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper index 8fafaad975..7455985297 100755 --- a/meta/recipes-devtools/meson/meson/meson-wrapper +++ b/meta/recipes-devtools/meson/meson/meson-wrapper @@ -1,11 +1,11 @@ #!/bin/sh if [ -z "$OECORE_NATIVE_SYSROOT" ]; then - echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2 + exec "meson.real" "$@" fi if [ -z "$SSL_CERT_DIR" ]; then - export SSL_CERT_DIR="${OECORE_NATIVE_SYSROOT}/etc/ssl/certs/" + export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/" fi # If these are set to a cross-compile path, meson will get confused and try to @@ -13,7 +13,19 @@ fi # config is already in meson.cross. unset CC CXX CPP LD AR NM STRIP +case "$1" in +setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;; +*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;; +esac + +if [ "$MESON_CMD" = "setup" ]; then + MESON_SETUP_OPTS=" \ + --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \ + --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \ + " + echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\" +fi + exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ - --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ - --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \ - "$@" + "$@" \ + $MESON_SETUP_OPTS diff --git a/meta/recipes-devtools/meson/meson_0.60.1.bb b/meta/recipes-devtools/meson/meson_0.60.1.bb deleted file mode 100644 index de9b905c12..0000000000 --- a/meta/recipes-devtools/meson/meson_0.60.1.bb +++ /dev/null @@ -1,4 +0,0 @@ -include meson.inc - -BBCLASSEXTEND = "native" - diff --git a/meta/recipes-devtools/meson/meson_1.4.0.bb b/meta/recipes-devtools/meson/meson_1.4.0.bb new file mode 100644 index 0000000000..5db100ff1c --- /dev/null +++ b/meta/recipes-devtools/meson/meson_1.4.0.bb @@ -0,0 +1,158 @@ +HOMEPAGE = "http://mesonbuild.com" +SUMMARY = "A high performance build system" +DESCRIPTION = "Meson is a build system designed to increase programmer \ +productivity. It does this by providing a fast, simple and easy to use \ +interface for modern software development tools and practices." + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" + +GITHUB_BASE_URI = "https://github.com/mesonbuild/meson/releases/" +SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \ + file://meson-setup.py \ + file://meson-wrapper \ + file://0001-python-module-do-not-manipulate-the-environment-when.patch \ + file://0001-Make-CPU-family-warnings-fatal.patch \ + file://0002-Support-building-allarch-recipes-again.patch \ + " +SRC_URI[sha256sum] = "8fd6630c25c27f1489a8a0392b311a60481a3c161aa699b330e25935b750138d" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$" + +inherit python_setuptools_build_meta github-releases + +RDEPENDS:${PN} = "ninja python3-modules python3-pkg-resources" + +FILES:${PN} += "${datadir}/polkit-1" + +do_install:append () { + # As per the same issue in the python recipe itself: + # Unfortunately the following pyc files are non-deterministc due to 'frozenset' + # being written without strict ordering, even with PYTHONHASHSEED = 0 + # Upstream is discussing ways to solve the issue properly, until then let's + # just not install the problematic files. + # More info: http://benno.id.au/blog/2013/01/15/python-determinism + rm -f ${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython* +} + +BBCLASSEXTEND = "native nativesdk" + +inherit meson-routines + +# The cross file logic is similar but not identical to that in meson.bbclass, +# since it's generating for an SDK rather than a cross-compile. Important +# differences are: +# - We can't set vars like CC, CXX, etc. yet because they will be filled in with +# real paths by meson-setup.sh when the SDK is extracted. +# - Some overrides aren't needed, since the SDK injects paths that take care of +# them. +def var_list2str(var, d): + items = d.getVar(var).split() + return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) + +def generate_native_link_template(d): + val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', + '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', + '-Wl,--allow-shlib-undefined' + ] + build_arch = d.getVar('BUILD_ARCH') + if 'x86_64' in build_arch: + loader = 'ld-linux-x86-64.so.2' + elif 'i686' in build_arch: + loader = 'ld-linux.so.2' + elif 'aarch64' in build_arch: + loader = 'ld-linux-aarch64.so.1' + elif 'ppc64le' in build_arch: + loader = 'ld64.so.2' + elif 'loongarch64' in build_arch: + loader = 'ld-linux-loongarch-lp64d.so.1' + elif 'riscv64' in build_arch: + loader = 'ld-linux-riscv64-lp64d.so.1' + + if loader: + val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] + + return repr(val) + +install_templates() { + install -d ${D}${datadir}/meson + + cat >${D}${datadir}/meson/meson.native.template <<EOF +[binaries] +c = ${@meson_array('BUILD_CC', d)} +cpp = ${@meson_array('BUILD_CXX', d)} +ar = ${@meson_array('BUILD_AR', d)} +nm = ${@meson_array('BUILD_NM', d)} +strip = ${@meson_array('BUILD_STRIP', d)} +readelf = ${@meson_array('BUILD_READELF', d)} +pkg-config = 'pkg-config-native' + +[built-in options] +c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] +c_link_args = ${@generate_native_link_template(d)} +cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] +cpp_link_args = ${@generate_native_link_template(d)} +[properties] +sys_root = '@OECORE_NATIVE_SYSROOT' +EOF + + cat >${D}${datadir}/meson/meson.cross.template <<EOF +[binaries] +c = @CC +cpp = @CXX +ar = @AR +nm = @NM +strip = @STRIP +pkg-config = 'pkg-config' + +[built-in options] +c_args = @CFLAGS +c_link_args = @LDFLAGS +cpp_args = @CPPFLAGS +cpp_link_args = @LDFLAGS + +[properties] +needs_exe_wrapper = true +sys_root = @OECORE_TARGET_SYSROOT + +[host_machine] +system = '$host_system' +cpu_family = '$host_cpu_family' +cpu = '$host_cpu' +endian = '$host_endian' +EOF +} + +do_install:append:class-nativesdk() { + host_system=${SDK_OS} + host_cpu_family=${@meson_cpu_family("SDK_ARCH", d)} + host_cpu=${SDK_ARCH} + host_endian=${@meson_endian("SDK", d)} + install_templates + + install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d + install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ + + # We need to wrap the real meson with a thin env setup wrapper. + mv ${D}${bindir}/meson ${D}${bindir}/meson.real + install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson +} + +FILES:${PN}:append:class-nativesdk = "${datadir}/meson ${SDKPATHNATIVE}" + +do_install:append:class-native() { + host_system=${HOST_OS} + host_cpu_family=${@meson_cpu_family("HOST_ARCH", d)} + host_cpu=${HOST_ARCH} + host_endian=${@meson_endian("HOST", d)} + install_templates + + install -d ${D}${datadir}/post-relocate-setup.d + install -m 0755 ${UNPACKDIR}/meson-setup.py ${D}${datadir}/post-relocate-setup.d/ + + # We need to wrap the real meson with a thin wrapper that substitues native/cross files + # when running in a direct SDK environment. + mv ${D}${bindir}/meson ${D}${bindir}/meson.real + install -m 0755 ${UNPACKDIR}/meson-wrapper ${D}${bindir}/meson +} diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb deleted file mode 100644 index 7b77041c7e..0000000000 --- a/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb +++ /dev/null @@ -1,104 +0,0 @@ -include meson.inc - -inherit meson-routines -inherit nativesdk - -SRC_URI += "file://meson-setup.py \ - file://meson-wrapper" - -# The cross file logic is similar but not identical to that in meson.bbclass, -# since it's generating for an SDK rather than a cross-compile. Important -# differences are: -# - We can't set vars like CC, CXX, etc. yet because they will be filled in with -# real paths by meson-setup.sh when the SDK is extracted. -# - Some overrides aren't needed, since the SDK injects paths that take care of -# them. -def var_list2str(var, d): - items = d.getVar(var).split() - return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) - -def generate_native_link_template(d): - val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', - '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', - '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', - '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', - '-Wl,--allow-shlib-undefined' - ] - build_arch = d.getVar('BUILD_ARCH') - if 'x86_64' in build_arch: - loader = 'ld-linux-x86-64.so.2' - elif 'i686' in build_arch: - loader = 'ld-linux.so.2' - elif 'aarch64' in build_arch: - loader = 'ld-linux-aarch64.so.1' - elif 'ppc64le' in build_arch: - loader = 'ld64.so.2' - - if loader: - val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] - - return repr(val) - -do_install:append() { - install -d ${D}${datadir}/meson - - cat >${D}${datadir}/meson/meson.native.template <<EOF -[binaries] -c = ${@meson_array('BUILD_CC', d)} -cpp = ${@meson_array('BUILD_CXX', d)} -ar = ${@meson_array('BUILD_AR', d)} -nm = ${@meson_array('BUILD_NM', d)} -strip = ${@meson_array('BUILD_STRIP', d)} -readelf = ${@meson_array('BUILD_READELF', d)} -pkgconfig = 'pkg-config-native' - -[built-in options] -c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] -c_link_args = ${@generate_native_link_template(d)} -cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}] -cpp_link_args = ${@generate_native_link_template(d)} -[properties] -sys_root = '@OECORE_NATIVE_SYSROOT' -EOF - - cat >${D}${datadir}/meson/meson.cross.template <<EOF -[binaries] -c = @CC -cpp = @CXX -ar = @AR -nm = @NM -strip = @STRIP -pkgconfig = 'pkg-config' - -[built-in options] -c_args = @CFLAGS -c_link_args = @LDFLAGS -cpp_args = @CPPFLAGS -cpp_link_args = @LDFLAGS - -[properties] -needs_exe_wrapper = true -sys_root = @OECORE_TARGET_SYSROOT - -[host_machine] -system = '${SDK_OS}' -cpu_family = '${@meson_cpu_family("SDK_ARCH", d)}' -cpu = '${SDK_ARCH}' -endian = '${@meson_endian("SDK", d)}' -EOF - - install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d - install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ - - # We need to wrap the real meson with a thin env setup wrapper. - mv ${D}${bindir}/meson ${D}${bindir}/meson.real - install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson -} - -RDEPENDS:${PN} += "\ - nativesdk-ninja \ - nativesdk-python3 \ - nativesdk-python3-setuptools \ - " - -FILES:${PN} += "${datadir}/meson ${SDKPATHNATIVE}" |