tools/meson: sync with upstream

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
This commit is contained in:
Linhui Liu 2022-10-23 12:19:36 +08:00
parent 0fe111a083
commit fe40a5e5bb
3 changed files with 23 additions and 4 deletions

View File

@ -19,7 +19,6 @@
#
# Host packages are built in the same fashion, just use these vars instead:
#
# HOST_BUILD_DEPENDS:=meson/host
# MESON_HOST_ARGS+=-Dfoo -Dbar=baz
# MESON_HOST_VARS+=FOO=bar
@ -57,7 +56,7 @@ MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))"
endif
define Meson
$(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(MESON_DIR)/meson.py $(1)
$(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson.py $(1)
endef
define Meson/CreateNativeFile
@ -101,7 +100,7 @@ define Host/Configure/Meson
--native-file $(HOST_BUILD_DIR)/openwrt-native.txt \
$(MESON_HOST_ARGS) \
$(MESON_HOST_BUILD_DIR) \
$(HOST_BUILD_DIR), \
$(MESON_HOST_BUILD_DIR)/.., \
$(MESON_HOST_VARS))
endef

View File

@ -25,7 +25,6 @@ define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/meson
$(INSTALL_CONF) files/openwrt-cross.txt.in $(STAGING_DIR_HOST)/lib/meson/
$(INSTALL_CONF) files/openwrt-native.txt.in $(STAGING_DIR_HOST)/lib/meson/
$(HOST_BUILD_DIR)/packaging/create_zipapp.py $(HOST_BUILD_DIR) --outfile $(STAGING_DIR_HOST)/lib/meson/meson.py
endef
define Host/Clean

View File

@ -0,0 +1,21 @@
From 7d1ef4343ed5b2b7ab51469177a42c32c47f0528 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Tue, 6 Sep 2022 01:36:17 -0700
Subject: [PATCH] minstall: handle extra error for selinuxenabled
Microsoft's WSL2 uses a Plan 9 filesystem, which returns IOError when file is missing.
---
mesonbuild/minstall.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -229,7 +229,7 @@ def restore_selinux_contexts() -> None:
'''
try:
subprocess.check_call(['selinuxenabled'])
- except (FileNotFoundError, NotADirectoryError, PermissionError, subprocess.CalledProcessError):
+ except (FileNotFoundError, NotADirectoryError, OSError, PermissionError, subprocess.CalledProcessError):
# If we don't have selinux or selinuxenabled returned 1, failure
# is ignored quietly.
return