From cd87dc3aa302882f104d63df94091ac309c5f162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 19 Dec 2024 20:30:32 +0100 Subject: [PATCH] ShellScriptlets.py: fix meson setup command --- HaikuPorter/ShellScriptlets.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/HaikuPorter/ShellScriptlets.py b/HaikuPorter/ShellScriptlets.py index 5b0f644..7548793 100644 --- a/HaikuPorter/ShellScriptlets.py +++ b/HaikuPorter/ShellScriptlets.py @@ -348,7 +348,8 @@ def getShellVariableSetters(shellVariables): # helper function to validate Meson invocations (and use the correct one) meson() { - if [[ "$*" != *buildtype* ]]; then + if [[ "$*" != *buildtype* ]] && [[ "$*" != compile* ]] \ + && [[ "$*" != install* ]] && [[ "$*" != test* ]]; then echo "error: invoking meson without --buildtype argument" echo "note: you probably want --buildtype=release or --buildtype=debugoptimized" exit 1 @@ -365,7 +366,17 @@ def getShellVariableSetters(shellVariables): MESON=$(type -Pp meson) fi - $MESON --wrap-mode=nodownload "$@" + if [[ "$*" != compile* ]] && [[ "$*" != install* ]] \ + && [[ "$*" != test* ]]; then + local PATTERN='^setup (.*)' + if [[ "$*" =~ $PATTERN ]]; then + $MESON setup --wrap-mode=nodownload ${BASH_REMATCH[1]} + else + $MESON --wrap-mode=nodownload "$@" + fi + else + $MESON "$@" + fi } fixDevelopLibDirReferences()