Running qt application using snap

Hello All,

I have been referring following example to build and run qt application.
https://github.com/snapcore/snapcraft/tree/master/demos/qt4-text-editor

I have followed the example and the snap file gets created successfully.
I just want to know during creation of .snap file whole source code is linked or just executable is
installed.
Because if we don’t want to share the source code how it is taken care in snap.

Another thing is that i have a qt application already build into ubuntu 14.04 can i run the application directly providing the necessary lib files using the snap.

from reading snap/snapcraft.yaml of this example:

in this specific example the qt4conf wiki part is pulled from:


( after: [qt4conf] )

then snapcraft hops into the src/ directory and calls qmake…
( plugin: qmake, source: src/)
for qt4…
(qt-version: qt4)

once it is done it installs the required runtime dependencies into the snap
( stage-packages: - libqtgui4)

and creates a squashfs file of this …

if the 14.04 qt4 libs would be identical to 16.04 (which is what all snap packages use underneath) you could theoretically re-use your pre-built binary if it does not try to access system paths and the like … practically i doubt the libs are identical and typically you might need to adjust some bits for the specific snap setup to have your app use the right writable paths … so it is likely you need to re-build (but probably worth a try to simply use the existing app, it wont take much time to create a snapcraft.yaml that just copies the binary in place and has the needed stage-packages)