commit 4ff2be0b02e322716f06829e49c50f39795bf43c
Author: David Fifield <da...@bamsoftware.com>
Date:   Thu Aug 29 03:05:45 2019 +0000

    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.
---
 projects/snowflake/build                           | 31 ++--------------------
 projects/snowflake/config                          | 30 +++------------------
 .../PTConfigs/windows/torrc-defaults-appendix      |  3 +++
 projects/tor-browser/build                         | 15 +++--------
 rbm.conf                                           |  7 +++--
 5 files changed, 18 insertions(+), 68 deletions(-)

diff --git a/projects/snowflake/build b/projects/snowflake/build
index 6534329..5309318 100644
--- a/projects/snowflake/build
+++ b/projects/snowflake/build
@@ -1,31 +1,13 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
 [% 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 %]
 [% c("var/set_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/goptlib') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/pion-webrtc') %]
 
 mkdir -p /var/tmp/build
 tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
@@ -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"
 
 cd client
-[% IF c("var/osx") -%]
-  # 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 -%]
+go build -ldflags '-s'
 cp -a client[% IF c("var/windows") %].exe[% END %] $PTDIR/snowflake-client[% 
IF c("var/windows") %].exe[% END %]
 
 cd ..
diff --git a/projects/snowflake/config b/projects/snowflake/config
index cef0930..1f74d48 100644
--- a/projects/snowflake/config
+++ b/projects/snowflake/config
@@ -1,42 +1,20 @@
 # vim: filetype=yaml sw=2
 version: '[% c("abbrev") %]'
-git_url: https://git.torproject.org/pluggable-transports/snowflake.git
-git_hash: cd650fa0097f948b15dddd889ad2e6908b58bd66
+git_url: https://github.com/cohosh/snowflake
+git_hash: 49a899be452a58db27ecc94223b0c527bf8d4927
 filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% 
c("var/build_id") %].tar.gz'
 
 var:
   container:
     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:
   - project: container-image
   - name: 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
     project: uniuri
   - name: goptlib
     project: goptlib
+  - name: pion-webrtc
+    project: pion-webrtc
diff --git 
a/projects/tor-browser/Bundle-Data/PTConfigs/windows/torrc-defaults-appendix 
b/projects/tor-browser/Bundle-Data/PTConfigs/windows/torrc-defaults-appendix
index 18b8460..af16b3c 100644
--- a/projects/tor-browser/Bundle-Data/PTConfigs/windows/torrc-defaults-appendix
+++ b/projects/tor-browser/Bundle-Data/PTConfigs/windows/torrc-defaults-appendix
@@ -1,2 +1,5 @@
 ## obfs4proxy configuration
 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
diff --git a/projects/tor-browser/build b/projects/tor-browser/build
index ed69f19..67419a8 100644
--- a/projects/tor-browser/build
+++ b/projects/tor-browser/build
@@ -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
 
 cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> 
"$TBDIR/$TORCONFIGPATH/torrc-defaults"
-[% IF c("var/linux") || c("var/osx") -%]
-  [% 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).
+[% IF ! c("var/snowflake") %]
   grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
     >> "$GENERATEDPREFSPATH"
-[% END -%]
+[% ELSE %]
+  cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH"
+[% END %]
 
 [% IF ! c("var/multi_lingual") %]
   echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> 
"$GENERATEDPREFSPATH"
diff --git a/rbm.conf b/rbm.conf
index 581bd0e..e6379f8 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -247,7 +247,7 @@ targets:
     var:
       linux: 1
       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.
       snowflake: '[% c("var/alpha") || c("var/nightly") %]'
       container:
@@ -299,6 +299,9 @@ targets:
       flag_mwindows: '-mwindows'
       compiler: mingw-w64
       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:
         - build-essential
         - python
@@ -324,7 +327,7 @@ targets:
       LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
       macosx_deployment_target: '10.9'
       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.
       snowflake: '[% c("var/alpha") || c("var/nightly") %]'
       deps:



_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to