From df428574b8498428eb92f3d8034269f9e3635909 Mon Sep 17 00:00:00 2001 From: propelluo Date: Tue, 31 Mar 2026 11:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0pip=E5=AE=89=E8=A3=85meson?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: propelluo --- libfuse/tst-build.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libfuse/tst-build.sh b/libfuse/tst-build.sh index be0f75f..c3dfd16 100755 --- a/libfuse/tst-build.sh +++ b/libfuse/tst-build.sh @@ -20,6 +20,7 @@ build_dep_pkg_list=" ninja-build python3 python3-devel + python3-pip python3-pytest python3-packaging python3-py @@ -27,6 +28,26 @@ build_dep_pkg_list=" pkgconf-pkg-config " +ensure_meson_version() { + local required="0.60.0" + local current + current=$(meson --version 2>/dev/null || echo "0.0.0") + + if printf '%s\n%s\n' "$required" "$current" | sort -V | head -n1 | grep -qx "$required"; then + echo "meson version $current >= $required, OK" + return 0 + fi + + echo "meson version $current < $required, installing via pip..." + pip3 install -i https://mirrors.tencent.com/pypi/simple/ \ + --trusted-host mirrors.tencent.com \ + "meson>=$required" || return 1 + + hash -r + current=$(meson --version 2>/dev/null || echo "0.0.0") + echo "meson upgraded to $current via pip" +} + build_tool() { cp -r "$g_tool_dir" "$g_install_dir" && cd "$g_install_dir/libfuse" || return 1 @@ -76,6 +97,8 @@ main() { rpm -q "$pkg" || yum install -y "$pkg" done + ensure_meson_version || return 1 + mkdir -p "$g_install_dir" if build_tool; then echo "build $g_tool_dir success, dir $g_install_dir" -- Gitee