← Back to team overview

ubuntu-phone team mailing list archive

Re: compiling and running the Telegram client telegram-cli on BQ (r24)

 

On Tue, Aug 11, 2015 at 5:25 AM, Matthias Apitz <guru@xxxxxxxxxxx> wrote:
1)
I do not have a desktop file and will look for example and modify this.
Is there any naming convention for xxxxxx.desktop

You can name it whatever you like, but be sure to put the correct name in the manifest file for the desktop hook.

That said, I don't know that you actually *need* a desktop hook in your manifest. Without it, you won't be able to launch the app from the GUI, but I don't think you'll be capable of that anyway. As far as I know, the Ubuntu Touch terminal is the only terminal emulator that doesn't let you specify a program to launch from the command line. (Even if it did, apparmor restrictions would probably block it from actually running.) Try it without one and see what happens.

2)
I do not have an icon, can I 'reuse' for example
/usr/share/icons/suru/apps/scalable/telegram-symbolic.svg

You don't need an icon. If one isn't specified in your desktop file, Unity will provide a boring default one. And if you manage to not include a desktop file, then this is a moot point.

3)
And this is the most challenging one: the 'app' telegram-cli epends on
some shared libs:

phablet@ubuntu-phablet:~$ ldd myRoot/home/phablet/telegram-cli | fgrep 'not found'
	libevent-2.0.so.5 => not found
	libjansson.so.4 => not found
	libconfig.so.9 => not found
	liblua5.2.so.0 => not found

Naively, I would think that you could include the .so files within your click package and then have your startup script adjust LD_LIBRARY_PATH to point to the location to which to they get installed.

A word of warning about using a shell script to initialize things: If your shell script is running under apparmor restrictions, it will be limited in what it can do. I tried to launch a Ubuntu Touch app with a shell script, but it failed because it wasn't allow to access /usr/bin/dirname (WTF?).

A word of warning about my word of warning: That applies when launching the app from Unity. If you're running the shell script from the terminal, the resultant process will (I presume) inherit the terminal's apparmor profile, which is more lenient.

And if I may pontificate a bit: I'm guessing from your email address that you have a strong UNIX background. My advice is, don't think about Ubuntu Touch as UNIX. Many Unixisms (shared libraries outside the core, communication through the file system, command-line-centered workflows) are missing in this brave new world of isolated applications and atomic updates. Some may reappear as snaps replace clicks.

Robert



References