Installing the Maemo SDK+ (Scratchbox2 based) Development Environment Pre-requisites: * Debian-based computer (Eg, Ubuntu) 1. Add Nokia's software repository to your packaging system. > deb http://maemo-sdk.garage.maemo.org/download/host ubuntu-karmic free Either use Ubuntu's graphical tools, or you can use the following command-lines: $ sudo echo "deb http://maemo-sdk.garage.maemo.org/download/host ubuntu-karmic free" > /etc/apt/sources.list.d/maemo-sdk.list $ sudo apt-get update 2. Download and install the SDK. Again, either use the GUI package manager, or the following command-line: $ sudo apt-get install maemo-sdk This will take a while as a number of additional packages are 3. Install the tools. The latest version, as of 2009.12.06, are lenny-2009-1: $ sudo maemo-sdk install tools lenny-2009-1 This installs a minimal Debian lenny system into /opt/maemo/dists which will be used to compile programs. 4. Install a toolchain The toolchain contains cross-compilers and other relevant tools required for building an executable. $ sudo maemo-sdk install toolchain i386-2007q3 4. Install one or more rootstraps. For initial development, you should use an i386 rootstrap; later on you will need an armel one. The rootstrap contains relevant header files, libraries, and miscellaneous programs needed to compile a program on the target platform. To install the i386 roostrap for N900 development, use the following command-line: $ maemo-sdk install rootstrap fremantle5.0minimal_i386 --------------------------- At this stage, everything works. sb2 - enter build mode sb2 -e - enter runtime (test) mode sb2 -eR - enter root runtime (maintenance) mode --------------------------- SOME FIXES BEFORE CONTINUING: 1. "/usr/sbin/dpkg-preconfigure: No such file or directory" This is just a warning, and can be ignored. Outside the scratchbox, copy dpkg-preconfigure into it: $ cp /opt/maemo/dists/lenny-2009-1/usr/sbin/dpkg-preconfigure /home/micha/.maemo-sdk/rootstraps/i386/fremantle5.0minimal_i386/usr/sbin/ 2. Install and fix fakeroot-net (i386 rootstrap only): This is more serious and stops things from working properly. For some reason this only happens inside the i386 target, not the armel target. 2.1 Enter the rootstrap: $ sb2 -eR 2.2 Install fakeroot-net: $ apt-get install fakeroot-net 2.3 Fix it: $ cd /usr/lib $ ln -s /usr/lib/libfakeroot . NOTE: On amd64 hosts, use this instead: $ ln -s /usr/lib32/libfakeroot . ---------------------------- 5. Install the Nokia binaries inside the rootstrap: 5.1 Get a Nokia-binaries code from the following URL: > http://tablets-dev.nokia.com/eula/index.php 5.2 Add the Nokia binaries repository to your rootstrap: $ echo "deb http://repository.maemo.org/ fremantle/ nokia-binaries" > ~/.maemo-sdk/rootstraps/i386/fremantle5.0minimal_i386/etc/apt/sources.list.d/nokia-binaries.list $ maemo-sdk -eR apt-get update 5.3 Do the installation $ maemo-sdk -eR apt-get install nokia-binaries -------------------- Part-way through this, LD_PRELOAD errors start *BROKEN* (This is avoided if the fixes above are applied) -------------------- 6. Install and configure some additional missing bits: 6.1 Fix Perl for scratchbox. NOTE: A more permanent fix is to put this inside your ~/.bashrc or similar. $ export SBOX_REDIRECT_FORCE=/usr/bin/perl 6.2 Enter the rootstrap as root: $ sb2 -eR 6.3 Install packages: $ apt-get install osso-af-settings libcanberra-gtk-module mafw-dbus-daemon mafw-gst-renderer mafw-tracker-source ----------------------- On amd64-host only: Part-way through here, apt breaks (cannot find libapt-xxxxx) ---------------------- 7. DONE! Now for a test run - compile and run maemopad. NOTE: All commands are run inside the host system, and NOT from within the rootstrap! 7.1 Go to a development directory or make one. 7.1 Get the maemopad sources: $ sb2 apt-get source maemopad 7.2 Enter the source directory. As of 2009.12.06, it is maemopad-2.6: $ cd maemopad-2.6 7.3 Compile it: $ sb2 dpkg-buildpackage -rfakeroot -d -b 7.4 Install it into the scratchbox environment: $ sb2 -eR dpkg -i ../maemopad_2.6-2+0m5_i386.deb 7.5 Start up the Maemo emulation environment: $ maemo-sdk start gui ----------------------- Still errors here.. :( ----------------------- 7.6 Start up your application: $ maemo-sdk start app maemopad 7.6 Enter the emulation environment: $ sb2 -e 7.7 Start up the Maemo system: $ af-sb-init.sh start 7.8 Start up your application: $ run-standalone maemopad 6. You're done - now you can download an example or write your own Hello World.