How to install Ubuntu sdk on ubuntu touch?
I bought a BQ M10 Ubuntu Edition. I want to use that device also as notebook and i want to develop ubuntu apps with the device.
The problem is, that there is not ubuntu sdk IDE program installed on it.
Is there a way to install the ubuntu sdk IDE on the device and if yes, how do i do that?
EDIT: Here is what i found out so far: There is a script, that seems to install legacy programs on ubuntu touch. It seems to be from a member of canonical: Script to install legacy programs on ubuntu touch. I tried it several times on the bq M10 but it ended up with errors all the time.
Solution 1:
Sadly I do not know the full solution to this as some packages seem to be broken (at least when using a xenial container). However, one part of the problem is that the Ubuntu SDK is not in the main/universe repos, but in a ppa, so it is necessary to add the ubuntu-sdk-team/ppa personal package archive to the apt sources ofthe container. This has to be done between the creation of the container and the installation of the package, so the line has to be inserted into the script. The command to add the ppa should be
libertine-container-manager create -i $NAME -a ppa:ubuntu-sdk-team/ppa
Afterwards in my case apparmor failed at the configuration, so multiple packages remained unconfigured. I could fix it with a mkdir call in the SDK still complained about a missing mir plug in.
Solution 2:
I have found a new possible solution to this. Using the Ubuntu SDK should be possible if it was compiled into a click package. In fact, there is a bazaar branch on launchpad which seems to exist just for this purpose with the name lp:ubuntu-sdk-ide-click.
At first, check whether you have the required development tools on a desktop Ubuntu computer. Ensure that you have installed the packages click and bzr.
To build the package, you must download the branch at first using
bzr branch lp:ubuntu-sdk-ide-click
Go into the newly created directory ubuntu-sdk-ide-click
cd ./ubuntu-sdk-ide-click
Export the current directory to the PATH environment variable. This is necessary, as the python script which will be run soon expects this directory to be present.
export PATH=$PATH:<insert current working directory here>
Now you must create the necessary files and directories for building the package. Run
create-ubuntu-sdk-ide-click.py
This can take quite a while. At some point of time, the script crashed in my Ubuntu installation.
But when the script has crashed because of an UnicodeEncodeError, you can fix the problems and do the last step to build an armhf click package for your m10 manually.
Be careful, as the following command removes all files with non-ascii-filenames recursively in the current working directory. Assure that you are in the right directory and run
LC_ALL=C find . -name '*[! -~]*' -delete
Then you can do the last necessary step of the script manually. Run
click build ./click-armhf/
Afterwards, there should be a click file in the current working directory. Copy this to your device for the installation process.
On the device install the package using pkcon. Most likely, you will not have signed the click package, so you have to run
pkcon --allow-untrusted install-local <insert the name of the click file on the device here>
Running the SDK also is a minor challenge. Based on the README available, the following set of commands should work. Eventually, you might put them into a script.
export TMPDIR=/tmp
Xmir :1 -mirSocket $XDG_RUNTIME_DIR/mir_socket --desktop_file_hint=dialer-app&
export DISPLAY=:1
export QT_QPA_PLATFORM=xcb
export LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/:/opt/click.ubuntu.com/com.ubuntu.sdk/current/usr/ubuntu-sdk-ide/qtcreator/
export LD_LIBRARY_PATH=/opt/click.ubuntu.com/com.ubuntu.sdk/current/usr/ubuntu-sdk-dev/lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=/opt/click.ubuntu.com/com.ubuntu.sdk/current/usr/ubuntu-sdk-ide/bin/plugins/
/opt/click.ubuntu.com/com.ubuntu.sdk/current/ubuntu-sdk-ide-click
Decide whether the SDK runs sufficiently fast and running the SDK is simple enough.