2022-06-19 14:57:37 -04:00
|
|
|
#!/bin/bash
|
2022-10-17 21:15:01 -04:00
|
|
|
SNOWFLAKE_TAG=v2.3.1
|
2022-06-19 14:57:37 -04:00
|
|
|
|
2022-12-30 16:23:52 -05:00
|
|
|
OS=$(uname -s)
|
|
|
|
|
2022-06-19 14:57:37 -04:00
|
|
|
mkdir -p ./build/snowflake
|
|
|
|
cd ./build/snowflake
|
2022-12-30 16:23:52 -05:00
|
|
|
git clone https://git.torproject.org/pluggable-transports/snowflake.git || echo "already cloned"
|
2022-06-19 14:57:37 -04:00
|
|
|
cd snowflake
|
|
|
|
git checkout $SNOWFLAKE_TAG
|
2022-12-30 16:23:52 -05:00
|
|
|
if [ "$OS" == "Darwin" ]; then
|
2023-02-06 21:31:02 -05:00
|
|
|
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
|
2022-12-30 16:23:52 -05:00
|
|
|
else
|
|
|
|
go build -o ../../../onionshare/resources/tor/snowflake-client ./client
|
|
|
|
fi
|