build 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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
  7. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
  8. tar -C /var/tmp/dist -xf [% c('input_files_by_name/ed25519') %]
  9. tar -C /var/tmp/dist -xf [% c('input_files_by_name/siphash') %]
  10. tar -C /var/tmp/dist -xf [% c('input_files_by_name/uniuri') %]
  11. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxcrypto') %]
  12. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxnet') %]
  13. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goutls') %]
  14. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxtext') %]
  15. mkdir -p /var/tmp/build
  16. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  17. cd /var/tmp/build/[% project %]-[% c('version') %]
  18. # Remove go.mod and go.sum files until we can build using Go module
  19. # versioning (see bug 28325).
  20. rm -f go.mod go.sum
  21. mkdir -p "$GOPATH/src/gitlab.com/yawning"
  22. ln -sf "$PWD" "$GOPATH/src/gitlab.com/yawning/obfs4.git"
  23. cd obfs4proxy
  24. go build -ldflags '-s'
  25. cp -a obfs4proxy[% IF c("var/windows") %].exe[% END %] $PTDIR
  26. cd $distdir
  27. [% c('tar', {
  28. tar_src => [ '.' ],
  29. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  30. }) %]