gecko-dev/servo/ports/gonk
Greg Guthe bdcbed2f15 servo: Merge #7164 - Use one version of serde_macros (from g-k:one-serde-macros-0.5.1); r=mbrubeck
Refs: https://github.com/servo/servo/issues/7130

Ran `./mach update-cargo -a` and only seeing version 0.5.1:

```
$ git grep serde_macros
components/canvas_traits/Cargo.toml:serde_macros = "0.5"
components/canvas_traits/lib.rs:#![plugin(serde_macros)]
components/devtools/Cargo.toml:serde_macros = "0.5"
components/devtools/lib.rs:#![plugin(serde_macros)]
components/devtools_traits/Cargo.toml:serde_macros = "0.5"
components/devtools_traits/lib.rs:#![plugin(serde_macros)]
components/gfx/Cargo.toml:serde_macros = "0.5"
components/gfx/lib.rs:#![plugin(serde_macros)]
components/layout/Cargo.toml:serde_macros = "0.5"
components/layout_traits/Cargo.toml:serde_macros = "0.5"
components/layout_traits/lib.rs:#![plugin(serde_macros)]
components/msg/Cargo.toml:serde_macros = "0.5"
components/msg/lib.rs:#![plugin(serde_macros, plugins)]
components/net_traits/Cargo.toml:serde_macros = "0.5"
components/net_traits/lib.rs:#![plugin(serde_macros)]
components/profile_traits/Cargo.toml:serde_macros = "0.5"
components/profile_traits/lib.rs:#![plugin(serde_macros)]
components/script_traits/Cargo.toml:serde_macros = "0.5"
components/script_traits/lib.rs:#![plugin(serde_macros)]
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock:name = "serde_macros"
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/servo/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
components/style/Cargo.toml:serde_macros = "0.5"
components/style/lib.rs:#![plugin(serde_macros)]
components/style/lib.rs:#![plugin(serde_macros)]
components/util/Cargo.toml:serde_macros = "0.5"
components/util/lib.rs:#![plugin(serde_macros)]
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock:name = "serde_macros"
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/cef/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock:name = "serde_macros"
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
ports/gonk/Cargo.lock: "serde_macros 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
```

Source-Repo: https://github.com/servo/servo
Source-Revision: fa83cfb4b501d3731392ba82de76933416fc31a8
2015-08-11 16:43:09 -06:00
..
.cargo servo: Merge #6740 - Upgrade openssl, selectors, and cocoa (from mbrubeck:bitflags); r=larsbergstrom 2015-07-30 15:44:12 -06:00
src servo: Merge #7057 - Remove unnecessary mut on variables declared in ports/gonk/src/window.rs (from fitzgen:unnecessary-mut-variables); r=jdm 2015-08-07 03:09:24 -06:00
build.rs servo: Merge #5453 - Remove an unused import (from Ms2ger:unused-import); r=glennw 2015-03-30 09:46:07 -06:00
Cargo.lock servo: Merge #7164 - Use one version of serde_macros (from g-k:one-serde-macros-0.5.1); r=mbrubeck 2015-08-11 16:43:09 -06:00
Cargo.toml servo: Merge #7053 - Move net_error_list from net to net_traits. Fixes #7050 (from connorimes:move-net-error-list); r=mbrubeck 2015-08-07 01:55:20 -06:00
fake-ld.sh servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck 2015-06-19 16:46:55 -06:00
makefile.cargo servo: Merge #4306 - Add a port for gonk (from michaelwu:gonk-port-three); r=glennw 2014-12-09 14:42:57 -07:00
README.md servo: Merge #6306 - Use Cargo's target directory sharing (from metajack:shared-target-dir); r=mbrubeck 2015-06-15 13:08:14 -06:00

Instructions for building the Gonk port

Set up an android toolchain and NDK

Follow the steps here for setting up the Android NDK and toolchain.

Bootstrap B2G

We have a bootstrap of the require B2G prebuilt binaries, assuming that you are targeting a Flame device.

curl https://servo-rust.s3.amazonaws.com/B2G/B2G.tgz
tar zxvf B2G.tgz

Build B2G

If you are not using a Flame or just would like to have a local build of the binaries, you can also build B2G locally. Note: this will take a long time and will take around 20GB of space

Disable the screen timeout on the device, and connect to wifi. Also connect it to your computer with remote debugging enabled.

git clone https://github.com/mozilla-b2g/B2G
./config.sh flame-kk

If behind a firewall, put the following in your gitconfig:

[url "https://github"]
        insteadOf = git://github
[url "https://git.mozilla.org/external/caf"]
    insteadOf = git://codeaurora.org

Then run

./build.sh libssl libsuspend libz libGLESv2 toolbox libhardware

Build B2S

Either set the corresponding b2g key in .servobuild to the path to the B2G bootstrap or clone (along with), or set the $GONKDIR environment variable.

Do the same for the ndk and toolchain keys ($ANDROID_NDK and $ANDROID_TOOLCHAIN respectively)

Run ./mach build-gonk from the root directory

Copy the files to the Flame

To reduce the size of libmozjs.so (target/arm-linux-androideabi/build/mozjs-sys-*/out/libmozjs.so), you can run strip on it. Use the one in your toolchain ($ANDROID_TOOLCHAIN/bin/arm-linux-androideabi-strip libmozjs.so).

Make sure the device is on, connected to wifi, with high or no screen timeout.

# Switch to a read-write system
adb remount

# Copy mozjs
adb push /path/to/stripped/mozjs.so system/lib

# Copy b2s
adb push target/arm-linux-androideabi system/bin

# Copy resources
adb shell mkdir sdcard/servo
adb push resources sdcard/servo

Run B2S

Make sure you're still connected to wifi

adb shell stop b2g
adb shell "echo 127 > /sys/class/leds/lcd-backlight/brightness”
adb shell start b2g

Now run adb shell, cd to system/bin, and run ./b2s <url>

If the screen keeps alternating between B2G and B2S, run adb shell stop b2g (you can restart it later).