meta data for this page
Installing Maemo development environment
This page describes how to install Maemo 4.1.2 (DIABLO) SDK on 32-bit Linux (Ubuntu 8.04 has been used in install process, seems to work with 8.10 too). There is no suitable version of Scratchbox for 64-bit operating systems.
Easiest way (that is explained here) is to install all required components with scripts provided by Maemo.org. This is a compact version of the install procedure, complete info about the install process can be found from Maemo SDK developement pages.
Maemo SDK requires Scratchbox Apophis R4 cross compliation environment and some xserver application (Xephyr recommended), also closed Nokia binaries are required - provided by install script.
Components:
- Scratchbox (install with script)
- Xephyr xserver (install with apt-get)
- Maemo SDK (install with script)
Installing Scratchbox
- Make sure that
build-essentials
are installed on your system - Download install script from http://repository.maemo.org/stable/4.1.2/maemo-scratchbox-install_4.1.2.sh.
- Modify (root / super user access required)
/etc/sysctl.conf
(required by QEMU used by Scratchbox) and set following variables (create if doesn't exist)
vm.mmap_min_addr = 4096 vm.vdso_enabled = 0
- NOTE: In some cases setting the
vm.vdso_enabled = 0
can crash the system, it is recommended to test it before adding it to config. To test if OS is compatible:
echo 0 | sudo tee /proc/sys/vm/vdso_enabled
the other variable can be tested with:
echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr
- Apply changes that were made to config file:
sudo sysctl -p
- Execute script:
chmod a+x maemo-scratchbox-install_4.1.2.sh sudo sh maemo-scratchbox-install_4.1.2.sh
Scratchbox will be installed into
/scratchbox/
(on Debian based distributions) - Create a group for Scratchbox
newgrp sbox
- Add user into scratchbox (run outside scratchbox)
sudo /scratchbox/sbin/sbox_adduser <insert_username> yes
- User can login into Scratchbox with:
scratchbox
or
/scratchbox/login
For further details about installing and manual install, see INSTALL.txt.
Installing Maemo SDK
- Download install script from: http://repository.maemo.org/stable/4.1.2/maemo-sdk-install_4.1.2.sh.
- Execute script as normal user outside scratchbox:
chmod a+x maemo-sdk-install_4.1.2.sh sh maemo-sdk-install_4.1.2.sh
- When asked install Runtime Environment + All Dev and Dbg Packages
- When asked accept downloading of Nokia binaries. Accept the Nokia binaries license terms when asked (
I accept
)
- Install the closed Nokia binaries: run inside scratchbox for both targets (X86 and ARMEL):
fakeroot apt-get install maemo-explicit
Change target inside scratchbox:
sb-conf select <targetname>
e.g. changing from ARMEL to X86 in DIABLO write:
sb-conf select DIABLO_X86
Installing Xephyr
Install package named xserver-xephyr, run :
sudo apt-get install xserver-xephyr
Running Maemo
- Start Xephyr with command outside scratchbox:
Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite
- Login into scratchbox:
scratchbox
or
/scratchbox/login
- Select appropriate target inside scratchbox (ARMEL is mainly used for compiling and building apps into device)
sb-conf select <targetname>
- Create file named
.bash_profile
into home directory of the user inside scratchbox if it doesn't exist. Add lineexport DISPLAY=127.0.0.1:2
run:
source .bash_profile
- Start Maemo environment in Xephyr window:
- Run inside scratchbox:
af-sb-init.sh start
- Maemo env. can be stopped with:
af-sb-init.sh stop
- Remember to stop Maemo before stopping Xephyr
- If problems arise, run inside scratchbox:
sb-menu
and select kill all programs inside scratchbox or do it from command line with:
sb-conf killall
Building and running programs in Maemo
Building applications for Maemo is similar to building applications in Debian based distributions. Maemo uses different versions of toolchains. Build programs written in C-language:
gcc program.c -o program
Build programs written in C++ -language:
g++ program.cc -o program
Necessary libraries (in this case GTK+
and Hildon
, commonly used when creating an application with GUI for Maemo) and additional flags can be added into with pkg-config
as follows:
g++ program.cc -o program `pkg-config gtk+-2.0 hildon-1 --cflags --libs`
Own programs can be run inside maemo as standalone programs with:
run-standalone.sh ./program_executable
Building debian packages
Create package structure
Build package from source
If the sourcecode has the right debian-style structure, in the root of the source code use command:
fakeroot apt-get build-dep <name_of_the_pkg>
to build dependancies and use command:
dpkg-buildpackage -rfakeroot -b
to build the package (in the root of the source code folder).
Install built package
Use command:
fakeroot dpkg -i <packet_name>
Links
For complete information see:
- Maemo application development: GNU Autotools
- Maemo application development: Packaging applications
Installing components and needed resources for development
C language
Maemo installs c-language environment by default. Debugging tools have to be installed manually for both targets (X86 and ARM). Install debugging tools with meta package, run inside scratchbox:
fakeroot apt-get install maemo-c-debug-tools
C++ language
C++ environment meta-package for DIABLO SDK can be installed from DIABLO extras/free repository. Install them for both targets (X86 and ARM).
- Installing:
- Login into scratchbox
- Edit
/etc/apt/sources.list
and add following line:
deb http://repository.maemo.org/extras diablo free non-free
- Update package list:
fakeroot apt-get update
- Install environment, run:
fakeroot apt-get install maemo-cplusplus-env
- If for some reason the package cannot be found, install C++ environment from CHINOOK repositories,
- Edit
/etc/apt/sources.list
and add following lines:
deb http://repository.maemo.org/extras chinook free non-free
- Update package list:
fakeroot apt-get update
- Install environment:
fakeroot apt-get install maemo-cplusplus-env
- If C++ environment doesn't work properly, try to install
maemomm-cplusplus-env
package, which installs maemomm-2.4 C++ bindings. Can be installed fromchinook extras
repository (see previous). Install with:fakeroot apt-get install maemomm-cplusplus-env
Eclipse SDK and required tools and plugins
Eclipse SDK can be used to develop programs for Maemo environment with the help of suitable plugins.
Eclipse SDK version 3.3.1.1 (Europe) works very well with necessary plugins and the newest Maemo environment. Newest version - Ganymede works also with newest version of Esbox, but it seems that Esbox requires certain versions of plugins in order to work well in Ganymede, install following versions from repositories mentioned in following sections:
- Eclipse C/C++ Development tools and SDK, version 4.0.3
- Esbox, version 1.4.0
- Mylyn (all mentioned in Mylyn install), version 3.0.1
- PyDev for Eclipse, version 1.3.18
- Pydev Mylyn Integration, version 0.3.0
In Linux Eclipse requires Sun's Java environment to be installed, gcj isn't supported. To install Java 6 in Linux, run
sudo apt-get install sun-java6-jre sun-java6-jdk
To install additional tools and plugins in Eclipse go to Help → Software Updates → Find and Install and select Search for new features to install where new sources can be added.
Eclipse ready-to-code for Maemo
There is also a version of Eclipse 3.3 available, which has every Maemo development related plugin installed. For 32-bit linux only!. It can be re</del>trieved from:
web-server : Eclipse 3.3. CDT + maemo tools (public access)REMOVED FROM SERVER?- network share:
regulus.it.lut.fi/linuxapps/eclipse_maemo_ide/eclipse-3.3-CDT-mylyn-pydev-esbox.tar.gz
(samba share, restricted access), direct: smb://regulus.it.lut.fi/linuxapps/eclipse_maemo_ide/ , DOMAIN=LUT.
Eclipse CDT
Eclipse CDT is a C/C++ IDE for Eclipse to be used when developing programs in C or C++ (naturally). It can be installed via Eclipse update from (add as source into Eclipse Software Update and install):
Currently using version 4.0.3 of CDT. CDT is required by Esbox.
There is also a version of Eclipse CDT Europe which already has CDT plugin installed, it can be downloaded from here. This is used as basis for ready-to-code. Required components, install from Eclipse Europe discovery site:
- Eclipse Java Development tools
- Eclipse Plug-in Development tools
Mylyn
A repository for Mylyn should be available in the update list of Eclipse 3.3. Install it from there. If not add new site with address (for Eclipse 3.3 only, for other versions use corresponding version number - 3.x):
Install at least following components:
- Mylyn Bridge: Eclipse IDE
- Mylyn Bridge: Team Support (required?)
- Mylyn Connector: Bugzilla (required?)
- Mylyn Focused UI
- Mylyn Task List
PyDev
Can be installed via Eclipse Update (add site) from:
Install components:
- PyDev for Eclipse
- PyDev Mylyn Integration
Required by Esbox (at least version 1.3.7).
Esbox
Esbox (previously Laika) is an Eclipse IDE integration for Maemo development. It supports Scratchbox 1.x (e.g. Apophis) and 4.x versions of Maemo (Chinook and Diablo). By default it uses Xephyr as xserver and supports starting of Maemo environment directly from Eclipse and running own programs in Maemo. It can be installed via Eclipse Software Update from
Eclipse and Maemo projects
Creating a project
In order to use Eclipse with Maemo SDK, do not set your workspace to be inside scratchbox folder, set your workspace directory to be for example in your home folder. Esbox-plugin sets the Maemo projects to be in the workspace inside users home folder in scratchbox. So if you define a workspace to be:
/home/<username>/<workspace_name>
the path where Maemo projects will be located is:
/scratchbox/<username>/home/<username>/<workspace_name>/<project_name>
New projects can be created from templates delivered with Esbox, there are also some example projects available. To create a project from template or example:
- Select File → New → Project …
- Select C-Project → C/C++ Maemo Project → Next
- Select for example:
- Maemo Hello World Cpp project - for tutorial into Maemo
- Other Maemo project (e.g. C++ Socket example) - for advanced tutorial into Maemo
- Empty automake project - for basis of a new own project
- When adding new source files to project, edit
Makefile.am
file in foldersrc
:# Program executables (as a list) bin_PROGRAMS = <executable1> <executable2> # List source files here for all executables, the main file as first one <executable1>_SOURCES = main1.cpp \ utils.cpp \ utils.h <executable2>_SOURCES = main2.cpp \ utils.cpp \ utils.h # Additional flags for all executables, e.g. libraries. # For linker <executable1>_LDFLAGS = `pkg-config --cflags library1 library2 --libs library1> library2` <executable2>_LDFLAGS = `pkg-config --cflags library1 library2 --libs library1> library2` # Hildon libs for linker (probably already there) <executable1>_LDADD = $(LIBHILDONMM_LIBS) $(LIBHILDONFMMM_LIBS) <executable2>_LDADD = $(LIBHILDONMM_LIBS) $(LIBHILDONFMMM_LIBS) # Compiler, add additional libraries also in here after the hildon libraries <executable1>_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBHILDONFMMM_CFLAGS) `pkg-config --cflags library1 library2 --libs library1 library2` <executable2>_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBHILDONFMMM_CFLAGS) `pkg-config --cflags library1 library2 --libs library1 library2`
- When asked for compilation target select X86 DIABLO (or CHINOOK if using older Maemo SDK)
Building a project
Eclipse builds the project at first by default if Build Automatically -option is selected. To build a project in Eclipse:
- Select project folder and enable menu (right click)
- Select Build application → Generate configure
- Select Build application → Configure
- Select Build application → Build all
Running a project
Remember to start X server and Maemo environment before running. A project can be executed as follows:
- Select Run → Run As..
- Select Maemo local application
Links to Maemo resoures
Maemo DIABLO SDK release documentation - html
- covers everything DIABLO SDK related
Maemo DIABLO SDK training material
- Contains topics:
Maemo PC connectivity - instructions to get the connection working via usb-cable from device to PC.