diff --git a/include/meson.mk b/include/meson.mk index 2d0624a30..7d67dcf29 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -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 diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 34634620f..d53ed897a 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -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 diff --git a/tools/meson/patches/010-wsl2.patch b/tools/meson/patches/010-wsl2.patch new file mode 100644 index 000000000..4ab799d69 --- /dev/null +++ b/tools/meson/patches/010-wsl2.patch @@ -0,0 +1,21 @@ +From 7d1ef4343ed5b2b7ab51469177a42c32c47f0528 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +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