devx: fix build sdk script options for macos

This commit is contained in:
Valere 2026-04-21 15:34:01 +02:00
parent bf18c0d560
commit 909007c1b4
2 changed files with 19 additions and 7 deletions

View file

@ -144,6 +144,11 @@ Prerequisites:
export ANDROID_HOME=$HOME/android/sdk export ANDROID_HOME=$HOME/android/sdk
``` ```
* On macos ensure gnu-getopt is installed
```
brew install gnu-getopt
```
You can then build the Rust SDK by running the script You can then build the Rust SDK by running the script
[`tools/sdk/build-rust-sdk`](../tools/sdk/build-rust-sdk). Type [`tools/sdk/build-rust-sdk`](../tools/sdk/build-rust-sdk). Type
`./tools/sdk/build-rust-sdk --help` for help. `./tools/sdk/build-rust-sdk --help` for help.

View file

@ -41,7 +41,14 @@ sdkArg=""
## Argument parsing ## Argument parsing
TEMP=$(getopt -o 'rs:b:at:h' --long 'remote,sdk:,branch:,build-app,target-arch:,help' -- "$@") # Use GNU getopt (required for --long support on macOS)
if [[ "$OSTYPE" == "darwin"* ]]; then
GNU_GETOPT="$(brew --prefix gnu-getopt)/bin/getopt"
else
GNU_GETOPT="getopt"
fi
TEMP=$("$GNU_GETOPT" -o 'rs:b:at:h' --long 'remote,sdk:,branch:,build-app,target-arch:,help' -- "$@")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo 'Terminating...' >&2 echo 'Terminating...' >&2
@ -53,32 +60,32 @@ unset TEMP
while true; do while true; do
case "$1" in case "$1" in
'r'|'--remote') '-r'|'--remote')
buildLocal=1 buildLocal=1
shift shift
continue continue
;; ;;
's'|'--sdk') '-s'|'--sdk')
sdkArg="$2" sdkArg="$2"
shift 2 shift 2
continue continue
;; ;;
'b'|'--branch') '-b'|'--branch')
rustSdkBranch="$2" rustSdkBranch="$2"
shift 2 shift 2
continue continue
;; ;;
'a'|'--build-app') '-a'|'--build-app')
buildApp=0 buildApp=0
shift shift
continue continue
;; ;;
't'|'--target-arch') '-t'|'--target-arch')
target_arch="$2" target_arch="$2"
shift 2 shift 2
continue continue
;; ;;
'h'|'--help') '-h'|'--help')
cat << END cat << END
SYNOPSIS SYNOPSIS