blob: 96a62565b95c827dad00b14eccd49a7554e337da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 || echo "already cloned"
cd snowflake
git checkout $SNOWFLAKE_TAG
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
|