Skip to content

Commit

Permalink
ShellScriptlets.py: fix meson setup command
Browse files Browse the repository at this point in the history
  • Loading branch information
korli committed Dec 20, 2024
1 parent efe357b commit cd87dc3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions HaikuPorter/ShellScriptlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit cd87dc3

Please sign in to comment.