Skip to content

Commit

Permalink
Build libwebrtc-magic.a for linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Fifield authored and turfed committed May 9, 2016
1 parent 1778fa6 commit ad65dfc
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 0 deletions.
57 changes: 57 additions & 0 deletions gitian/descriptors/linux/gitian-pluggable-transports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ packages:
- "swig"
- "zip"
- "hardening-wrapper"
- "pkg-config"
- "gtk2.0-dev"
- "libpci-dev"
- "libdbus-1-dev"
- "libgnome-keyring-dev"
- "libnss3-dev"
- "libffi-dev"
- "libasound2-dev"
- "libpulse-dev"
- "libudev-dev"
- "libgl1-mesa-dev"
- "default-jre-headless"
- "default-jdk"
reference_datetime: "2000-01-01 00:00:00"
remotes:
- "url": "https://git.torproject.org/pluggable-transports/pyptlib.git"
Expand Down Expand Up @@ -57,6 +70,11 @@ files:
- "gmp-linux64-utils.zip"
- "openssl-linux32-utils.zip"
- "openssl-linux64-utils.zip"
- "binutils-linux32-utils.zip"
- "binutils-linux64-utils.zip"
- "gcc-linux32-utils.zip"
- "gcc-linux64-utils.zip"
- "webrtc"
script: |
INSTDIR="$HOME/install"
PTDIR="$INSTDIR/Tor/PluggableTransports"
Expand All @@ -79,6 +97,35 @@ script: |
# FTE only needs libgmp.so.10 and no libgmpxx anymore.
cp $INSTDIR/gmp/lib/libgmp.so.10 $INSTDIR/Tor
# Preparing Binutils and GCC for webrtc
unzip -d $INSTDIR binutils-linux$GBUILD_BITS-utils.zip
# Make sure gold is used with the hardening wrapper for full RELRO, see
# #13031.
cd $INSTDIR/binutils/bin
rm ld
cp /usr/bin/hardened-ld ./
mv ld.gold ld.gold.real
ln -sf hardened-ld ld.gold
ln -sf ld.gold ld
cd ~/build
unzip -d $INSTDIR gcc-linux$GBUILD_BITS-utils.zip
# Make sure we use the hardening wrapper when compiling Tor Browser.
cd $INSTDIR/gcc/bin
cp /usr/bin/hardened-cc ./
mv gcc gcc.real
mv c++ c++.real
ln -sf hardened-cc gcc
ln -sf hardened-cc c++
cd ~/build
export PATH=$INSTDIR/gcc/bin:$INSTDIR/binutils/bin:$PATH
ARCH=""
if [ $GBUILD_BITS == "64" ];
then
ARCH="64"
fi
# Make sure our GCC gets properly used.
export LD_LIBRARY_PATH=$INSTDIR/gcc/lib$ARCH
# Building go 1.4.x
# This is needed to bootstrap the go that we actually use
# https://golang.org/doc/install/source#go14
Expand Down Expand Up @@ -271,6 +318,16 @@ script: |
# Disable automatic updating.
export DEPOT_TOOLS_UPDATE=0
# Building webrtc
export GYP_CROSSCOMPILE=1
export GYP_DEFINES="OS=linux target_arch=$(if [ $GBUILD_BITS = 32 ]; then echo ia32; else echo x64; fi) use_sysroot=0 linux_use_bundled_gold=0 linux_use_gold_flags=0 linux_use_bundled_binutils=0 use_gconf=0 clang=0 host_clang=0 use_x11=0 werror="
cd webrtc/src
JAVA_HOME=/usr/lib/jvm/default-java webrtc/build/gyp_webrtc
# "ninja" is part of depot_tools.
ninja -C out/Release
ar crs libwebrtc-magic.a $(find . -name '*.o' -not -name '*.main.o')
cd ../..
# Grabbing the results and making sure timestamps don't spoil them
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
cd $INSTDIR
Expand Down
22 changes: 22 additions & 0 deletions gitian/fetch-inputs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,27 @@ git submodule init
git submodule update
cd ..

