├── sync-chromium.sh ├── fetch-webrtc.sh ├── gclient.webrtc ├── README.md ├── LICENSE ├── .circleci └── config.yml └── Dockerfile /sync-chromium.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sync-chromium.sh 4 | # 5 | # Setup Chromium folder at /chromium/src 6 | # 7 | # Created by David Chen 8 | # All rights reserved. 2016. 9 | 10 | # Create Chromium folder 11 | mkdir -p /home/root/chromium 12 | 13 | # copy gclient file 14 | cp ./gclient.webrtc /home/root/chromium/.gclient 15 | 16 | # Sync Chromium 17 | pushd /home/root/chromium 18 | gclient sync 19 | -------------------------------------------------------------------------------- /fetch-webrtc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # fetch-webrtc.sh 4 | # 5 | # Fetch WebRTC 6 | # 7 | # Created by David Chen 8 | # All rights reserved. 2016. 9 | 10 | echo "NOTICE: Due to bug 5578 you may have to press ‘y’ to accept a license dialog for downloading Google Play Services SDK." 11 | echo "The dowload will take a long time because it downloads the whole Chromium repository and dependencies, which are several gigabytes." 12 | echo "Do not interrupt this step or you may need to start all over agan (a new gclient sync may be enough, but you might also need to start over cleanly)." 13 | 14 | # Create WebRTC folder 15 | mkdir -p /home/root/webrtc 16 | 17 | pushd /home/root/webrtc 18 | 19 | # Fetch the webrtc source 20 | fetch --nohooks webrtc 21 | 22 | # run gclient sync 23 | gclient sync 24 | -------------------------------------------------------------------------------- /gclient.webrtc: -------------------------------------------------------------------------------- 1 | solutions = [{ 2 | 'name': 'src', 3 | 'url': 'https://chromium.googlesource.com/chromium/src.git', 4 | 'deps_file': '.DEPS.git', 5 | 'managed': False, 6 | 'custom_deps': { 7 | # Skip syncing some large dependencies WebRTC will never need. 8 | 'src/chrome/tools/test/reference_build/chrome_linux': None, 9 | 'src/chrome/tools/test/reference_build/chrome_mac': None, 10 | 'src/chrome/tools/test/reference_build/chrome_win': None, 11 | 'src/native_client': None, 12 | 'src/third_party/cld_2/src': None, 13 | 'src/third_party/hunspell_dictionaries': None, 14 | 'src/third_party/liblouis/src': None, 15 | 'src/third_party/pdfium': None, 16 | 'src/third_party/skia': None, 17 | 'src/third_party/trace-viewer': None, 18 | 'src/third_party/webrtc': None, 19 | }, 20 | 'safesync_url': '' 21 | }] 22 | cache_dir = None 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # webrtc-dev-env 2 | Dockerfile for WebRTC development environment. 3 | 4 | From Ubuntu 16.04 LTS. 5 | 6 | Installs the following additional packages and libraries. 7 | 8 | * OpenJDK & OpenJRE 8 9 | * Chromium dev packages 10 | * Chromium required runtime libs 11 | * Packages for NaCl (Native Client) builds and toolchains 12 | * ARM cross toolchain packages 13 | * MESA dev packages 14 | * Debugging symbols for runtime libs 15 | 16 | A script for fetching the WebRTC repo will be at 17 | ``` $HOME/scripts/fetch-webrtc.sh ``` 18 | 19 | An additional script for synching Chromium repo will be setup at 20 | ``` $HOME/scripts/sync-chromium.sh ``` 21 | 22 | A script for building WebRTC Unity plugin example 23 | ``` ./scripts/build-webrtc-unity.sh ``` 24 | 25 | Please note that initial gclient sync of Chromium repo may take >30 minutes depending on network connection. 26 | 27 | Due to the issue with docker [#16429](https://github.com/docker/docker/issues/16429), if need to mount any folders, probably need to run with command 28 | ```docker run --cap-add=SYS_ADMIN --security-opt apparmor:unconfined``` 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 David C 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: mhamanaka/webrtc-dev-env-java8:latest 6 | steps: 7 | - run: 8 | name: Avoid ssh hosts unknown for github.com 9 | command: | 10 | mkdir -p /root/.ssh/ 11 | echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config 12 | chmod 600 /root/.ssh/config 13 | - checkout 14 | - run: | 15 | df -BM 16 | echo "PATH: ${PATH}" 17 | 18 | - run: 19 | name: Build Webrtc Unity Plugin 20 | command: | 21 | bash ./build-webrtc-unity.sh 22 | 23 | - run: | 24 | mkdir artifacts 25 | cp webrtc/libjingle_peerconnection_so.so artifacts/. 26 | cp webrtc/libwebrtc_unity.jar artifacts/. 27 | 28 | - store_artifacts: 29 | path: artifacts 30 | 31 | - run: 32 | name: release to github 33 | command: | 34 | zip libwebrtc_unity.zip artifacts/* 35 | apt-get install -y golang-1.9 36 | export PATH=/usr/lib/go-1.9/bin:${PATH} 37 | mkdir go-ws 38 | export GOPATH=`pwd`/go-ws 39 | go get github.com/aktau/github-release 40 | export RELEASE=go-ws/bin/github-release 41 | export TAG=${CIRCLE_BRANCH}_`date --utc '+%Y%m%d_%H%M%S'` 42 | ${RELEASE} -v -q release -u mhama -r webrtc-dev-env --tag ${TAG} --pre-release 43 | ${RELEASE} -v upload -u mhama -r webrtc-dev-env --tag ${TAG} --name libwebrtc_unity.zip --file ./libwebrtc_unity.zip -R 44 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Ubuntu 16.04 LTS with WebRTC development environment. 2 | # version 0.0.1 3 | 4 | # Ubuntu 16.04 LTS. 5 | FROM ubuntu:xenial 6 | 7 | MAINTAINER David Chen 8 | 9 | # Never ask for confirmations 10 | ENV DEBIAN_FRONTEND noninteractive 11 | RUN echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections 12 | RUN echo "debconf shared/accepted-oracle-license-v1-1 seen true" | debconf-set-selections 13 | 14 | RUN apt-get update && \ 15 | apt-get -y install software-properties-common python-software-properties \ 16 | bzip2 unzip git build-essential pkg-config aptitude dpkg 17 | 18 | # Install openjdk and openjre 8 stuff 19 | RUN apt-get update && apt-get -y install openjdk-8-jre openjdk-8-jdk openjdk-8-jre-headless 20 | 21 | #RUN echo "deb http://archive.ubuntu.com/ubuntu/ xenial multiverse" >> /etc/apt/sources.list 22 | RUN echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial multiverse" >> /etc/apt/sources.list 23 | #RUN echo "deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse" >> /etc/apt/sources.list 24 | RUN echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse" >> /etc/apt/sources.list 25 | 26 | RUN dpkg --add-architecture i386 && apt-get update 27 | 28 | RUN aptitude install -y g++-arm-linux-gnueabihf 29 | 30 | # Install Chromium dev packages. 31 | RUN apt-get update && apt-get install -y apache2-bin bison cdbs curl \ 32 | dpkg-dev elfutils devscripts fakeroot \ 33 | flex fonts-thai-tlwg g++ git-core git-svn gperf language-pack-da \ 34 | language-pack-fr language-pack-he language-pack-zh-hant \ 35 | libapache2-mod-php libasound2-dev libbrlapi-dev libav-tools \ 36 | libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev \ 37 | libdrm-dev libelf-dev libexif-dev libffi-dev libgconf2-dev \ 38 | libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev \ 39 | libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev \ 40 | libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev \ 41 | libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev \ 42 | openbox patch perl php-cgi pkg-config python python-cherrypy3 \ 43 | python-crypto python-dev python-numpy python-opencv python-openssl \ 44 | python-psutil python-yaml rpm ruby subversion \ 45 | fonts-ipafont wdiff \ 46 | zip libbluetooth-dev libxkbcommon-dev realpath ttf-mscorefonts-installer \ 47 | libjpeg-dev libbrlapi0.6 48 | 49 | # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built 50 | # NaCl binaries. 51 | RUN apt-get install -y libc6-i386 lib32gcc1 lib32stdc++6 \ 52 | # Chromium runtime libs 53 | libatk1.0-0 libc6 libasound2 libcairo2 libcap2 libcups2 libexpat1 \ 54 | libexif12 libffi6 libfontconfig1 libfreetype6 libglib2.0-0 \ 55 | libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 \ 56 | libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 \ 57 | libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 \ 58 | libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 \ 59 | libxtst6 zlib1g libpulse0 libbz2-1.0 libnspr4 libnss3 libudev1 \ 60 | # Debugging symbols for runtime libs. 61 | libatk1.0-dbg libc6-dbg libcairo2-dbg libffi6-dbg libfontconfig1-dbg \ 62 | libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg \ 63 | libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg \ 64 | libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg \ 65 | libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg \ 66 | libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg libstdc++6-4.8-dbg 67 | 68 | # 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf 69 | RUN apt-get install -y linux-libc-dev:i386 \ 70 | # arm cross toolchain packages needed to build chrome on armhf 71 | libc6-dev-armhf-cross linux-libc-dev-armhf-cross g++-4.8-multilib \ 72 | g++-4.8-multilib-arm-linux-gnueabihf gcc-4.8-multilib-arm-linux-gnueabihf \ 73 | # Packages to build NaCl, its toolchains, and its ports. 74 | g++-mingw-w64-i686 lib32z1-dev \ 75 | libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386 \ 76 | libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386 \ 77 | libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev \ 78 | libnss3:i386 libpango1.0-0:i386 \ 79 | libssl1.0.0:i386 libtinfo-dev libtinfo-dev:i386 libtool \ 80 | libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386 \ 81 | libxrandr2:i386 libxss1:i386 libxtst6:i386 texinfo xvfb \ 82 | ant autoconf cmake gawk intltool xutils-dev xsltproc \ 83 | libudev1:i386 \ 84 | # Mesa development 85 | libgbm-dev libgl1-mesa-dev libgl1-mesa-glx:i386 \ 86 | mesa-common-dev libgles2-mesa-dev 87 | 88 | RUN apt-get install -y ca-certificates-java desktop-file-utils dosfstools \ 89 | fonts-dejavu-extra fuse gdisk gvfs gvfs-common gvfs-daemons gvfs-libs \ 90 | libatasmart4 libatk-wrapper-java libatk-wrapper-java-jni libavahi-glib1 \ 91 | libbonobo2-0 libbonobo2-common libcanberra0 libfuse2 libgconf2-4 libgnome2-0 \ 92 | libgnome2-bin libgnome2-common libgnomevfs2-0 libgnomevfs2-common \ 93 | liborbit-2-0 liborbit2 libpcsclite1 \ 94 | libsecret-1-0 libsecret-common libtdb1 libudisks2-0 libvorbisfile3 ntfs-3g \ 95 | parted policykit-1-gnome sound-theme-freedesktop udisks2 96 | 97 | # a bit of utilities 98 | RUN apt-get install -y tmux vim 99 | 100 | # Export JAVA_HOME variable 101 | ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 102 | 103 | # Add script for sync Chromium repo 104 | ADD gclient.webrtc /home/root/scripts/gclient.webrtc 105 | ADD sync-chromium.sh /home/root/scripts/sync-chromium.sh 106 | ADD fetch-webrtc.sh /home/root/scripts/fetch-webrtc.sh 107 | ADD build-webrtc-unity.sh /home/root/scripts/build-webrtc-unity.sh 108 | 109 | # Add user docker. Change to the user you want if needed. 110 | # RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo 111 | # USER docker 112 | 113 | ENV HOME /home/root 114 | WORKDIR /home/root 115 | 116 | # clone Chromium depot_tools 117 | RUN mkdir -p /home/root/depot_tools 118 | RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git 119 | ENV DEPOT_TOOLS /home/root/depot_tools 120 | ENV PATH $PATH:$DEPOT_TOOLS 121 | 122 | # Run bash. 123 | CMD /bin/bash 124 | --------------------------------------------------------------------------------