|
|
| (26 intermediate revisions by 8 users not shown) |
| Line 1: |
Line 1: |
| ==Setting Up Scratchbox==
| | #REDIRECT [[Mobile/Build/cs2007q3]] |
| | |
| The maemo SDK is based around a tool called scratchbox. Scratchbox is a sandboxed emulator that you run on a fast development machine to configure, compile and run (test) the binaries that are to be installed on a target mobile device. It eliminates a lot of the difficulties associated with traditional cross compilation by essentially letting you pretend you're not cross compiling. To set it up, Nokia has written a very useful script called maemo-scratchbox-install.
| |
| | |
| These instructions are for setting up a new scratchbox installation. If you have an existing (i.e. 3.2/bora) scratchbox installation, you'll have to set an alternate path for the installation.
| |
| | |
| === Debian-based Linux distributions ===
| |
| | |
| Scratchbox will be installed by default from Debian .deb packages to the path /scratchbox
| |
| | |
| <code><pre>
| |
| wget http://repository.maemo.org/stable/chinook/maemo-scratchbox-install_4.0.1.sh
| |
| sudo chmod a+x ./maemo-scratchbox-install_4.0.1.sh
| |
| sudo ./maemo-scratchbox-install_4.0.1.sh
| |
| sudo /scratchbox/sbin/sbox_adduser $USER yes
| |
| </pre>
| |
| </code>
| |
| | |
| Replace $USER with an explicit user name if you want to create a scratchbox login for a user other than the current user.
| |
| | |
| === Other Linux distributions ===
| |
| On any other Linux distribution, the install will use .tar.gz files and you will have to specify the desired destination directory.
| |
| | |
| <code><pre>
| |
| wget http://repository.maemo.org/stable/chinook/maemo-scratchbox-install_4.0.1.sh
| |
| sudo chmod a+x ./maemo-scratchbox-install_4.0.sh
| |
| sudo ./maemo-scratchbox-install_4.0.sh -s /scratchbox
| |
| sudo /scratchbox/sbin/sbox_adduser $USER yes
| |
| </pre>
| |
| </code>
| |
| | |
| Again, replace $USER with an alternative user name if you like.
| |
| | |
| ==Setting Up Maemo Chinook SDK==
| |
| | |
| '''[Note: Maemo bora (3.0) is seemed incompatible because the file gtk+-unix-print-2.0.pc seems missing in Bora.]'''
| |
| | |
| Once you have set up scratchbox, you will need to install the maemo tool chain. Again, Nokia has provided a very useful script to install the maemo SDK for you. Simply accept the defaults and type "I accept" at the appropriate time.
| |
| | |
| '''Warning:''' if you are running Ubuntu Hardy Heron (8.04), [http://suppressingfire.livejournal.com/35277.html read this before you proceed any further]. You'll need to run both these commands to be able to install the Maemo SDK.
| |
| | |
| '''Note:''' you need to create a new login shell first so that your user is in the sbox group. You can do this by just logging out and logging back in again (that means log out of your machine -- creating a new terminal window will NOT work)
| |
| <br>
| |
| '''Note:''' If you would like to debug your code, you should select the 4th option on the "Package Selection" menu. You will also want to install "Closed Nokia Binaries"
| |
| <br>
| |
| <code><pre>
| |
| wget http://tablets-dev.nokia.com/4.0.1/maemo-sdk-install_4.0.1.sh
| |
| chmod +x maemo-sdk-install_4.0.1.sh
| |
| bash maemo-sdk-install_4.0.1.sh
| |
| | |
| </pre></code>
| |
| | |
| and to select the x86 target, run:
| |
| <code><pre>
| |
| echo "sb-conf select CHINOOK_X86" | scratchbox -s -p
| |
| </pre></code>
| |
| or for the ARMEL target, run:
| |
| <code><pre>
| |
| echo "sb-conf select CHINOOK_ARMEL" | scratchbox -s -p
| |
| </pre></code>
| |
| | |
| | |
| '''Note:' if you see this:
| |
| | |
| sb-conf: You must close your other Scratchbox sessions first
| |
| | |
| You should:
| |
| | |
| run sb-menu
| |
| | |
| go to killall
| |
| | |
| and send a 9
| |
| | |
| ==Building libIDL==
| |
| | |
| The the maemo SDK comes with just about everything required to build mozilla. The one thing that is missing is libIDL. The simplest thing to do is build it, run these commands in the scratchbox prompt:
| |
| | |
| <code><pre>
| |
| sb-conf se CHINOOK_X86 # because the release still cannot run on ARMEL
| |
| wget http://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-0.8.9.tar.gz
| |
| tar -xzvf libIDL-0.8.9.tar.gz
| |
| cd libIDL-0.8.9
| |
| ./configure
| |
| make
| |
| fakeroot make install
| |
| cd ..
| |
| </pre></code>
| |
| | |
| ==Building the Trunk (Mozilla 1.9)==
| |
| | |
| Finally, you are ready to build. Run these commands at the scratchbox prompt.
| |
| | |
| <code><pre>
| |
| sb-conf se CHINOOK_X86
| |
| export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig/
| |
| mkdir moz1.9
| |
| cd moz1.9/
| |
| cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk mozilla/browser/config
| |
| cd mozilla/
| |
| cp browser/config/mozconfig .
| |
| echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-dir-browser-chinook-armel" >> mozconfig
| |
| echo "ac_add_options --disable-tests" >> mozconfig
| |
| make -f client.mk pull_all
| |
| make -f client.mk build_all
| |
| </pre></code>
| |
| | |
| ==Running the Application==
| |
| | |
| To run your build in scratchbox, you'll need to install xephyr from your host machine. Fortunately if you are on a Debian based system (such as Ubuntu), this couldn't be easier. Just run, from your host machine:
| |
| | |
| <code><pre>sudo apt-get install xserver-xephyr</pre></code>
| |
| | |
| To start the xephyr server, run the following from the host machine:
| |
| | |
| <code><pre>Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite</pre></code>
| |
| | |
| once the xephyr xserver is running, you can launch your build from within scratchbox:
| |
| | |
| <code><pre>
| |
| $ scratchbox
| |
| [sbox-CHINOOK_X86:~] > sb-conf select CHINOOK_X86
| |
| [sbox-CHINOOK_X86:~] > export DISPLAY=:2
| |
| [sbox-CHINOOK_X86:~] > af-sb-init.sh start
| |
| [sbox-CHINOOK_X86:~] > cd moz1.9/mozilla/obj-dir-browser-chinook-armel/dist/bin
| |
| [sbox-CHINOOK_X86:~] > GRE_HOME=. ./run-mozilla.sh ./TestGtkEmbed # this is not yet runnable
| |
|
| |
| or
| |
| | |
| [sbox-CHINOOK_X86:~] > GRE_HOME=. ./run-mozilla.sh ./firefox | |
| </pre></code>
| |
| | |
| ==Convenient scripts ('''NOT UP TO DATE. Please use the instructions above.''')==
| |
| | |
| The following scripts can help speed up the process. You don't even have to start the scratch box shell if you run them with the following commands:
| |
| | |
| <code><pre>
| |
| cat buildlibIDL.sh | scratchbox -s -p
| |
| cat buildmoz19.sh | scratchbox -s -p
| |
| | |
| </pre></code>
| |
| | |
| [http://people.mozilla.org/~blassey/buildlibIDL.sh buildlibIDL.sh]
| |
| | |
| [http://people.mozilla.org/~blassey/buildmoz19.sh buildmoz19.sh] | |
| | |
| ==VMWare Image==
| |
| Alternatively, you can download this VMWare image which has already been set up to build mozilla for maemo.
| |
| | |
| [http://people.mozilla.org/~blassey/MaemoVM.7z MaemoVM.7z]
| |