signal patches and apply-patches script

This commit is contained in:
Michael Kirk 2017-07-07 08:35:38 -05:00
parent d3f143158e
commit 2da594bf5e
8 changed files with 135 additions and 25 deletions

5
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "src"]
path = src
path = webrtc/src
url = https://chromium.googlesource.com/external/webrtc.git
[submodule "libwebrtc-android"]
path = libwebrtc-android
url = https://github.com/WhisperSystems/libwebrtc-android.git

65
BUILDING.md Normal file
View File

@ -0,0 +1,65 @@
### Building WebRTC
A prebuilt version of WebRTC.framework resides in the Signal Carthage submodule
However, if you'd like to build it from source, with our modifications see below.
These instructions are derived from the WebRTC documentation:
https://webrtc.org/native-code/ios/
Initial Setup for first time building WebRTC.framework
# 1. Installation prerequisites
# depot tools
cd <somewhere>
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
export PATH=<somewhere>/depot_tools:"$PATH"
# 2. Fetch webrtc source
cd signal-webrtc-ios
mkdir webrtc
cd webrtc
fetch --nohooks webrtc_ios
The remaining steps must occur every time you're building/updating WebRTC.framework
# 3. Point to appropriate release
#
# based on:
# https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches
# Make sure you are in 'webrtc/src'.
#
# This part should only need to be done once, but it won't hurt to
# repeat it. The first time might take a while because it fetches
# an extra 1/2 GB or so of branch commits.
gclient sync --with_branch_heads
# You may have to explicitly 'git fetch origin' to pull branch-heads/
git fetch
# Checkout the branch 'src' tree.
git checkout branch-heads/$LATEST_STABLE_RELEASE_NUMBER
# Checkout all the submodules at their branch DEPS revisions.
gclient sync --jobs 16
# 4. Apply Signal Patches
# NOTE: If you've previosly applied the patches, they won't apply
# cleanly. Start from a pristine clean webrtc dir.
../../bin/apply-signal-patches
# 5. Build WebRTC.framework
tools-webrtc/ios/build_ios_libs.sh
# If you get errors about missing build tools, like 'gn', you may be
# able to install them with the following (then go back to "Build
# WebRTC.framework" step:
gclient runhooks
# 6. Move the WebRTC.framework into Signal-iOS's Carthage directory
rm -r $SIGNAL_IOS_REPO_ROOT/Carthage/Build/iOS/WebRTC.framework
mv out_ios_libs/WebRTC.framework $SIGNAL_IOS_REPO_ROOT/Carthage/Build/iOS/

41
bin/apply-signal-patches Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Applies Signal specific modifications to webrtc
#
# Example Usage:
#
# bin/apply-patches
#
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PATCHES_DIR="${BIN_DIR}/../libwebrtc-android/patches"
WEBRTC_DIR="${BIN_DIR}/../webrtc"
if [ ! -d "$PATCHES_DIR" ]
then
echo " [!] patches dir does not exist: ${PATCHES_DIR}"
exit 1
fi
if [ ! -d "$WEBRTC_DIR" ]
then
echo " [!] webrtc dir does not exist: ${PATCHES_DIR}"
exit 1
fi
cd "$WEBRTC_DIR/src"
for patch_file in $(ls "$PATCHES_DIR")
do
echo "Applying patch file: ${patch_file}"
echo "..."
patch -p1 < "${PATCHES_DIR}/${patch_file}"
if [ $? -eq 0 ]
then
echo "Success!"
else
echo " [!] Failed to apply patch file: ${patch_file}"
exit 1
fi
done

1
libwebrtc-android Submodule

@ -0,0 +1 @@
Subproject commit 439568c5da38a44f9568674e9e5ba953afae6d86

1
src

@ -1 +0,0 @@
Subproject commit f07e6b4c00e0f00eb59a6a968db0d9b785dd563c

View File

