build 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
  4. distdir=/var/tmp/dist/[% project %]
  5. [% c("var/set_PTDIR_DOCSDIR") -%]
  6. mkdir -p $PTDIR $DOCSDIR
  7. tar -C /var/tmp/dist -xf [% c('input_files_by_name/uniuri') %]
  8. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
  9. tar -C /var/tmp/dist -xf [% c('input_files_by_name/pion-webrtc') %]
  10. mkdir -p /var/tmp/build
  11. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  12. cd /var/tmp/build/[% project %]-[% c('version') %]
  13. mkdir -p "$GOPATH/src/git.torproject.org/pluggable-transports"
  14. ln -sf "$PWD" "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git"
  15. # Remove go.mod and go.sum files until we can build using Go module versioning
  16. rm -f go.mod go.sum
  17. # Fix gopath location of versioned dependencies
  18. ln -sf "$GOPATH/src/github.com/pion/webrtc" "$GOPATH/src/github.com/pion/webrtc/v2"
  19. ln -sf "$GOPATH/src/github.com/pion/sdp" "$GOPATH/src/github.com/pion/sdp/v2"
  20. cd client
  21. go build -ldflags '-s'
  22. cp -a client[% IF c("var/windows") %].exe[% END %] $PTDIR/snowflake-client[% IF c("var/windows") %].exe[% END %]
  23. cd ..
  24. cp -a README.md $DOCSDIR
  25. cd $distdir
  26. [% c('tar', {
  27. tar_src => [ '.' ],
  28. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  29. }) %]