khorben's Place

hackable:1 builds and provides a package repository for Maemo

Blog post by khorben on 20/03/2011 23:18:47
I had been thinking about testing the DeforaOS graphical applications [1] on my N900 [2] for a while, but remained concentrated on the Openmoko Freerunner [3] and hackable:1 [4] until it was satisfying enough. With the upcoming dse2 [5] release being in a good shape [6], I decided to have a short look anyway.

My first reaction was very much like when I checked Maemo [7] back in 2008:
  • you need me to install scratchbox, which only supports i386? [8]
  • the documentation links to external sites (Debian packaging) but doesn't explain how to actually build a package? [9]
  • you prevent me from navigating the repositories freely? [10]
But this time, with the lessons learned while re-implementing strap:1 and cross-compiling Debian packages, I figured I could do it another way: with hackable:1 itself. Here is how.


First, I determined how to populate the cross-compilation environment with the proper binaries. I added trunk/build/strap1/hostname/n900.nokia.maemo, containing:

ENVIRONMENT=GNOME #it's empty at the moment
VERBOSE=1
DEBIAN_MIRROR=repository.maemo.org
DEBIAN_REPOSITORIES=sdk/free
DEBIAN_VERSION=maemo5.0
DEBIAN_SOURCES="deb http://$DEBIAN_MIRROR/ $DEBIAN_VERSION $DEBIAN_REPOSITORIES"
VENDOR=Nokia
MODEL=N900
PURPOSE=phone

This also required handling Nokia-N900-phone as a valid profile, in trunk/build/strap1/profile/Nokia-N900-phone:

ARCH="armel"
STRIP="arm-linux-gnueabi-strip"
#this device is a phone
. "strap1/profiles/include/phone.include"
#add bluetooth support
. "strap1/profiles/include/bluetooth.include"
[...]

(and so on for the rest of the hardware capabilities)

Once this added, this simple command was enough to populate the environment:
# ./strap1.sh DESTDIR=/usr/arm-linux-gnueabi HOSTNAME=n900.nokia.maemo install

There I was. It was even faster than with a regular Debian target, since there are way less packages available to parse. But did I miss installing the development packages? Totally. Yet it doesn't matter:
# ./strap1.sh DESTDIR=/usr/arm-linux-gnueabi HOSTNAME=n900.nokia.maemo \
PACKAGES="libssl-dev libgtk2.0-dev" install

And seconds later, I had these two installed as necessary, along with their dependencies of course. Sweet, but we're not done yet. Let's build actual packages:

$ cd trunk/packages
$ ./packages.sh DEBIAN_ARCH=armel DEBIAN_VERSION=maemo libsystem
$ ./packages.sh DEBIAN_ARCH=armel DEBIAN_VERSION=maemo libdesktop
$ ./packages.sh DEBIAN_ARCH=armel DEBIAN_VERSION=maemo editor

Unfortunately, even with the correct binaries and packages definitions installed in the cross-compilation environment, dh_shlibdeps failed to grab the right dependencies. Disabling it during cross-compilation was enough to do the trick (commenting it out in debian/rules from the diff file).

Time to add this new repository into the N900 [11], through "Application manager"->"Catalogs"->"New" [12]:
Catalog name: hackable:1
Web address: http://build.hackable1.org/debian
Distribution: wip-maemo
Components: main

Open a terminal, gain root privileges:
# apt-get update
# apt-get install libsystem0 libdesktop0 editor
[...]
$ editor

And it works. I repeat: sweet.

Update:

[1] http://www.defora.org/os/wiki/3426/Graphical-environment
[2] http://maemo.nokia.com/n900/
[3] http://wiki.openmoko.org/wiki/Neo_FreeRunner
[4] http://trac.hackable1.org/
[5] http://trac.hackable1.org/trac/wiki/AvailableVersions/dse2
[6] http://www.defora.org/os/download/download/3512/dse2-Screenshot-2.png
[7] http://www.maemo.org/
[8] http://scratchbox.org/documentation/user/scratchbox-1.0/html/installdoc.html#AEN47
[9] http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing
[10] http://repository.maemo.org/dists/maemo5.0/
[11] http://people.defora.org/~khorben/share/n900/Screenshot-20110321-000354.png
[12] http://people.defora.org/~khorben/share/n900/Screenshot-20110321-000410.png