diff options
| author | Linus Färnstrand <faern@faern.net> | 2021-12-27 21:47:58 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2021-12-29 13:57:09 +0100 |
| commit | 2dafa505bda64cddb84369d90f8a1f599f7050d5 (patch) | |
| tree | 1c2c0542cdaf76b5edf927290c98190d351b5f0c /build.sh | |
| parent | 56de07e2b35f08c7d5668cd04c0d4410262c3c57 (diff) | |
| download | mullvadvpn-2dafa505bda64cddb84369d90f8a1f599f7050d5.tar.xz mullvadvpn-2dafa505bda64cddb84369d90f8a1f599f7050d5.zip | |
Make build.sh produce single architecture pkg by default (--universal)
Add --universal flag for building universal app for both
Intel and Apple Silicon
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -26,9 +26,14 @@ while [[ "$#" -gt 0 ]]; do --dev-build) BUILD_MODE="dev" ;; - --target) - TARGET=("$2") - shift + --universal) + if [[ "$(uname -s)" == "Darwin" ]]; then + TARGETS=(x86_64-apple-darwin aarch64-apple-darwin) + NPM_PACK_ARGS+=(--universal) + else + echo "--universal only works on macOS" + exit 1 + fi ;; *) echo "Unknown parameter: $1" @@ -38,12 +43,6 @@ while [[ "$#" -gt 0 ]]; do shift done -if [[ "$(uname -s)" == "Darwin" && -z ${TARGET:-""} ]]; then - echo "Defaulting to universal macOS target since no target was provided" - TARGET=(x86_64-apple-darwin aarch64-apple-darwin) - NPM_PACK_ARGS+=(--universal) -fi - if [[ "$BUILD_MODE" == "release" ]]; then if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then echo "Dirty working directory!" @@ -99,10 +98,6 @@ else CARGO_ARGS+=(--locked) fi -if [[ "${TARGET:-""}" == "aarch64-apple-darwin" ]]; then - NPM_PACK_ARGS+=(--arm64) -fi - if [[ ("$(uname -s)" == "Darwin") ]]; then BINARIES=( mullvad-daemon @@ -251,8 +246,8 @@ fi ./update-api-address.sh # Compile for all defined targets, or the current architecture if unspecified. -if [[ -n ${TARGET:-""} ]]; then - for t in ${TARGET[*]}; do +if [[ -n ${TARGETS:-""} ]]; then + for t in ${TARGETS[*]}; do source env.sh "$t" build "$t" done |
