I wanted to provide a quick guide for those who might be tinkering around with snaps. This is a demonstration for developers interested in the ability to create snaps of their applications as well for Unity8, analogous to the experience of snaps on classic Ubuntu on Unity7, as outlined at https://developer.ubuntu.com/en/desktop/get-started/. These instructions assume you’ve already installed and experienced ubuntu-core, the ubuntu-snappy-cli, installing and running snaps on Unity7. You should also be running an up-to-date Ubuntu 16.04 system, since there are updates consistently being made to snapcraft and snapd.
In following this guide you’ll eventually run ubuntu-clock-app as the demonstration. In order to avoid confusion, ensure you do not have the clock application installed on your ubuntu-core from previous experimentation. The reason for this is that ubuntu-clock-app in the store assumes it is running on an X11 based system, but the snap we are going to build and install here assumes it is running on a Mir based system and there is no X11 in the Unity8 session. So before we begin, while logged into your Unity7 session run the following:
$ sudo snap remove ubuntu-clock-app
If you haven’t already, you need to install the unity8-desktop-session-mir package and add ppa:ci-train-ppa-service/stable-phone-overlay (the addition of the ppa is in order to keep up to date with the latest Unity8, UI toolkit and Mir changes that are being regularly released for the phone).
Note1: we are in the process of SRU’ing a change to Unity8-desktop-session-mir that will automatically add the PPA, but for now this is required as the SRU process will take time.
Note2: you must be using free graphics drivers for the unity8-desktop-session-mir, for instance if you are on an Intel gpu you will have no problems, if you are on an AMD gpu you will need radeon, if you are on Nvidia you will need Nouvea.
Open a terminal and run the following commands:
$ sudo apt-add-repository ppa:ci-train-ppa-service/stable-phone-overlay
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install unity8-desktop-session-mir
At this point, you should be able to log out of your Unity7 session and toggle the greeter icon to Unity8 and login. Once in your Unity8 session, you can navigate to the Ubuntu Store scope on the Dash via the Apps scope. Search for the terminal app and install it.
NOTE: i’m trying to get the terminal app updated in the store to be a “fat package” which means working for both amd64 and armhf architectures. Until then you can find and install the terminal app from http://people.ubuntu.com/~mhall119/dogfooding-unity8/ per the instructions in this post http://mhall119.com/2016/05/dogfooding-unity-8/
Open up the terminal app to download the ubuntu-clock-app source that has relevant snapcraft files and modifications to support running on the Unity8-Mir system. If you want to see the what modifications I had to add you may compare the branch we’ll be building, lp:~kgunn72/snappy-desktop-exmaples/try-mir-take1 to lp:snappy-desktop-examples . The modifications are mainly that the snap needs to contain the qtmir plugin since Unity8 is running on the Mir stack for graphics and X11 is not running.
You’ll notice on the installation step we install with –devmode, as we are just now in the process of creating the interfaces for Unity8 and Mir. Running in –devmode means that the application is not confined. Then enjoy building and running the snap:
$ bzr branch lp:~kgunn72/snappy-desktop-examples/try-mir-take1
$ cd ./try-mir-take1/ubuntu-clock-app
$ sudo snap install ubuntu-clock-app*.snap –devmode
OK congrats, you’ve built a snap for an application that runs on unity8. There is one bug (https://bugs.launchpad.net/ubuntu/+source/unity8-desktop-session/+bug/1590439) that we need to account for to add /snap/bin to our path. But once done, you should be able to launch the app.
$ export PATH=$PATH: /snap/bin
Hope you enjoyed this exercise. In theory this could be applied to any application that might have been created for the Ubuntu phone. We’ll be working to make this process less manual over time.