Skip to content

Building the code for Raspberry Pi

Heungsik Eom edited this page Jul 18, 2014 · 11 revisions

These instructions have been tested on Raspbian on a Raspberry Pi device.

These instructions are derived from these links:

Download dependencies

  1. This works on Debian-based distros

    sudo apt-get update
    sudo apt-get install pkg-config git subversion make gcc g++ python binutils-gold
    sudo apt-get install libexpat1-dev libgtk2.0-dev libnss3-dev libssl-dev
  2. Download depot_tools for chromium repo

    mkdir libjingle; cd libjingle
    git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
  3. Set up environmental variables

    export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle-armhf/
    export PATH="$(pwd)/depot_tools:$PATH"
    export GYP_GENERATORS="make"
    export GYP_DEFINES="$GYP_DEFINES target_arch=arm arm_version=6"
    export C_INCLUDE_PATH=/usr/include:/usr/include/arm-linux-gnueabihf
    export CPLUS_INCLUDE_PATH=/usr/include:/usr/include/arm-linux-gnueabihf

Download source code

  1. Configure gclient to download libjingle code

    gclient config --name=trunk http://webrtc.googlecode.com/svn/branches/3.52
  2. Download libjingle and dependencies (this takes a while)

    gclient sync --force
  3. Download ipop-tincan from github.com/ipop-project

    cd trunk/talk; mkdir ipop-project; cd ipop-project
    git clone --depth 1 https://github.com/ipop-project/ipop-tap.git
    git clone --depth 1 https://github.com/ipop-project/ipop-tincan.git

Build ipop-tincan for Raspbian

  1. Return to libjingle trunk directory

    cd ../../
  2. Copy modified gyp files to trunk/talk directory

    rm -f DEPS all.gyp talk/libjingle.gyp talk/ipop-tincan.gyp
    cp talk/ipop-project/ipop-tincan/build/ipop-tincan.gyp talk/
    cp talk/ipop-project/ipop-tincan/build/libjingle.gyp talk/
    cp talk/ipop-project/ipop-tincan/build/all.gyp .
    cp talk/ipop-project/ipop-tincan/build/DEPS .
  3. Sync again to download OpenSSL from chromium repository

    gclient sync --force
  4. Update build/common.gypi configurations

    sed -i "s/'arm_float_abi%': 'soft',/'arm_float_abi%': 'hard',/g" build/common.gypi 
    sed -i "s/'arm_fpu%': '',/'arm_fpu%': 'vfp',/g" build/common.gypi
  5. Update the gold linker to arm version

    mv third_party/gold/gold32 third_party/gold/gold32.bak
    ln -s /usr/bin/gold third_party/gold/gold32
  6. Generate ninja build files

    gclient runhooks --force
  7. Build tincan for Raspbian (binary localed at out/Release/ipop-tincan)

    make ipop-tincan BUILDTYPE=Release
  8. To build debug version with gdb symbols (but creates 25 MB binary)

    make ipop-tincan BUILDTYPE=Debug
  9. The generated binary is located at out/Release/ipop-tincan or out/Debug/ipop-tincan

Download controllers

  1. Download SocialVPN and GroupVPN controllers

    wget http://github.com/ipop-project/controllers/raw/devel/src/ipoplib.py
    wget http://github.com/ipop-project/controllers/raw/devel/src/svpn_controller.py
    wget http://github.com/ipop-project/controllers/raw/devel/src/gvpn_controller.py
    
Clone this wiki locally