Commit 4ff2be0b authored by David Fifield's avatar David Fifield Committed by Georg Koppen
Browse files

Bug 25483: Use snowflake from the cohosh/pion branch.

Switched to using the pion/webrtc library and modified the targets
to build snowflake on all platforms.
parent 273e0979
#!/bin/bash #!/bin/bash
[% c("var/set_default_env") -%] [% c("var/set_default_env") -%]
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %] [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
[% IF c("var/linux") %]
tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
export PATH="/var/tmp/dist/binutils/bin:$PATH"
# The go-webrtc package sets _GLIBCXX_USE_CXX11_ABI=0 for compatibility with
# the prebuilt libwebrtc-magic.a libraries. Since we build our own
# libwebrtc-magic.a with the C++11 ABI, we have to undo that setting here,
# using CGO_CXXFLAGS.
export CGO_CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
[% END -%]
distdir=/var/tmp/dist/[% project %] distdir=/var/tmp/dist/[% project %]
[% c("var/set_PTDIR_DOCSDIR") -%] [% c("var/set_PTDIR_DOCSDIR") -%]
mkdir -p $PTDIR $DOCSDIR mkdir -p $PTDIR $DOCSDIR
[% IF c("var/osx") %]
export CGO_ENABLED=1
export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=[% c("var/macosx_deployment_target") %]"
export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=[% c("var/macosx_deployment_target") %]"
export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=[% c("var/macosx_deployment_target") %]"
export CC="$clangdir/bin/clang"
export CXX="$clangdir/bin/clang++"
[% END %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/go-webrtc') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/uniuri') %] tar -C /var/tmp/dist -xf [% c('input_files_by_name/uniuri') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %] 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') %]
mkdir -p /var/tmp/build mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
...@@ -35,16 +17,7 @@ mkdir -p "$GOPATH/src/git.torproject.org/pluggable-transports" ...@@ -35,16 +17,7 @@ mkdir -p "$GOPATH/src/git.torproject.org/pluggable-transports"
ln -sf "$PWD" "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git" ln -sf "$PWD" "$GOPATH/src/git.torproject.org/pluggable-transports/snowflake.git"
cd client cd client
[% IF c("var/osx") -%] go build -ldflags '-s'
# Without faketime, snowflake-client would contain the timestamp of the
# temporary client.a file created during "go build".
# The -tmpdir flag overrides what would otherwise be a randomly generated
# path, /tmp/go-link-RANDOMNUM/go.o.
mkdir -p /var/tmp/go-link.tmpdir
[% c("var/faketime") %] go build -ldflags '-s -tmpdir /var/tmp/go-link.tmpdir'
[% ELSE -%]
go build -ldflags '-s'
[% END -%]
cp -a client[% IF c("var/windows") %].exe[% END %] $PTDIR/snowflake-client[% IF c("var/windows") %].exe[% END %] cp -a client[% IF c("var/windows") %].exe[% END %] $PTDIR/snowflake-client[% IF c("var/windows") %].exe[% END %]
cd .. cd ..
......
# vim: filetype=yaml sw=2 # vim: filetype=yaml sw=2
version: '[% c("abbrev") %]' version: '[% c("abbrev") %]'
git_url: https://git.torproject.org/pluggable-transports/snowflake.git git_url: https://github.com/cohosh/snowflake
git_hash: cd650fa0097f948b15dddd889ad2e6908b58bd66 git_hash: 49a899be452a58db27ecc94223b0c527bf8d4927
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz' filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
var: var:
container: container:
use_container: 1 use_container: 1
targets:
linux-i686:
var:
arch_deps:
- pkg-config
- libx11-dev:i386
linux-x86_64:
var:
arch_deps:
- pkg-config
- libx11-dev
osx-x86_64:
var:
arch_deps:
- pkg-config
- faketime
input_files: input_files:
- project: container-image - project: container-image
- name: go - name: go
project: go project: go
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- name: binutils
project: binutils
enable: '[% c("var/linux") %]'
- name: go-webrtc
project: go-webrtc
- name: uniuri - name: uniuri
project: uniuri project: uniuri
- name: goptlib - name: goptlib
project: goptlib project: goptlib
- name: pion-webrtc
project: pion-webrtc
## obfs4proxy configuration ## obfs4proxy configuration
ClientTransportPlugin meek_lite,obfs2,obfs3,obfs4,scramblesuit exec TorBrowser\Tor\PluggableTransports\obfs4proxy.exe ClientTransportPlugin meek_lite,obfs2,obfs3,obfs4,scramblesuit exec TorBrowser\Tor\PluggableTransports\obfs4proxy.exe
## snowflake configuration
ClientTransportPlugin snowflake exec TorBrowser\Tor\PluggableTransports\snowflake-client.exe -url https://snowflake-broker.azureedge.net/ -front ajax.aspnetcdn.com -ice stun:stun.l.google.com:19302
...@@ -108,19 +108,12 @@ cp -a Bundle-Data/Docs/* "$TBDIR/$DOCSPATH" ...@@ -108,19 +108,12 @@ cp -a Bundle-Data/Docs/* "$TBDIR/$DOCSPATH"
tar -C Bundle-Data/[% bundledata_osname %] -c . | tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -x tar -C Bundle-Data/[% bundledata_osname %] -c . | tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -x
cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$TBDIR/$TORCONFIGPATH/torrc-defaults" cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$TBDIR/$TORCONFIGPATH/torrc-defaults"
[% IF c("var/linux") || c("var/osx") -%] [% IF ! c("var/snowflake") %]
[% IF ! c("var/snowflake") %]
grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
>> "$GENERATEDPREFSPATH"
[% ELSE %]
cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH"
[% END %]
[% END -%]
[% IF c("var/windows") -%]
# We don't have snowflake available on Windows (yet).
grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \ grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
>> "$GENERATEDPREFSPATH" >> "$GENERATEDPREFSPATH"
[% END -%] [% ELSE %]
cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH"
[% END %]
[% IF ! c("var/multi_lingual") %] [% IF ! c("var/multi_lingual") %]
echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH" echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH"
......
...@@ -247,7 +247,7 @@ targets: ...@@ -247,7 +247,7 @@ targets:
var: var:
linux: 1 linux: 1
compiler: gcc compiler: gcc
# We only build snowflake for linux and macOS on the alpha and nightly # We only build snowflake on the alpha and nightly
# channels for now. # channels for now.
snowflake: '[% c("var/alpha") || c("var/nightly") %]' snowflake: '[% c("var/alpha") || c("var/nightly") %]'
container: container:
...@@ -299,6 +299,9 @@ targets: ...@@ -299,6 +299,9 @@ targets:
flag_mwindows: '-mwindows' flag_mwindows: '-mwindows'
compiler: mingw-w64 compiler: mingw-w64
faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
# We only build snowflake on the alpha and nightly
# channels for now.
snowflake: '[% c("var/alpha") || c("var/nightly") %]'
deps: deps:
- build-essential - build-essential
- python - python
...@@ -324,7 +327,7 @@ targets: ...@@ -324,7 +327,7 @@ targets:
LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie" LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
macosx_deployment_target: '10.9' macosx_deployment_target: '10.9'
locale_ja: ja-JP-mac locale_ja: ja-JP-mac
# We only build snowflake for linux and macOS on the alpha and nightly # We only build snowflake on the alpha and nightly
# channels for now. # channels for now.
snowflake: '[% c("var/alpha") || c("var/nightly") %]' snowflake: '[% c("var/alpha") || c("var/nightly") %]'
deps: deps:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment