Mobile/e10s

From MozillaWiki
< Mobile
Revision as of 16:12, 31 March 2010 by Dougt (talk | contribs)
Jump to navigation Jump to search

Weekly Meetings

There will be a meeting each week to discuss the general status of Mobile. Please use #mobile, dev-platforms-mobile@mozilla.org or mozilla.dev.platforms.mobile for communication

Meeting Details:

  • Wednesdays @ 1:00PM PST
  • +1 650-903-0800 (US/Intl) x92 conf# 8605
  • +1 800 707 2533 (US) pin 369 conf# 8605
  • #mobile for backchannel
  • Agenda and notes can be found here

Tasks

  • unowned tasks
    • Intermittent scrolling problem with autocomplete widget (?)

How to build

Setting up scratchbox (for Maemo devices only)

To build Fennec for Maemo devices like the N900, Nokia uses a scratchbox environment that keeps all of its packages separate from your Linux distribution. So you must:

  • Have Linux on your machine or in a VM
  • Set up scratchbox, which is a little painful

Below is the condensed version of Maemo install guide, intended for Ubuntu users. If you have questions or need something a little different, it is a good reference.

#
# Scratchbox: install these before doing your Maemo 5 scratchbox.
#

# Install instructions for scratchbox itself. Only need to do these steps once.
sudo echo "deb http://scratchbox.org/debian/ maemo5-sdk main" >> /etc/apt.d/sources.list
sudo apt-get update
sudo apt-get install scratchbox-toolchain-cs2007q3-glibc2.5-arm7

# Needed for Ubuntu.
sudo echo "vm.vdso_enabled = 0" >> /etc/sysctl.conf
sudo echo "vm.mmap_min_addr = 4096" >> /etc/sysctl.conf
sudo sysctl -p

#
# Maemo 5.0 scratchbox
#
wget http://repository.maemo.org/stable/5.0/maemo-scratchbox-install_5.0.sh \
  http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh 
sudo sh ./maemo-scratchbox-install_5.0.sh -s /scratchbox
sudo /scratchbox/sbin/sbox_ctl start

# If this is your first scratchbox installation, run this and re-login.
sudo /scratchbox/sbin/sbox_adduser $USER yes

sh ./maemo-sdk-install_5.0.sh

#
# Run /scratchbox/login.  You are now chroot'ed inside scratchbox environment.
#
sb-conf setup FREMANTLE_ARMEL -c cs2007q3-glibc2.5-arm7 \
  -d qemu:perl:debian-etch:doctools:svn:git -t qemu-arm-sb
wget http://repository.maemo.org/stable/5.0/armel/maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf select FREMANTLE_ARMEL
sb-conf rootstrap maemo-sdk-rootstrap_5.0_armel.tgz
sb-conf install -edFL

# Unfortunately anything built with QT requires a EULA.
# Here you will need to go to http://tablets-dev.nokia.com/eula/index.php and
# accept their EULA. Add the deb repo you subsequently receive to /etc/apt.d/sources.list
fakeroot apt-get update
fakeroot apt-get install nokia-binaries nokia-apps

For Fennec e10s, you will need to install some additional packages.

# You are still logged in to scratchbox, right?
fakeroot apt-get install libqt4-dev libqt4-gui \
  libxaw7-dev libfreetype6-dev libxi-dev \
  libhildonmime-dev libosso-dev libidl-dev liblocation-dev \
  libasound2-dev libhildon1-dev libiw-dev \
  libxdamage-dev libxcomposite-dev libnotify-dev libhildonfm2-dev \
  libconic0-dev python

Getting the source

Get mozilla and mobile projects off mercurial:

hg clone http://hg.mozilla.org/projects/electrolysis
cd electrolysis
hg clone http://hg.mozilla.org/users/pavlov_mozilla.com/mobile-e10s mobile

Right now, for Fennec we need additional platform patches on top of electrolysis branch. You will need mq for this.

cd .hg
hg clone http://hg.mozilla.org/users/dougt_mozilla.com/e10s-patches/ patches
NOTE: when getting a new patch queue, don't forget to
hg qpop -a
before you do so!
NOTE for contributors: If you push to the patches queue, please don't modify the status file.

Building for desktop

Building for Maemo devices

Create your .mozconfig in your electrolysis directory. Your .mozconfig should look something like this:

# For improved compile speeds, all optional.
export CCACHE_HARDLINK=1
export CC="ccache gcc"
export CXX="ccache g++"
mk_add_options MOZ_MAKE_FLAGS=-j3

# Make an optimized debug build.
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=yes

# important mobile options
mk_add_options MOZ_OBJDIR=mobilebase-qt-@CONFIG_GUESS@
ac_add_options --enable-application=mobile
ac_add_options --with-arm-kuser

# important qt options
ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --disable-crashreporter
ac_add_options --with-maemo-version=5

# e10s
ac_add_options --enable-ipc
Pro tip: if you are building for desktop and device, take the environment variable MOZCONFIG to your advantage. Put your device mozconfig in your scratchbox home directory. Then, in your scratchbox session:
[scratchbox $] echo export MOZCONFIG=$HOME/.mozconfig >> .bash_profile

Finally, run:

make -f client.mk

How to run

Create an executable script fennectrolysis in your $PATH as

#!/bin/bash
objdir=[$OBJDIR]/mobile/
export LD_LIBRARY_PATH="$objdir/dist/bin/xulrunner:/usr/lib/debug/lib:/usr/lib/debug/usr/lib"
cd $objdir/dist/bin && exec "$@" ./xulrunner/xulrunner-bin application.ini

replacing [$OBJDIR] with your fennec objdir.