config 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # vim: filetype=yaml sw=2
  2. version: '[% c("abbrev") %]'
  3. git_url: https://git.torproject.org/pluggable-transports/snowflake.git
  4. git_hash: d11e55aabe3753dbddca18ae084c80ad09e282d3
  5. filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
  6. build: '[% c("projects/go/var/build_go_lib") %]'
  7. var:
  8. container:
  9. use_container: 1
  10. go_lib: git.torproject.org/pluggable-transports/snowflake.git
  11. go_lib_install:
  12. - git.torproject.org/pluggable-transports/snowflake.git/client
  13. go_lib_deps:
  14. - go-webrtc
  15. - uniuri
  16. - goptlib
  17. go_lib_ldflags: '-s'
  18. build_go_lib_pre: |
  19. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  20. [% IF c("var/linux") %]
  21. tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
  22. export PATH="/var/tmp/dist/binutils/bin:$PATH"
  23. # The go-webrtc package sets _GLIBCXX_USE_CXX11_ABI=0 for compatibility with
  24. # the prebuilt libwebrtc-magic.a libraries. Since we build our own
  25. # libwebrtc-magic.a with the C++11 ABI, we have to undo that setting here,
  26. # using CGO_CXXFLAGS.
  27. export CGO_CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
  28. [% END -%]
  29. [% IF c("var/osx") %]
  30. export CGO_ENABLED=1
  31. export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=10.7"
  32. export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7"
  33. export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7"
  34. export CC="$clangdir/bin/clang"
  35. export CXX="$clangdir/bin/clang++"
  36. # Without faketime, snowflake-client would contain the timestamp of the
  37. # temporary client.a file created during "go build".
  38. # The -tmpdir flag overrides what would otherwise be a randomly generated
  39. # path, /tmp/go-link-RANDOMNUM/go.o.
  40. mkdir -p /var/tmp/go-link.tmpdir
  41. [% END %]
  42. go_lib_no_output: 1
  43. build_go_lib_post: |
  44. [% c("var/set_PTDIR_DOCSDIR") -%]
  45. mkdir -p $PTDIR $DOCSDIR
  46. cp -a "$GOTARGETBIN/client[% IF c('var/windows') %].exe[% END %]" $PTDIR/snowflake-client[% IF c("var/windows") %].exe[% END %]
  47. cd "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git/"
  48. cp -a README.md LICENSE $DOCSDIR
  49. cd $distdir
  50. [% c('tar', {
  51. tar_src => [ '.' ],
  52. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  53. }) %]
  54. targets:
  55. linux-i686:
  56. var:
  57. arch_deps:
  58. - pkg-config
  59. - libx11-dev:i386
  60. linux-x86_64:
  61. var:
  62. arch_deps:
  63. - pkg-config
  64. - libx11-dev
  65. osx-x86_64:
  66. var:
  67. arch_deps:
  68. - faketime
  69. go_lib_install_env: '[% c("var/faketime") %]'
  70. go_lib_ldflags: '-s -tmpdir /var/tmp/go-link.tmpdir'
  71. input_files:
  72. - project: container-image
  73. - name: go
  74. project: go
  75. - name: '[% c("var/compiler") %]'
  76. project: '[% c("var/compiler") %]'
  77. - name: binutils
  78. project: binutils
  79. enable: '[% c("var/linux") %]'
  80. - name: go-webrtc
  81. project: go-webrtc
  82. - name: uniuri
  83. project: uniuri
  84. - name: goptlib
  85. project: goptlib