# WebRTC is special, having its own build system that brings in lots of Chromium dependencies.
# https://webrtc.org/native-code/development/
# depot_tools must have been downloaded before running this code.
dir=webrtc
PATH="$PATH:$PWD/depot_tools"
# GYP_CROSSCOMPILE=1 and GYP_DEFINES="use_x11=0" prevent probing for certain dependencies.
# Use --no-history because the whole checkout with history is about 12 GB.
export GYP_CROSSCOMPILE=1
export GYP_DEFINES="use_x11=0"
mkdir -p "$dir"
cd "$dir"
if [ ! -d "src" ];
then
# "fetch" is part of depot_tools.
fetch --nohooks --no-history webrtc
fi
# "gclient" is part of depot_tools. This download takes a long time the first time.
# JAVA_HOME is needed in a hook for libjingle. The readlink line tries to find the current JRE.
# default-java comes from the package default-jdk-headless.
JAVA_HOME=/usr/lib/jvm/default-java gclient sync --with_branch_heads --no-history -r $WEBRTC_TAG
cd ..

exit 0

1 change: 1 addition & 0 deletions gitian/verify-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ do
fi
done

# webrtc? Its fetch brings in sources from many repos.

cd "$INPUTS_DIR"
verify_git "." "$WRAPPER_DIR/gpg/torbutton.gpg" "$GITIAN_TAG"
Expand Down
1 change: 1 addition & 0 deletions gitian/versions
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GO_X_NET_TAG=7dbad50ab5b31073856416cdcfeb2796d682f844
OBFS4_TAG=obfs4proxy-0.0.5
NOTOFONTS_TAG=720e34851382ee3c1ef024d8dffb68ffbfb234c2
DEPOT_TOOLS_TAG=28216cd14b44716db5c83634afbdc6e90492652b
WEBRTC_TAG=8ccf77319e08b86330c0e5b195697fd738c80931 # https://chromium.googlesource.com/external/webrtc.git/+/refs/branch-heads/49

GITIAN_TAG=tor-browser-builder-3.x-8-gpgsux

Expand Down
1 change: 1 addition & 0 deletions gitian/versions.alpha
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ GO_X_NET_TAG=7dbad50ab5b31073856416cdcfeb2796d682f844
OBFS4_TAG=obfs4proxy-0.0.5
NOTOFONTS_TAG=720e34851382ee3c1ef024d8dffb68ffbfb234c2
DEPOT_TOOLS_TAG=28216cd14b44716db5c83634afbdc6e90492652b
WEBRTC_TAG=8ccf77319e08b86330c0e5b195697fd738c80931 # https://chromium.googlesource.com/external/webrtc.git/+/refs/branch-heads/49

GITIAN_TAG=tor-browser-builder-4-1

Expand Down
1 change: 1 addition & 0 deletions gitian/versions.beta
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GOPTLIB_TAG=0.2
MEEK_TAG=0.18
NOTOFONTS_TAG=720e34851382ee3c1ef024d8dffb68ffbfb234c2
DEPOT_TOOLS_TAG=28216cd14b44716db5c83634afbdc6e90492652b
WEBRTC_TAG=8ccf77319e08b86330c0e5b195697fd738c80931 # https://chromium.googlesource.com/external/webrtc.git/+/refs/branch-heads/49

GITIAN_TAG=tor-browser-builder-3.x-6

Expand Down
1 change: 1 addition & 0 deletions gitian/versions.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ GO_X_NET_TAG=master
OBFS4_TAG=master
NOTOFONTS_TAG=720e34851382ee3c1ef024d8dffb68ffbfb234c2
DEPOT_TOOLS_TAG=28216cd14b44716db5c83634afbdc6e90492652b
WEBRTC_TAG=8ccf77319e08b86330c0e5b195697fd738c80931 # https://chromium.googlesource.com/external/webrtc.git/+/refs/branch-heads/49

GITIAN_TAG=tor-browser-builder-4

Expand Down

0 comments on commit ad65dfc

Please sign in to comment.