View Single Post
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#1
This topic is to summarize the options & experiences to compile (in C/C++, Python, etc) and/or package (.deb) softwares for MeeGo Harmattan, always doing it on-device (N9/N950) without any need of a desktop PC.

1) gcc/g++/make/etc installed directly :
With PR1.3, the previous methods of installing gcc/g++/make don't work anymore. If you use PR1.0/PR1.1 it is easy, with PR1.2 it is complex to install but works. Anyway, gcc/g++/etc from Harmattan SDK repository wasn't meant to be installed directly on Nokia N9/N950, so with further releases of MeeGo Harmattan (PR1.1, PR1.2 and PR1.3) some compatibilities problems appeared between on-device packages and SDK packages.

2) Harmattan SDK on device :
The "MeeGo 1.2 Harmattan Plataform SDK" has a long installation procedure in desktop PC's. It can be used on-device (N9/N950) by mounting and chrooting an image, which is now easier with the release of Easy Chroot for MeeGo Harmatta.
I show here 2 options :
a) use the HSDK package by humble user :
With HSDK, it is easy to create & use a Harmattan SDK image. For Harmattan open mode users, v0.0.3 works. For Inception users, only v0.0.1 works well following these instructions. The image "SDK.img" is placed in "/home/user/MyDocs" and has : ext3 type, 2.86 GB, 441 MB free, gcc/g++ 4.4.1, Qt/Qt Quick, Python 2.6.6, PySide (Qt4 binding for Python), make, dpkg-*, etc;
b) use Easy Chroot with a ready-to-use Harmattan SDK image :
- download my Harmattan SDK modified image, harmattan-sdk.img.ext3 (527 MB compressed with lzma), with ext3 type, 3.13 GB, 554 MB free. It has additional softwares : gFortran, IPython, NumPy, PyGame, Pyside-tools, TeXLive, less, nano, htop and wget;
- place the image in "/home/user/MyDocs" of your N9/N950, uncompress it using :
~/MyDocs$ xz -d harmattan-sdk.img.ext3.lzma
in X Terminal, it takes about 5 minutes;
- follow the instructions to install & use Easy Chroot for MeeGo Harmattan;
- use the Harmattan SDK image with :
# qchroot /home/user/MyDocs/harmattan-sdk.img.ext3 /home/user/SDK
where /home/user/SDK is a directory with 777 permissions (use "# chmod 777 SDK");
- close the image with :
# closechroot /home/user/SDK

3) Maemo 5 (Fremantle) SDK on (N9/N950) device :
Like the Harmattan SDK, the "Maemo 5 SDK" has a long installation procedure in desktop PC's. But it can also be used on-device (N900 and also N9/N950) :
- download qole's simplified Maemo 5 SDK PR1.2 image (21 MB compressed with lzma), with ext2 type, 1 GB (only 122 MB used). It has gcc/g++ 4.2.1, dpkg-*, etc. Qt4 and Python aren't installed;
or
- download my Maemo 5 SDK modified (from qole's) image (41 MB compressed with lzma), with ext2 type, 512 MB (176 MB used). It has some directories already created inside the image and additional softwares (Python 2.5.2, less, nano, htop, wget, gdb, strace);
- place the image in "/home/user/MyDocs" of your N9/N950, uncompress it using :
~/MyDocs$ xz -d maemo-sdk-v1_2.img.ext2.lzma
in X Terminal, it takes 45-63s (on N9 @ 1 GHz);
- follow the instructions to install & use Easy Chroot for MeeGo Harmattan;
- use the Harmattan SDK image with :
# qchroot /home/user/MyDocs/maemo-sdk-v1_2.img.ext2 /home/user/SDK
where /home/user/SDK is a directory with 777 permissions (use "# chmod 777 SDK");
- close the image with :
# closechroot /home/user/SDK

4) Easy Debian & image with programming tools :
Easy Debian for MeeGo Harmattan gives a desktop Linux/Debian on your N9/N950 device, just choose an image (e.g, debian-m5-v3e-Sci) with gcc/g++/etc if you need C/C++ programming not targetting Maemo/MeeGo package distribution. You can add Fortran, Lua, Pascal, Ruby, etc.

