Coder Social home page Coder Social logo

threema-ch / webrtc-build-docker Goto Github PK

View Code? Open in Web Editor NEW
99.0 13.0 41.0 148 KB

Dockerfile to build the WebRTC PeerConnection for Android using the new GN based build system.

License: MIT License

Shell 85.75% Dockerfile 14.25%
webrtc android libjingle docker build-automation

webrtc-build-docker's Introduction

libwebrtc Build Script

This is a Dockerfile to build libwebrtc for Android using the new GN based build system.

NOTE: We do not provide any support related to building special versions, or related to issues with your Docker installation, or with regard to bugs in the WebRTC codebase itself. We also do not provide any support on how to integrate the resulting build into your application.

TL;DR

For an initial local build:

./cli.sh build-tools
./cli.sh fetch
./cli.sh patch
./cli.sh build-all

For subsequent builds after an update:

./cli.sh update
./cli.sh patch
./cli.sh build-all

For a (somewhat) reproducible build, created from within a temporary Docker container:

./cli.sh build-tools
./build-final.sh <revision>

Usage: cli.sh

First, build the tools image:

./cli.sh build-tools

This will download and install necessary tools to work with the libwebrtc code base.

Then, fetch the libwebrtc code into the webrtc directory. This will download ~24 GiB and may take a while.

./cli.sh fetch

Optionally switch to a specific (release) branch:

cd webrtc/src
git checkout branch-heads/<revision>
cd -

You can find the corresponding branch head revisions for libwebrtc releases at https://chromiumdash.appspot.com/branches

If it has been a while since you fetched the code, you may update the code as such:

./cli.sh update

This will work on any branch but obviously may not switch to the most recent code revision (e.g. if on a release branch). When in detached head state, this will automatically check out the HEAD of the main branch.

If you just want to sync libwebrtc source against the current commit/branch you've checked out, run:

./cli.sh sync

This is particularly useful when in detached head state.

As an optional step, apply our patches:

./cli.sh patch

To create a build for all targets, run:

./cli.sh build-all

This will take probably around half an hour on a modern computer. Once the script finished, you'll get the following output in the out/ directory:

  • libwebrtc.jar
  • arm/libjingle_peerconnection_so.so
  • x86/libjingle_peerconnection_so.so
  • arm64/libjingle_peerconnection_so.so
  • x64/libjingle_peerconnection_so.so
  • revision.txt
  • patches.txt (may not exist if no patch has been applied)
  • build_args.txt

It is also possible to just jump into the build image shell which allows to customise the build steps entirely:

./cli.sh run

If you haven't updated for a longer period, it might happen that the build tools need updating or that the code needs to be fetched again. To clean and start from scratch, run:

./cli.sh clean

Usage: build-final.sh

To generate a (somewhat) reproducible build, without any caching and with the whole process being done from within a temporary, deterministic Docker container:

./cli.sh build-tools
./build-final.sh <revision>

This guarantees the absence of a cache (because it always fetches fresh code), consistent permissions and filesystem paths (so that your username and workdir isn't included in the binary's debug info) and will ensure that you don't forget to apply patches (because it always applies all patches at patches/*.patch).

Patches

Patches should be created using git diff inside the webrtc/src directory and stored in the /patches directory to be applied automatically when running ./cli.sh patch.

$ git diff > ../../patches/my-changes.patch

License

The MIT License (MIT)
Copyright (c) 2016-2022 Threema GmbH

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.