123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/bin/bash
- [% c("var/set_default_env") -%]
- [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
- distdir=/var/tmp/dist/[% project %]
- mkdir -p $distdir
- [% IF c("var/android") -%]
- [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
- # We need to explicitly set CGO_ENABLED with Go 1.13.x as the Android build
- # breaks otherwise.
- export CGO_ENABLED=1
- [% END -%]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxtext') %]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/pion-webrtc') %]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/kcp-go') %]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/smux') %]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/refraction-utls') %]
- mkdir -p /var/tmp/build
- tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
- cd /var/tmp/build/[% project %]-[% c('version') %]
- # snowflake sources hard-code these paths
- mkdir -p "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git"
- ln -sf "$PWD" "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git/v2"
- # Fix gopath location of versioned dependencies
- ln -sf "$GOPATH/src/github.com/pion/webrtc" "$GOPATH/src/github.com/pion/webrtc/v2"
- ln -sf "$GOPATH/src/github.com/pion/sdp" "$GOPATH/src/github.com/pion/sdp/v2"
- ln -sf "$GOPATH/src/github.com/xtaci/kcp-go" "$GOPATH/src/github.com/xtaci/kcp-go/v5"
- cd client
- go build -ldflags '-s'
- cp -a client[% IF c("var/windows") %].exe[% END %] $distdir/snowflake-client[% IF c("var/windows") %].exe[% END %]
- cd ..
- cp -a README.md $distdir/README.SNOWFLAKE.md
- cd $distdir
- [% c('tar', {
- tar_src => [ '.' ],
- tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
- }) %]
|