@ -1,34 +1,34 @@
entries = {
'src': 'https://chromium.googlesource.com/external/webrtc.git',
'src/base': 'https://chromium.googlesource.com/chromium/src/base@e3c7a4099304428ea26e1ee2845428946fd0fc0e',
'src/build': 'https://chromium.googlesource.com/chromium/src/build@58c9238e9883dbc09f093d3dd98a2fa56319ea43',
'src/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@1dcd1bdbe93467531a50b60dbd18860803ca7be1',
'src/ios': 'https://chromium.googlesource.com/chromium/src/ios@d4493d467f45596c9c882b7e72da0a81a7ba0bba',
'src/testing': 'https://chromium.googlesource.com/chromium/src/testing@d1f2428318753c97aa3e7f5d6084a28926e5f183',
'src/third_party': 'https://chromium.googlesource.com/chromium/src/third_party@e359c7b4036ea08c5821017356358f0a9950c1e8',
'src/third_party/boringssl/src': 'https://boringssl.googlesource.com/boringssl.git@3120950b1e27635ee9b9d167052ce11ce9c96fd4',
'src/third_party/catapult': 'https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@5d065952a0d8060166cecc73093775bf518966f7',
'src/base': 'https://chromium.googlesource.com/chromium/src/base@6f94118f9a7b502db8f6b73f8ff7b9d19153cb76',
'src/build': 'https://chromium.googlesource.com/chromium/src/build@ab0b06d1c0554464933544734bf8b3d17084d263',
'src/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@d3074448541662f242bcee623049c13a231b5648',
'src/ios': 'https://chromium.googlesource.com/chromium/src/ios@c41f8dd3430baccea8ed70be7123a9206f137856',
'src/testing': 'https://chromium.googlesource.com/chromium/src/testing@424881cff41d5292e04b68249893230e65c7e9e1',
'src/testing/gmock': 'https://chromium.googlesource.com/external/googlemock.git@0421b6f358139f02e102c9c332ce19a33faf75be',
'src/testing/gtest': 'https://chromium.googlesource.com/external/github.com/google/googletest.git@6f8a66431cb592dad629028a50b3dd418a408c87',
'src/third_party': 'https://chromium.googlesource.com/chromium/src/third_party@ef69db4b743f832bd71de2ddc8d3e800e563c525',
'src/third_party/boringssl/src': 'https://boringssl.googlesource.com/boringssl.git@c8ff30cbe716c72279a6f6a9d7d7d0d4091220fa',
'src/third_party/catapult': 'https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@9a55abab029cb9ae94f5160ded11b09a4638a955',
'src/third_party/colorama/src': 'https://chromium.googlesource.com/external/colorama.git@799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',
'src/third_party/ffmpeg': 'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@ddb09a0d5aaf6aacf846355b7629953b2496b8ea',
'src/third_party/ffmpeg': 'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@9751ef06f90fb7ebf02b4e9ecc963a4e36a221d3',
'src/third_party/gflags': 'https://chromium.googlesource.com/external/webrtc/deps/third_party/gflags@892576179b45861b53e04a112996a738309cf364',
'src/third_party/gflags/src': 'https://chromium.googlesource.com/external/github.com/gflags/gflags@03bebcb065c83beff83d50ae025a55a4bf94dfca',
'src/third_party/googletest/src': 'https://chromium.googlesource.com/external/github.com/google/googletest.git@42bc671f47b122fad36db5eccbc06868afdf7862',
'src/third_party/gtest-parallel': 'https://chromium.googlesource.com/external/github.com/google/gtest-parallel@2a45a8d381bf1aa14071615bc787daa524e35236',
'src/third_party/gtest-parallel': 'https://chromium.googlesource.com/external/github.com/google/gtest-parallel@f3c90adaadecab22e7f2591746b4d88747dd9a3e',
'src/third_party/jsoncpp/source': 'https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git@f572e8e42e22cfcf5ab0aea26574f408943edfa4',
'src/third_party/libFuzzer/src': 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer.git@16f5f743c188c836d32cdaf349d5d3effb8a3518',
'src/third_party/libjpeg_turbo': 'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@a1750dbc79a8792dde3d3f7d7d8ac28ba01ac9dd',
'src/third_party/libsrtp': 'https://chromium.googlesource.com/chromium/deps/libsrtp.git@1d45b8e599dc2db6ea3ae22dbc94a8c504652423',
'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@ec4afbf74a4beebadee3e1b15b43c5d4e3d3bd1c',
'src/third_party/libyuv': 'https://chromium.googlesource.com/libyuv/libyuv.git@7bffe5e1c54bc22daebd57003735e61693719ac6',
'src/third_party/libjpeg_turbo': 'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@7260e4d8b8e1e40b17f03fafdf1cd83296900f76',
'src/third_party/libsrtp': 'https://chromium.googlesource.com/chromium/deps/libsrtp.git@ccf84786f8ef803cb9c75e919e5a3976b9f5a672',
'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@6af42f5102ad7c00d3fed389b186663a88d812ee',
'src/third_party/libyuv': 'https://chromium.googlesource.com/libyuv/libyuv.git@2adb84e39e360723d19c68f315d99e3e0f88318c',
'src/third_party/openh264/src': 'https://chromium.googlesource.com/external/github.com/cisco/openh264@0fd88df93c5dcaf858c57eb7892bd27763f0f0ac',
'src/third_party/openmax_dl': 'https://chromium.googlesource.com/external/webrtc/deps/third_party/openmax.git@7acede9c039ea5d14cf326f44aad1245b9e674a7',
'src/third_party/usrsctp/usrsctplib': 'https://chromium.googlesource.com/external/github.com/sctplab/usrsctp@2f6478eb8d40f1766a96b5b033ed26c0c2244589',
'src/third_party/usrsctp/usrsctplib': 'https://chromium.googlesource.com/external/github.com/sctplab/usrsctp@8679f2b0bf063ac894dc473debefd61dbbebf622',
'src/third_party/yasm/source/patched-yasm': 'https://chromium.googlesource.com/chromium/deps/yasm/patched-yasm.git@7da28c6c7c6a1387217352ce02b31754deb54d2a',
'src/tools': 'https://chromium.googlesource.com/chromium/src/tools@ccb73c5776bd8a36f3af203df6a4760f5b0df755',
'src/tools/gyp': 'https://chromium.googlesource.com/external/gyp.git@eb296f67da078ec01f5e3a9ea9cdc6d26d680161',
'src/tools/swarming_client': 'https://chromium.googlesource.com/external/swarming.client.git@a56c2b39ca23bdf41458421a7f825ddbf3f43f28',
'src/buildtools/clang_format/script': 'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git@0653eee0c81ea04715c635dd0885e8096ff6ba6d',
'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@3a07dd740be63878167a0ea19fe81869954badd7',
'src/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@4072e8fd76febee37f60aeda76d6d9f5e3791daa',
'src/buildtools/third_party/libunwind/trunk': 'https://chromium.googlesource.com/external/llvm.org/libunwind.git@41f982e5887185b904a456e20dfcd58e6be6cc19',
'src/tools': 'https://chromium.googlesource.com/chromium/src/tools@7b80da1ab2bf10289e1ff56d378fb9a3f310099a',
'src/tools/gyp': 'https://chromium.googlesource.com/external/gyp.git@e7079f0e0e14108ab0dba58728ff219637458563',
'src/tools/swarming_client': 'https://chromium.googlesource.com/external/swarming.client.git@11e31afa5d330756ff87aa12064bb5d032896cb5',
'src/buildtools/clang_format/script': 'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git@c09c8deeac31f05bd801995c475e7c8070f9ecda',
'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@b1ece9c037d879843b0b0f5a2802e1e9d443b75a',
'src/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@0edb61e2e581758fc4cd4cd09fc588b3fc91a653',
}

1
webrtc/src Submodule

@ -0,0 +1 @@
Subproject commit eeab9ccb2417cab18ae1681c6644c25fa4eadcd3