[tbb-commits] [tor-browser-build/master] Add a set_PTDIR_DOCSDIR option

boklm at torproject.org boklm at torproject.org
Mon Jul 24 08:42:36 UTC 2017


commit 96d8b9e72e2eddb0c542b2fe5ddac0e39b3879a6
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Jul 24 10:38:30 2017 +0200

    Add a set_PTDIR_DOCSDIR option
---
 projects/meek/build      | 8 +-------
 projects/obfs4/build     | 6 +-----
 projects/snowflake/build | 8 ++------
 rbm.conf                 | 8 ++++++++
 4 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/projects/meek/build b/projects/meek/build
index 8d1beb7..81734be 100644
--- a/projects/meek/build
+++ b/projects/meek/build
@@ -2,13 +2,7 @@
 [% c("var/set_default_env") -%]
 [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
 distdir=/var/tmp/dist/[% project %]
-[% IF c("var/osx") %]
-  PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
-  DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/meek"
-[% ELSE %]
-  PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
-  DOCSDIR="$distdir/TorBrowser/Docs/meek"
-[% END %]
+[% c("var/set_PTDIR_DOCSDIR") -%]
 mkdir -p $PTDIR $DOCSDIR
 
 tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
diff --git a/projects/obfs4/build b/projects/obfs4/build
index 61ef481..287704a 100644
--- a/projects/obfs4/build
+++ b/projects/obfs4/build
@@ -2,11 +2,7 @@
 [% c("var/set_default_env") -%]
 [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
 distdir=/var/tmp/dist/[% project %]
-[% IF c("var/osx") %]
-  PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
-[% ELSE %]
-  PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
-[% END %]
+[% c("var/set_PTDIR_DOCSDIR") -%]
 mkdir -p $PTDIR
 
 tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
diff --git a/projects/snowflake/build b/projects/snowflake/build
index 9d9c1fb..f3616f4 100644
--- a/projects/snowflake/build
+++ b/projects/snowflake/build
@@ -7,20 +7,16 @@
   export PATH="/var/tmp/dist/binutils/bin:$PATH"
 [% END -%]
 distdir=/var/tmp/dist/[% project %]
+[% c("var/set_PTDIR_DOCSDIR") -%]
+mkdir -p $PTDIR $DOCSDIR
 [% IF c("var/osx") %]
-  PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
-  DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/snowflake"
   export CGO_ENABLED=1
   export CGO_CFLAGS="[% c("var/FLAGS") %] -mmacosx-version-min=10.7"
   export CGO_CXXFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7"
   export CGO_LDFLAGS="[% c("var/FLAGS") %] -stdlib=libc++ -mmacosx-version-min=10.7"
   export CC="$clangdir/bin/clang"
   export CXX="$clangdir/bin/clang++"
-[% ELSE %]
-  PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
-  DOCSDIR="$distdir/TorBrowser/Docs/snowflake"
 [% END %]
-mkdir -p $PTDIR $DOCSDIR
 
 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') %]
diff --git a/rbm.conf b/rbm.conf
index 49899ca..ce444d4 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -82,6 +82,11 @@ var:
     export HOME=$rootdir
     umask 0022
 
+  DOCSDIR_project: '[% project %]'
+  set_PTDIR_DOCSDIR: |
+    PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
+    DOCSDIR="$distdir/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
+
 targets:
   notarget: linux-x86_64
   noint:
@@ -202,6 +207,9 @@ targets:
         - zip
         - unzip
       faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
+      set_PTDIR_DOCSDIR: |
+        PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
+        DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
 
   # The no_build_id target can be useful if you want to quickly display
   # a build template or other option but don't want to spend time to



More information about the tbb-commits mailing list