chapter30

Click making the ubuntu-terminal-app

How to click make the ubuntu-terminal-app, with the target to integrate mutt into it. Guided by Alan Pope [email protected] (thanks)

$ bzr launchpad-login gubu
$ bzr branch lp:ubuntu-terminal-app/reboot ubuntu-terminal-app

mail from Alan:

I tend to build mine (outside the SDK) like this:-

Setup an armhf schroot:-

$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 create

I would also make one for amd64 and i386 because I may want to make a "fat" package containing binaries for phone and laptop/desktop computers too. The SDK doesn't yet support this directly using cmake so we kinda fudge it a bit.

$ sudo click chroot -a amd64 -f ubuntu-sdk-15.04 create
$ sudo click chroot -a i386 -f ubuntu-sdk-15.04 create

When I want to build, I just navigate to where the code is, and run

this "make_fat_package.sh" script:-

http://paste.ubuntu.com/12072962/

(which I got from Dan Chapman).

This basically builds for all 3 arches and then crams all three builds into one click package. There's a few apps in the store built like this.

If you only want one arch, just change line 12 in that script.

Some things will need dependencies installing inside the schroot. You can get a shell inside the schroot with this:-

$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 maint

You can then use the standard apt commands to get whatever dependencies are needed. Note that you need to specify the architecture if you're installing dev packages inside the schroot such as:-

$ apt-get install libfoo-dev:armhf

Hope that helps. Here's the typical output of me running "make_fat_package.sh" against terminal.

http://paste.ubuntu.com/12073031/

Cheers,

Alan Pope Community Manager

Canonical - Product Strategy +44 (0) 7973 620 164 [email protected] http://ubuntu.com/

I did on the Ubuntu laptop

$ sudo apt-get install click-dev
(was alread there)
$ sudo apt-get install schroot
(was alread there)
$ sudo apt-get install debootstrap
(was alread there)
$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 create
A chroot for that name and architecture already exists.
(perhaps from my tries to build a Qt app)
$ bzr launchpad-login gubu
$ bzr branch lp:ubuntu-terminal-app/reboot ubuntu-mutt-terminal-app
$ scp ......:scp make_fat_package.sh ubuntu-mutt-terminal-app
$ cd ubuntu-mutt-terminal-app
XXX: for sure there are file which must be changed from 'ubuntu-terminal-app'
(the original name) to 'ubuntu-mutt-terminal-app'
$ ./make_fat_package.sh
...
No such file or directory #include ...
fixed it with:
$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 maint
(click-ubuntu-sdk-15.04-armhf)[email protected]:/home/guru/ubuntu-terminal-app#
# apt-get install libpam0g-dev:armhf
# exit
$ ./make_fat_package.sh
...
[ armhf ] Cleaning up build dir
[ ubuntu-sdk-15.04 ] Modifying manifest.json
[ ubuntu-sdk-15.04 ] Build *multi.click package
WARNING:root:Ignoring missing framework "ubuntu-sdk-15.04"
Now executing: click-review ./com.ubuntu.terminal_0.7._multi.click
Errors
------
- security_template_valid (terminal.apparmor)
(MANUAL REVIEW) 'unconfined' not allowed
./com.ubuntu.terminal_0.7._multi.click: FAIL
Successfully built package in './com.ubuntu.terminal_0.7._multi.click'.
And were done!! \o/
$ ls -l ../com.ubuntu.terminal_0.7._multi.click
-rw-rw-r-- 1 guru guru 423502 Aug 14 19:08 ../com.ubuntu.terminal_0.7._multi.click

Modified files to integrate mutt support:

AUTHORS
CMakeLists.txt
com.ubuntu.terminal.desktop.in.in
manifest.json.in

new files:

src/app/qml/ubuntu-mutt-terminal-app.qml
mutt-terminal.apparmor
com.ubuntu.mutt-terminal.desktop.in.in
evolution-mail.svg
tests/autopilot/ubuntu_mutt-terminal_app
tests/autopilot/ubuntu_mutt-terminal_app/tests
tests/autopilot/ubuntu_mutt-terminal_app/tests/test_terminal.py
tests/autopilot/ubuntu_mutt-terminal_app/tests/__init__.py
tests/autopilot/ubuntu_mutt-terminal_app/__init__.py
$ pkcon --allow-untrusted install-local com.ubuntu.mutt-terminal_0.1._multi.click
$ sudo click register --user=phablet com.ubuntu.mutt-terminal 0.1.

(use 'click list' to find the correct name)

$ diff src/plugin/qmltermwidget/src/ksession.cpp*
78c78
< QStringList args("$APP_DIR/lib/arm-linux-gnueabihf/bin/mutt.sh");
---
> QStringList args("");
80c80
setAutoClose(true); // set to false to see invocation errors
---
> session->setAutoClose(true);
$ cat ../mutt.click/mutt.sh
#!/bin/sh
# where we have installed the sasl2 modules
#
SASL_PATH=${APP_DIR}/lib/arm-linux-gnueabihf export SASL_PATH
# we need lynx to read mails in HTML
#
LYNX_CFG=${APP_DIR}/lib/arm-linux-gnueabihf/bin/lynx.cfg export LYNX_CFG
LYNX_LSS=${APP_DIR}/lib/arm-linux-gnueabihf/bin/lynx.lss export LYNX_LSS
# we use a 'vim.basic' installed in the jail too, together with its config files
#
VIM=${APP_DIR}/lib/arm-linux-gnueabihf/bin export VIM
# if the user 'phablet' has a file ~/.muttrc, we use this; else we stopp
#
if [ -f ~/.muttrc ]; then
mutt -F ~/.muttrc
else
echo You must have a file ~/.muttrc, but you dont have.
echo Hit ENTER to close the app.
read a
fi

Last updated: Sat Oct 17 16:11:03 CEST 2015