5) Packaging (Python) softwares with PyPackager :
PyPackager is now compatible with MeeGo Harmattan. PyPackager is an easy way to package (mainly Python) softwares on-device, i.e., just run "python make.py" on your N9/N950. Download here the last version of PyPackager or v3.3.0 package (made by packaging with PyPackager on my N9 ! It includes "python" section for Python modules). See examples of "make.py" files in the source code of Khertan's softwares in GitHub.


In all images cited above :
- MeeGo "/home/user" and "/home/user/MyDocs" directories are shared with the image;
- you can add softwares by using "apt-get update", "apt-get install", etc. Use Easy Chroot version >= 0.2.0 to avoid the need of adding the sbin directories to root $PATH of the image;
- define the correct locale by typing in the SDK terminal :
# dpkg-reconfigure locales
and choose the languages you want (UTF-8 is recommended).

==================================================

FAQ :

1) Is it possible to change the image size ?
Yes, use a desktop Linux and X Terminal, e.g. :
$ resize2fs SDK.img 3300M
resizes the SDK image to 3,300 MB.

2) Can I use HSDK with a specific and ready-to-use image ?
Yes, rename the (Harmattan ou Maemo 5) image to "SDK.img" (in "/home/user/MyDocs/").
If not created before, make a "/sdk" directory, as root in Terminal :
# mkdir /sdk
# chmod 777 /sdk
Then, just use "hsdk -s" to start and "hsdk -e" to finish using the SDK, instead of qchroot / closechroot.

3) How can I save MyDocs free space ?
Leave the SDK image compressed when it is not used and you need more free space.
Just uncompress when needed as it is fast on N9/N950 :
~/MyDocs$ xz -d -k <image.lzma>
here -k means the image is not deleted.
To compress the image, it takes many minutes in Nokia N9/N950 and just some minutes in a desktop PC :
$ xz -z -k -F lzma <image>
Remember to tompress the image everytime after modifying it and before deleting it.

4) Which SDK image is better ?
- the Maemo 5 SDK with 512MB if you want gcc/g++ and v4.2 is enough, and it takes only 45 s to uncompress;
- the original Harmattan SDK with 2.86 GB if you want gcc/g++ 4.4 or the complete Harmattan SDK;
- the modified Harmattan SDK with 3.3 GB if you also want Python tools or TeX/LaTeX.

5) How do I package on-device with Aegis support ?
Use Harmattan SDK or PyPackager, both run on-device (N9/N950).
See many "control" (for Harmattan SDK use) or "make.py" (for PyPackager use) files in the source code of softwares in the Harmattan GitHub repository.

6) I want to develop in Python/QML on-device for MeeGo Harmattan, including packaging. What do I need ?
Just install Python packages directly on your N9/N950, there is no need of Harmattan SDK. Recommended packages to install via "apt-get install" as root : python-pyside, pyside-tools, ipython. More information in the Python/Harmattan Wiki.
To package on-device, use PyPackager.

7) Why is it interesting to develop and package on-device ?
* Maemo/MeeGo developers have mobile Linux power on their hands, we like the freedom to not depend on any desktop OS/softwares, we like to develop anywhere, anytime, with no limits;
* Harmattan SDK setup on Linux desktop OS is a very long and boring procedure and there are situations where you don't have permissions to install it on some PC. Using ssh to your N9/N950 with a Harmattan SDK image is a solution for these cases;
* because we can Others can not

8) What if I want to develop & package on desktop PC for MeeGo Harmattan ?
There are many options :
- use Qt SDK for C/C++/Qt/QML development with complete graphical IDE;
- use Harmattan SDK for C/C++/Qt/QML/Python/PySide development;
- use PySide Assistant for packaging Python softwares. Use the xen's version of PySide Assistant to follow Nokia Store guidelines.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-01-06 at 14:09. Reason: Fixed links to PyPackager
 

The Following 22 Users Say Thank You to rcolistete For This Useful Post: