Vala and Snapcraft. Issues with a library part in Vala.

Luca Dionisi luca.dionisi at gmail.com
Wed Feb 1 10:22:07 UTC 2017


I did my homework, but to no avail.

I found other snapcraft.yaml files with a Vala part using a Vala
library staged by another part.
Those I found (eg https://github.com/fenryxo/nuvola-snap) seem to
apply some workaround that involve modifications to the build scripts
of the projectcs themselves.
For instance, this build script
(https://github.com/tiliado/nuvolaplayer/blob/master/wscript) does a
lot of work to construct a 'vapi_dirs' variable to pass to the
compiler; thus the snapcraft.yaml can pass some configflags to the
autotools plugin to do the tricks. (i.e. build the "nuvola" part with
configflags: [ --prefix=/usr, "!--snapcraft", "!--with-unity" ])

This sort of 'workaround' I could also use. But I wonder if snapcraft
could find the "right thing to do" on its own in some way. Currently
the build-system configuration files for the software that I want to
snap is very simple and it expects to find the library in the
directory where the compiler searches by default.

Then I noticed that the snapcraft.yaml file for pantheon-mail seems
not to use any particular configflags for the "snapcraft" case. So I
was curious to see how it worked.

I installed a fresh 16.04, updated it, then copied in an empty dir the
snapcraft.yaml file (from the pantheon-mail branch of snappy-playpen).
Then I gave command "snapcraft" and got this error (obviously after a
lot of other successful doings):

Preparing to build mail
Building mail
cmake /home/luca/mail/parts/mail/src -DCMAKE_INSTALL_PREFIX=
-DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Icon cache will be updated
-- Desktop database will be updated
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Found Vala: /usr/bin/valac
-- checking for Vala version of 0.22.1
--   found Vala, version 0.30.1
-- Found vapigen: /usr/bin/vapigen
-- Unity launcher support: ON
-- Targeting WebKitGTK 2.4
-- GTK+ 3.12 support: ON
-- Vala fatal warnings: ON
-- Checking for modules
'granite;gthread-2.0;glib-2.0>=2.40.0;gio-2.0>=2.28.0;gtk+-3.0>=3.10.0;gee-0.8>=0.8.5;libcanberra>=0.28;sqlite3>=3.7.4;gmime-2.6>=2.6.17;libsecret-1>=0.11;libxml-2.0>=2.7.8;gcr-3>=3.10.1;gobject-introspection-1.0;libaccounts-glib;libgsignon-glib;unity;webkitgtk-3.0>=2.3.0'
--   No package 'libaccounts-glib' found
--   No package 'libgsignon-glib' found
CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532
(_pkg_check_modules_internal)
  src/CMakeLists.txt:518 (pkg_check_modules)

So I am stuck and couldn't see if/how the Vala compiler finds its way
in the example that you gave.
Can you help?




More information about the Snapcraft mailing list