build 1.4 KB

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