[tbb-commits] [builders/tor-browser-build] branch main updated: Bug 40397: Create a new build target to package tor daemon, pluggable transports and dependencies
gitolite role
git at cupani.torproject.org
Fri Oct 7 01:06:58 UTC 2022
This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch main
in repository builders/tor-browser-build.
The following commit(s) were added to refs/heads/main by this push:
new f3a7060 Bug 40397: Create a new build target to package tor daemon, pluggable transports and dependencies
f3a7060 is described below
commit f3a706078bb9efb061c18f1f8d77c072ee2edcf7
Author: Marco Simonelli <msimonelli at protonmail.com>
AuthorDate: Mon Jul 11 22:26:28 2022 +1000
Bug 40397: Create a new build target to package tor daemon, pluggable transports and dependencies
---
projects/browser/build | 43 +++++++++--
projects/browser/build.android | 4 ++
projects/browser/config | 18 +----
projects/obfs4/build | 5 +-
projects/release/build | 6 --
projects/release/config | 16 -----
projects/snowflake/build | 7 +-
projects/tor-android-service/build | 34 +++++++--
projects/tor-android-service/config | 19 +++--
projects/tor-expert-bundle/build | 30 ++++++++
projects/tor-expert-bundle/config | 18 +++++
projects/tor-onion-proxy-library/build | 28 ++++----
projects/tor-onion-proxy-library/config | 32 +++------
projects/tor/build | 123 +++++++++++++-------------------
projects/tor/config | 6 +-
rbm.conf | 6 --
16 files changed, 205 insertions(+), 190 deletions(-)
diff --git a/projects/browser/build b/projects/browser/build
index 908bc2a..6a7ef9a 100644
--- a/projects/browser/build
+++ b/projects/browser/build
@@ -34,6 +34,7 @@ touch "$GENERATEDPREFSPATH"
DOCSPATH=[% c('var/ProjectName') %]/Docs
EXTSPATH=[% c('var/ProjectName') %]/Data/Browser/profile.default/extensions
+ TORBINPATH=TorBrowser/Tor
TORCONFIGPATH=TorBrowser/Data/Tor
mkdir -p "$TBDIR/[% c('var/ProjectName') %]/Data/Browser/Caches"
@@ -48,8 +49,39 @@ MARTOOLS=$rootdir/mar-tools
mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
[% IF c("var/tor-browser") -%]
- tar -C "$TBDIR" -xf [% c('input_files_by_name/obfs4') %]
- tar -C "$TBDIR" -xf [% c('input_files_by_name/snowflake') -%]
+ tar -xvf [% c('input_files_by_name/tor-expert-bundle') %]
+
+ # geoip(6) and anything else that belongs in the data dir from the expert bundle
+ mkdir -p "$TBDIR/$TORCONFIGPATH"
+ mv data/{geoip,geoip6} "$TBDIR/$TORCONFIGPATH"
+
+ # Bridge lists will be consumed later in `bridges_conf`
+ mv tor/pluggable_transports/bridges_list.*.txt $rootdir
+
+ # Snowflake's README is the only documentation shipped in tor-expert-bundle
+ mkdir -p "$TBDIR/$DOCSPATH/snowflake"
+ find tor
+ mv tor/pluggable_transports/README.SNOWFLAKE.md "$TBDIR/$DOCSPATH/snowflake/README.md"
+
+ # Move the PTs to where TB expects them
+ mkdir -p "$TBDIR/$TORBINPATH"
+ mv tor/pluggable_transports "$TBDIR/$TORBINPATH/PluggableTransports"
+
+ # Move tor and dependencies to where TB expects them
+ mv tor/* "$TBDIR/$TORBINPATH"
+
+ # on linux, libstdc++ lives in it's own directory
+ [% IF c("var/linux") %]
+ find $TBDIR/$TORBINPATH
+ mkdir -p "$TBDIR/$TORBINPATH/libstdc++"
+ mv "$TBDIR/$TORBINPATH"/libstdc++.so.* "$TBDIR/$TORBINPATH/libstdc++"
+ [% END %]
+
+ # the expert bundle includes tor-gencert, which isn't needed for browser releases
+ [% IF c("var/windows") %]
+ rm "$TBDIR/$TORBINPATH/tor-gencert.exe"
+ [% END %]
+
[% END -%]
tar -C "$TBDIR[% IF c("var/osx") %]/Contents/Resources[% END %]" -xf [% c('input_files_by_name/fonts') %]
@@ -94,9 +126,6 @@ tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.gz
rm -rf $TMP_MANUAL_PATH
[% END -%]
-[% IF c("var/tor-browser") -%]
- tar -C "$TBDIR[% IF ! c("var/osx") %]/TorBrowser[% END %]" -xf [% c('input_files_by_name/tor') %]/tor.tar.gz
-[% END -%]
[% IF c("var/namecoin") %]
# Extract Electrum-NMC
@@ -325,8 +354,8 @@ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
cp $rootdir/[% c('input_files_by_name/firefox') %]/geckodriver-linux64.tar.xz "$OUTDIR"/
[% END -%]
[% END -%]
-[% IF c("var/linux") && c("var/tor-browser") -%]
- cp $rootdir/[% c('input_files_by_name/tor') %]/tor-debug.tar.xz "$OUTDIR"/tor-[% c("var/mar_osname") %]-debug.tar.xz
+[%IF c("var/tor-browser") -%]
+ cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %] "$OUTDIR"/
[% END -%]
[% IF c("var/build_infos_json") -%]
cp $rootdir/[% c('input_files_by_name/firefox') %]/build-infos.json "$OUTDIR"/build-infos-[% c("var/mar_osname") %].json
diff --git a/projects/browser/build.android b/projects/browser/build.android
index 589d117..a8c5a08 100644
--- a/projects/browser/build.android
+++ b/projects/browser/build.android
@@ -40,3 +40,7 @@ zipalign -vp 4 $apk $aligned_apk
apksigner sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $rootdir/android-qa.keystore --out $qa_apk --in $aligned_apk --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android
apksigner sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $rootdir/android-qa.keystore --out $test_out_apk --in $test_in_apk --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android
+
+[%IF c("var/tor-browser") -%]
+ cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %] [% dest_dir %]/[% c('filename') %]/
+[% END -%]
diff --git a/projects/browser/config b/projects/browser/config
index 86086d0..03cde94 100644
--- a/projects/browser/config
+++ b/projects/browser/config
@@ -70,9 +70,9 @@ input_files:
- project: fenix
name: fenix
enable: '[% c("var/android") %]'
- - project: tor
- name: tor
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
+ - project: tor-expert-bundle
+ name: tor-expert-bundle
+ enable: '[% c("var/tor-browser") %]'
- project: firefox-langpacks
name: firefox-langpacks
enable: '[% ! c("var/testbuild") && ! c("var/android") %]'
@@ -82,12 +82,6 @@ input_files:
- project: fonts
name: fonts
enable: '[% ! c("var/android") %]'
- - project: obfs4
- name: obfs4
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
- - project: snowflake
- name: snowflake
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
- filename: Bundle-Data
enable: '[% ! c("var/android") %]'
- URL: https://addons.mozilla.org/firefox/downloads/file/4002416/noscript-11.4.11.xpi
@@ -126,12 +120,6 @@ input_files:
enable: '[% c("var/android") %]'
- filename: verify_allowed_addons.py
enable: '[% c("var/android") && c("var/verify_allowed_addons") %]'
- - filename: bridges_list.obfs4.txt
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
- - filename: bridges_list.meek-azure.txt
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
- - filename: bridges_list.snowflake.txt
- enable: '[% ! c("var/android") && c("var/tor-browser") %]'
- project: manual
name: manual
enable: '[% ! c("var/android") && c("var/tor-browser") %]'
diff --git a/projects/obfs4/build b/projects/obfs4/build
index 3aa2167..d063d4f 100644
--- a/projects/obfs4/build
+++ b/projects/obfs4/build
@@ -2,8 +2,7 @@
[% c("var/set_default_env") -%]
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
distdir=/var/tmp/dist/[% project %]
-[% c("var/set_PTDIR_DOCSDIR") -%]
-mkdir -p $PTDIR
+mkdir -p $distdir
[% IF c("var/android") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
@@ -30,7 +29,7 @@ ln -sf "$PWD" "$GOPATH/src/gitlab.com/yawning/obfs4.git"
cd obfs4proxy
go build -ldflags '-s'
-cp -a obfs4proxy[% IF c("var/windows") %].exe[% END %] $PTDIR
+cp -a obfs4proxy[% IF c("var/windows") %].exe[% END %] $distdir
cd $distdir
[% c('tar', {
diff --git a/projects/release/build b/projects/release/build
index f69f776..32fb375 100644
--- a/projects/release/build
+++ b/projects/release/build
@@ -18,15 +18,9 @@ mkdir -p "$destdir"
[% END -%]
[% IF c("var/browser-windows-i686") -%]
mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
- [% IF c("var/tor-browser") -%]
- mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
- [% END -%]
[% END -%]
[% IF c("var/browser-windows-x86_64") -%]
mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
- [% IF c("var/tor-browser") -%]
- mv [% c('input_files_by_name/windows64-expert-bundle') %]/* "$destdir"/
- [% END -%]
[% END -%]
[% IF c("var/browser-osx-x86_64") -%]
mv [% c('input_files_by_name/osx-x86_64') %]/* "$destdir"/
diff --git a/projects/release/config b/projects/release/config
index 4d0948c..8a9803f 100644
--- a/projects/release/config
+++ b/projects/release/config
@@ -202,22 +202,6 @@ input_files:
- '[% c("var/build_target") %]'
- '[% c("var/browser_type") %]-osx-aarch64'
- - name: windows-expert-bundle
- project: tor
- enable: '[% c("var/browser-windows-i686") %]'
- target:
- - '[% c("var/build_target") %]'
- - '[% c("var/browser_type") %]-windows-i686'
- - expert-bundle
-
- - name: windows64-expert-bundle
- project: tor
- enable: '[% c("var/browser-windows-x86_64") && c("var/tor-browser") %]'
- target:
- - '[% c("var/build_target") %]'
- - '[% c("var/browser_type") %]-windows-x86_64'
- - expert-bundle
-
- name: src-firefox
project: firefox
enable: '[% c("var/browser-src") %]'
diff --git a/projects/snowflake/build b/projects/snowflake/build
index 6907a06..55fb4be 100644
--- a/projects/snowflake/build
+++ b/projects/snowflake/build
@@ -2,8 +2,7 @@
[% c("var/set_default_env") -%]
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
distdir=/var/tmp/dist/[% project %]
-[% c("var/set_PTDIR_DOCSDIR") -%]
-mkdir -p $PTDIR $DOCSDIR
+mkdir -p $distdir
[% IF c("var/android") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
@@ -32,10 +31,10 @@ ln -sf "$GOPATH/src/github.com/xtaci/kcp-go" "$GOPATH/src/github.com/xtaci/kcp-g
cd client
go build -ldflags '-s'
-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 %] $distdir/snowflake-client[% IF c("var/windows") %].exe[% END %]
cd ..
-cp -a README.md $DOCSDIR
+cp -a README.md $distdir/README.SNOWFLAKE.md
cd $distdir
[% c('tar', {
diff --git a/projects/tor-android-service/build b/projects/tor-android-service/build
index 4ac5989..4bdab9c 100644
--- a/projects/tor-android-service/build
+++ b/projects/tor-android-service/build
@@ -18,17 +18,41 @@ cd /var/tmp/build/[% project %]-[% c('version') %]
# Replace pre-packaged tor library with the latest build
rm -fR service/src/main/jniLibs/*
[% FOREACH arch = ['armv7', 'aarch64', 'x86', 'x86_64'] -%]
- tar -C service/src/main -xf $rootdir/[% c('input_files_by_name/tor-' _ arch) %]/tor.tar.gz
+ # Extract tor-expert-bundle
+ tebdir=$rootdir/tor-expert-bundle-[% arch %]
+ mkdir $tebdir
+ tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]
+
+ # Figure out our android abi from our arch
+ [% IF arch == "armv7" -%]
+ abi=armeabi-v7a
+ [% ELSIF arch == "aarch64" -%]
+ abi=arm64-v8a
+ [% ELSE -%]
+ abi=[% arch %]
+ [% END -%]
+
+ # Deploy the tor bin
+ mkdir -p service/src/main/jniLibs/$abi
+ cp $tebdir/tor/libTor.so service/src/main/jniLibs/$abi/libTor.so
+
+ # Copy over data (all archs have thesame data, so we only need to do this once)
+ [% IF arch == "armv7" -%]
+ # Copy over geoip(6)
+ mkdir -p service/src/main/assets/common
+ mv $tebdir/data/{geoip,geoip6} service/src/main/assets/common
+
+ # Update bridges list
+ ptdir=$tebdir/tor/pluggable_transports
+ cat $ptdir/bridges_list.obfs4.txt $ptdir/bridges_list.meek-azure.txt \
+ $ptdir/bridges_list.snowflake.txt > service/src/main/assets/common/bridges.txt
+ [% END -%]
[% END -%]
# Replace libraries with the config dependencies
rm service/libs/*
cp $rootdir/[% c('input_files_by_name/topl') %]/*{.aar,.jar} service/libs/
-# Update bridges list
-cat $rootdir/bridges_list.obfs4.txt $rootdir/bridges_list.meek-azure.txt \
- $rootdir/bridges_list.snowflake.txt > service/src/main/assets/common/bridges.txt
-
# Build Android Libraries and Apps
gradle --offline --no-daemon -P androidplugin=3.6.0 -P appcompatVersion=28.0.0 -P compileVersion=29 -P targetVersion=29 -P minVersion=16 -Dmaven.repo.local=$gradle_repo assembleRelease -x lint
diff --git a/projects/tor-android-service/config b/projects/tor-android-service/config
index 5197f22..65fea8d 100644
--- a/projects/tor-android-service/config
+++ b/projects/tor-android-service/config
@@ -26,25 +26,22 @@ input_files:
exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
- project: tor-onion-proxy-library
name: topl
- - project: tor
- name: tor-armv7
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-armv7
target_prepend:
- android-armv7
- - project: tor
- name: tor-aarch64
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-aarch64
target_prepend:
- android-aarch64
- - project: tor
- name: tor-x86
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-x86
target_prepend:
- android-x86
- - project: tor
- name: tor-x86_64
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-x86_64
target_prepend:
- android-x86_64
- URL: 'https://dl.google.com/dl/android/studio/jetifier-zips/1.0.0-beta10/jetifier-standalone.zip'
name: jetifier
sha256sum: 38186db9c9d1b745890b3d35c0667da1cac146ceb3c26aae5bf0802119472c1b
- - filename: bridges_list.obfs4.txt
- - filename: bridges_list.meek-azure.txt
- - filename: bridges_list.snowflake.txt
diff --git a/projects/tor-expert-bundle/build b/projects/tor-expert-bundle/build
new file mode 100644
index 0000000..0a8957c
--- /dev/null
+++ b/projects/tor-expert-bundle/build
@@ -0,0 +1,30 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+distdir=/var/tmp/dist/[% project %]
+mkdir -p $distdir
+cd $distdir
+
+tar -xkf $rootdir/[% c('input_files_by_name/tor') %]
+
+cd tor
+mkdir pluggable_transports && cd pluggable_transports
+
+tar -xkf $rootdir/[% c('input_files_by_name/obfs4') %]
+tar -xkf $rootdir/[% c('input_files_by_name/snowflake') %]
+
+# copy in bridge lines for each pluggable transport
+mv $rootdir/bridges_list.obfs4.txt .
+mv $rootdir/bridges_list.meek-azure.txt .
+mv $rootdir/bridges_list.snowflake.txt .
+
+cd $distdir
+[%
+ SET tar_src = [ "tor", "data" ];
+ IF c("var/linux");
+ tar_src.push("debug");
+ END;
+ c('tar', {
+ tar_src => tar_src,
+ tar_args => '-czvf' _ dest_dir _ '/' _ c('filename'),
+ });
+%]
diff --git a/projects/tor-expert-bundle/config b/projects/tor-expert-bundle/config
new file mode 100644
index 0000000..894539e
--- /dev/null
+++ b/projects/tor-expert-bundle/config
@@ -0,0 +1,18 @@
+# vim: filetype=yaml sw=2
+filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
+version: '[% c("var/torbrowser_version") %]'
+
+container:
+ use_container: 1
+
+input_files:
+ - project: container-image
+ - name: tor
+ project: tor
+ - name: obfs4
+ project: obfs4
+ - name: snowflake
+ project: snowflake
+ - filename: bridges_list.obfs4.txt
+ - filename: bridges_list.meek-azure.txt
+ - filename: bridges_list.snowflake.txt
diff --git a/projects/tor-onion-proxy-library/build b/projects/tor-onion-proxy-library/build
index 452d7e4..5916fd5 100644
--- a/projects/tor-onion-proxy-library/build
+++ b/projects/tor-onion-proxy-library/build
@@ -24,27 +24,25 @@ patch -p1 < $rootdir/0001-Bug-33931-Filter-bridges-in-stream-by-type.patch
patch -p1 < $rootdir/0001-Bug-30318-Add-snowflake-support.patch
[% FOREACH arch = ['armv7', 'aarch64', 'x86', 'x86_64'] -%]
- # Extract obfs4proxy from TorBrowser/Tor/PluggableTransports/obfs4proxy
- tar --strip-components=4 -xf $rootdir/[% c('input_files_by_name/obfs4-' _ arch) %]
+ # Extract tor-expert-bundle
+ tebdir=$rootdir/tor-expert-bundle-[% arch %]
+ mkdir $tebdir
+ tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]
+ ptdir=$tebdir/tor/pluggable_transports
- # Extract snowflake from TorBrowser/Tor/PluggableTransports/snowflake
- tar --strip-components=4 -xf $rootdir/[% c('input_files_by_name/snowflake-' _ arch) %]
# Overwrite the obfs4proxy binary provided by Pluto and add Snowflake
[% IF arch == "armv7" -%]
- cp obfs4proxy external/pluto/bin/armeabi-v7a/
- cp obfs4proxy external/pluto/bin/armeabi/
- cp snowflake-client external/pluto/bin/armeabi-v7a/
- cp snowflake-client external/pluto/bin/armeabi/
+ cp $ptdir/obfs4proxy external/pluto/bin/armeabi-v7a/
+ cp $ptdir/obfs4proxy external/pluto/bin/armeabi/
+ cp $ptdir/snowflake-client external/pluto/bin/armeabi-v7a/
+ cp $ptdir/snowflake-client external/pluto/bin/armeabi/
[% ELSIF arch == "aarch64" -%]
- cp obfs4proxy external/pluto/bin/arm64-v8a/
- cp snowflake-client external/pluto/bin/arm64-v8a/
+ cp $ptdir/obfs4proxy external/pluto/bin/arm64-v8a/
+ cp $ptdir/snowflake-client external/pluto/bin/arm64-v8a/
[% ELSE -%]
- cp obfs4proxy external/pluto/bin/[% arch %]/
- cp snowflake-client external/pluto/bin/[% arch %]/
+ cp $ptdir/obfs4proxy external/pluto/bin/[% arch %]/
+ cp $ptdir/snowflake-client external/pluto/bin/[% arch %]/
[% END -%]
-
- rm obfs4proxy
- rm snowflake-client
[% END -%]
# Build Android Libraries and Apps
diff --git a/projects/tor-onion-proxy-library/config b/projects/tor-onion-proxy-library/config
index f9be0fd..6b76b41 100644
--- a/projects/tor-onion-proxy-library/config
+++ b/projects/tor-onion-proxy-library/config
@@ -22,36 +22,20 @@ input_files:
project: '[% c("var/compiler") %]'
- project: gradle
name: gradle
- - project: obfs4
- name: obfs4-armv7
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-armv7
target_prepend:
- android-armv7
- - project: obfs4
- name: obfs4-aarch64
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-aarch64
target_prepend:
- android-aarch64
- - project: obfs4
- name: obfs4-x86
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-x86
target_prepend:
- android-x86
- - project: obfs4
- name: obfs4-x86_64
- target_prepend:
- - android-x86_64
- - project: snowflake
- name: snowflake-armv7
- target_prepend:
- - android-armv7
- - project: snowflake
- name: snowflake-aarch64
- target_prepend:
- - android-aarch64
- - project: snowflake
- name: snowflake-x86
- target_prepend:
- - android-x86
- - project: snowflake
- name: snowflake-x86_64
+ - project: tor-expert-bundle
+ name: tor-expert-bundle-x86_64
target_prepend:
- android-x86_64
- filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
diff --git a/projects/tor/build b/projects/tor/build
index 5c23e9b..8c11802 100644
--- a/projects/tor/build
+++ b/projects/tor/build
@@ -2,31 +2,21 @@
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
distdir=/var/tmp/dist/[% project %]
+mkdir -p $distdir
mkdir -p /var/tmp/build
[% IF c("var/android") %]
- TORCONFIGDIR="$distdir/assets/common"
- libsdir=$distdir/jniLibs/[% c("var/abi") %]
- mkdir -p $libsdir $TORCONFIGDIR "$distdir/Tor"
# We need to make sure our ZSTD dependencey is properly picked up.
# --enable-zstd is not enough.
export ZSTD_CFLAGS=-I/var/tmp/dist/zstd/include
export ZSTD_LIBS=/var/tmp/dist/zstd/lib/libzstd.a
[% END %]
-[% IF c("var/linux") || c("var/windows") %]
- TORCONFIGDIR="$distdir/Data/Tor"
- mkdir -p $TORCONFIGDIR
- mkdir -p "$distdir/Tor"
-[% END %]
+TORDATADIR="$distdir/data"
+TORBINDIR="$distdir/tor"
-[% IF c("var/osx") %]
- TORBINDIR="$distdir/Contents/MacOS/Tor"
- TORCONFIGDIR="$distdir/Contents/Resources/TorBrowser/Tor"
- mkdir -p $distdir/bin
- mkdir -p $TORBINDIR
- mkdir -p $TORCONFIGDIR
-[% END %]
+mkdir $TORDATADIR
+mkdir $TORBINDIR
[% IF c("var/windows") || c("var/android") %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/zlib') %]
@@ -42,32 +32,30 @@ libeventdir=/var/tmp/dist/libevent
openssldir=/var/tmp/dist/openssl/openssl
[% IF c("var/linux") %]
- mkdir -p "$distdir/Debug/Tor"
- cp $openssldir/lib/libssl.so.1.1 "$distdir/Tor/"
- cp $openssldir/lib/libcrypto.so.1.1 "$distdir/Tor/"
- cp $libeventdir/lib/libevent-2.1.so.7 "$distdir/Tor/"
+ TORDEBUGDIR="$distdir/debug"
+ mkdir "$TORDEBUGDIR"
+
+ cp $openssldir/lib/libssl.so.1.1 "$TORBINDIR"
+ cp $openssldir/lib/libcrypto.so.1.1 "$TORBINDIR"
+ cp $libeventdir/lib/libevent-2.1.so.7 "$TORBINDIR"
# We need to copy the libstdc++.so.6 for Tor Browser on older Linux distros.
# Copying it into /Browser, which feels more natural, and amending
# LD_LIBRARY_PATH breaks updates from a Tor Browser with the old
# LD_LIBRARY_PATH value to the Tor Browser with the newer one. Thus, we copy
# the libstdc++ into the directory with the libs tor depends on, too. See bug
# 13359 for further details.
- libstdc_dir="$distdir/Tor/libstdc++"
- mkdir -p $libstdc_dir
- cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libstdc++.so.6 $libstdc_dir/
+ cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libstdc++.so.6 "$TORBINDIR"
[% IF c("var/asan") -%]
- cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.6 "$distdir/Tor/"
- cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.1 "$distdir/Tor/"
+ cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.6 "$TORBINDIR"
+ cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.1 "$TORBINDIR"
[% END -%]
- chmod 700 "$distdir"/Tor/*.so*
- chmod 700 $libstdc_dir/libstdc++.so.6
- strip $libstdc_dir/libstdc++.so.6
+ chmod 700 "$TORBINDIR"/*.so*
# This is needed to make RPATH unavailable. See bug 9150.
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$distdir/Tor/"
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TORBINDIR"
[% END %]
[% IF c("var/osx") %]
- cp $libeventdir/lib/libevent-*.dylib $TORBINDIR/
+ cp $libeventdir/lib/libevent-*.dylib "$TORBINDIR"
[% END %]
[% IF c("var/windows") %]
@@ -94,69 +82,58 @@ make install
[% IF c("var/osx") -%]
unset LD_PRELOAD
[% END -%]
-cp $distdir/share/tor/geoip $TORCONFIGDIR
-cp $distdir/share/tor/geoip6 $TORCONFIGDIR
+
+cp $distdir/share/tor/geoip "$TORDATADIR"
+cp $distdir/share/tor/geoip6 "$TORDATADIR"
[% IF c("var/osx") %]
LIBEVENT_FILE=`basename $libeventdir/lib/libevent-*.dylib`
cd $distdir
- cp bin/tor $TORBINDIR/
- cd $TORBINDIR/
- [% c("var/build_target") %]-install_name_tool -change $libeventdir/lib/$LIBEVENT_FILE @executable_path/$LIBEVENT_FILE tor
+ cp bin/tor "$TORBINDIR"
+ cd "$TORBINDIR"
+ [% c("var/build_target") %]-install_name_tool -change "$libeventdir/lib/$LIBEVENT_FILE" "@executable_path/$LIBEVENT_FILE" tor
[% END %]
cd $distdir
[% IF c("var/windows") %]
- install -s $distdir/bin/tor.exe $distdir/Tor/
-[% IF c("var/expert_bundle") %]
- install -s $distdir/bin/tor-gencert.exe $distdir/Tor/
-[% END %]
+ install -s $distdir/bin/tor.exe "$TORBINDIR"
+ install -s $distdir/bin/tor-gencert.exe "$TORBINDIR"
[% END %]
[% IF c("var/linux") %]
# Strip and generate debuginfo for libs
- objcopy --only-keep-debug $distdir/bin/tor $distdir/Debug/Tor/tor
- install -s $distdir/bin/tor $distdir/Tor/
- objcopy --add-gnu-debuglink=./Debug/Tor/tor $distdir/Tor/tor
- for i in $distdir/Tor/*so*
+ objcopy --only-keep-debug $distdir/bin/tor "$TORDEBUGDIR/tor"
+ install -s $distdir/bin/tor "$TORBINDIR"
+ objcopy --add-gnu-debuglink="$TORDEBUGDIR/tor" "$TORBINDIR/tor"
+ for i in "$TORBINDIR"/*so*
do
LIB=`basename $i`
- objcopy --only-keep-debug $distdir/Tor/$LIB $distdir/Debug/Tor/$LIB
- strip $distdir/Tor/$LIB
- objcopy --add-gnu-debuglink=./Debug/Tor/$LIB $distdir/Tor/$LIB
+
+ if [ $LIB == 'libstdc++.so.6' ]; then
+ # keeping this separate to maintain reproducibility; we can probably
+ # treat this the same as the rest (though it seems libstdc++ doesn't come with
+ # any useful debug symbols since we don't build it, so maybe we should figure
+ # out how to package them
+ strip "$TORBINDIR/$LIB"
+ else
+ objcopy --only-keep-debug "$TORBINDIR/$LIB" "$TORDEBUGDIR/$LIB"
+ strip "$TORBINDIR/$LIB"
+ objcopy --add-gnu-debuglink="$TORDEBUGDIR/$LIB" "$TORBINDIR/$LIB"
+ fi
done
[% END %]
[% IF c("var/android") %]
- install -s --strip-program=[% c("var/cross_prefix") %]-strip $distdir/bin/tor $libsdir/libTor.so
+ install -s --strip-program=[% c("var/cross_prefix") %]-strip "$distdir/bin/tor" "$TORBINDIR/libTor.so"
[% END %]
-mkdir -p [% dest_dir _ '/' _ c('filename') %]
[%
- IF c("var/expert_bundle");
- SET win_arch = c('var/windows-x86_64') ? 'win64' : 'win32';
- c('zip', {
- zip_src => [ 'Data', 'Tor', ],
- zip_args => dest_dir _ '/' _ c('filename') _ '/tor-' _ win_arch _ '-' _ c("version") _ '.zip',
- });
- ELSE;
- IF c("var/osx");
- SET tarsrcdir = [ 'Contents' ];
- ELSIF c("var/android");
- SET tarsrcdir = [ 'assets', 'jniLibs' ];
- ELSE;
- SET tarsrcdir = [ 'Data', 'Tor', ];
- END;
- c('tar', {
- tar_src => tarsrcdir,
- tar_args => '-czf ' _ dest_dir _ '/' _ c('filename') _ '/tor.tar.gz',
- });
- END;
+ SET tar_src = [ "tor", "data" ];
+ IF c("var/linux");
+ tar_src.push("debug");
+ END;
+ c('tar', {
+ tar_src => tar_src,
+ tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+ });
%]
-
-[% IF c("var/linux") %]
-[% c('tar', {
- tar_src => [ 'Debug' ],
- tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/tor-debug.tar.xz',
- }) %]
-[% END %]
diff --git a/projects/tor/config b/projects/tor/config
index 1145d57..00d9832 100644
--- a/projects/tor/config
+++ b/projects/tor/config
@@ -1,5 +1,5 @@
# vim: filetype=yaml sw=2
-filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]'
+filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
version: 0.4.7.10
git_hash: 'tor-[% c("version") %]'
git_url: https://gitlab.torproject.org/tpo/core/tor.git
@@ -41,10 +41,6 @@ targets:
var:
arch_deps:
- faketime
- expert-bundle:
- var:
- expert_bundle: 1
- flag_mwindows: ''
android:
var:
configure_opt_project: '--enable-android --enable-static-openssl --enable-static-libevent --enable-zstd --disable-tool-name-check --disable-system-torrc --disable-system-torrc'
diff --git a/rbm.conf b/rbm.conf
index 4ff3e92..97baa32 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -186,9 +186,6 @@ var:
[% END -%]
DOCSDIR_project: '[% project %]'
- set_PTDIR_DOCSDIR: |
- PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
- DOCSDIR="$distdir/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
targets:
notarget: linux-x86_64
@@ -566,9 +563,6 @@ 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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the tbb-commits
mailing list