chromium arm build

Started by cl-inc, January 26, 2015, 08:34:55 PM

Previous topic - Next topic

cl-inc

Hello

I have managed to build chromium for arm and successfully tested it on an A20 lime.

All instructions are simply copied from: http://unix.stackexchange.com/questions/176794/how-do-i-cross-compile-chromium-for-arm

There are still a few "problems" and any help would be appreciated.


  • I don't know how to package it.  Copying the whole directory and then calling
LD_LIBRARY_PATH=lib chrome-wrapper --no-sandbox
You can easily reproduce this using docker.

Here is the Dockerfile I have used:

Create a directory (docker) and put this code into a file called Dockerfile.

FROM ubuntu:utopic

RUN apt-get update && \
    apt-get -y install build-essential \
                       git \
                       python \
                       gcc-arm-linux-gnueabihf \
                       g++-4.8-multilib-arm-linux-gnueabihf

RUN apt-get -y install wget

RUN apt-get install -y python-software-properties \
                       software-properties-common
RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) multiverse"
RUN apt-get update && \
    apt-get -y install ttf-mscorefonts-installer

RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections

RUN apt-get install -y gcc-4.9-multilib g++-4.9-multilib

Call docker build --rm=true .

This will build a docker image on your local machine and output the ID.  Write down (copy paste) this ID.


Create a directory called chromium_build and put the following code into a file called chromium_build.sh inside this directory.


#!/bin/sh

ROOT_DIR=/root
CHROM_DIR="$ROOT_DIR/chromium"

cd "$ROOT_DIR"
mkdir -pv "$CHROM_DIR"
cd "$CHROM_DIR"

git config --global user.name "Christian Loitsch" &&
git config --global user.email "christian.loitsch@inetcompany.com" &&
git config --global core.autocrlf false &&
git config --global core.filemode false &&
git config --global color.ui true &&
[ -d depot_tools ] || git clone https://chromium.googlesource.com/chromium/tools/depot_tools &&
PATH="$PATH:$CHROM_DIR/depot_tools" &&

BUILD_DIR="$CHROM_DIR/buildhost" &&
[ -d "$BUILD_DIR" ] || mkdir -v "$BUILD_DIR" &&
cd "$BUILD_DIR" &&

[ -d src ] || yes | fetch --nohooks chromium &&
cd src &&
rm -r out &&
./build/install-build-deps.sh --no-prompt &&

yes | ./build/install-build-deps.sh --arm &&
gclient sync &&
GYP_CROSSCOMPILE=1 GYP_DEFINES="target_arch=arm arm_float_abi=hard component=shared_library linux_use_gold_flags=1" gclient runhooks &&
ninja -C out/Release chrome



(Optionally also create an apt-cache directory).

Then start the build with this command:
docker run --detach=false -v /mnt/cl/chromium_build:/root/chromium 017c48783cc4 /root/chromium/chromium_build.sh

replace 017... with your ID and obviously /mnt/cl/chromium_build with your path.

When the compilation has finished you will find chrome in:
/mnt/cl/chromium_build/buildhost/src/out/Release

Copy this directory to your A20 board (again: there are 2 huge directories inside this directory which you don't need to copy.  One is called gen, I've forgotten the name of the other).

If you think you will build this multiple times you can easily at least keep the dep files cached by running:
docker run --detach=false -v /mnt/cl/chromium_build:/root/chromium -v /mnt/cl/apt-cache:/var/cache/apt/archives 017c48783cc4 /root/chromium/chromium_build.sh


Really hope this helps.  And again any advice on how to package this (maybe with https://github.com/jordansissel/fpm) or improve hardware rendering would be appreciated.