diff options
Diffstat (limited to 'desktop/scripts/build-pt-snowflake.sh')
-rwxr-xr-x | desktop/scripts/build-pt-snowflake.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/desktop/scripts/build-pt-snowflake.sh b/desktop/scripts/build-pt-snowflake.sh index 94300491..96a62565 100755 --- a/desktop/scripts/build-pt-snowflake.sh +++ b/desktop/scripts/build-pt-snowflake.sh @@ -1,9 +1,22 @@ #!/bin/bash SNOWFLAKE_TAG=v2.3.1 +OS=$(uname -s) + mkdir -p ./build/snowflake cd ./build/snowflake -git clone https://git.torproject.org/pluggable-transports/snowflake.git +git clone https://git.torproject.org/pluggable-transports/snowflake.git || echo "already cloned" cd snowflake git checkout $SNOWFLAKE_TAG -go build -o ../../../onionshare/resources/tor/snowflake-client ./client +if [ "$OS" == "Darwin" ]; then + if [[ $(uname -m) == 'arm64' ]]; then + go build -o ../../../onionshare/resources/tor/snowflake-client-arm64 ./client + GOOS=darwin GOARCH=amd64 go build -o ../../../onionshare/resources/tor/snowflake-client-amd64 ./client + lipo -create -output ../../../onionshare/resources/tor/snowflake-client ../../../onionshare/resources/tor/snowflake-client-arm64 ../../../onionshare/resources/tor/snowflake-client-amd64 + rm ../../../onionshare/resources/tor/snowflake-client-arm64 ../../../onionshare/resources/tor/snowflake-client-amd64 + elif [[ $(uname -m) == 'x86_64' ]]; then + go build -o ../../../onionshare/resources/tor/snowflake-client ./client + fi +else + go build -o ../../../onionshare/resources/tor/snowflake-client ./client +fi
\ No newline at end of file |