Exiv2 library

I am trying to crate a snap for a program that uses the libexiv2 library. The system I am using runs Xubuntu 20.10 and has libexiv2-27 installed. The relevant parts of the .yaml file are:

    command: bin/geeqie
    extensions: [gnome-3-34]
       - libexiv2-dev
      - libexiv2-27

Running this gives the error message:
Failed to fetch stage packages: Error downloading packages for part 'geeqie': The package 'libexiv2-27' was not found..

If I change the .yaml file to be:

      - libexiv2-14

the snap is created, but running the snap gives the message:
error while loading shared libraries: libexiv2.so.14: cannot open shared object file: No such file or directory

Can anyone give me an idea of where the problem lies?

If you’re using base: core18 and building with snapcraft (multipass) or snapcraft --use-lxd (lxd) then you’ll be building against the Ubuntu 18.04 repo. libexiv2-27 only exists in 20.04 and above, as can be found via https://packages.ubuntu.com/search?keywords=libexiv2-27

libexiv2-14 in indeed the right version of that library if building against 18.04 (bionic). https://packages.ubuntu.com/search?keywords=libexiv2-14

According to the filelist for that package, the library should be in /usr/lib/x86_64-linux-gnu/. So, once installed, does /snap/geeqie/current/usr/lib/x86_64-linux-gnu/libexiv2.so.14 exist? If so, it should be found, unless there’s something else in the snapcraft.yaml preventing that. Could you please paste the entire yaml?

1 Like

Thanks. So I need to have libexiv2-14 installed on the system I am compiling on.

This is the first snap I have tried to create, and am unsure of several aspects e.g. when using core18 is it typical to development to be done on a system that has 18.04 installed?

Thanks for your initial fast response! Sorry for my lack of understanding the basics.

name: geeqie
grade: stable
adopt-info: geeqie
license: GPL-3.0+

base: core18
confinement: strict

    command: bin/geeqie
    extensions: [gnome-3-28]
      - home
      - network
      - dbus-daemon
    common-id: geeqie.desktop

    plugin: autotools
    source: http://www.geeqie.org/git/geeqie.git
      - --disable-lirc
    source-branch: master
      - intltool
      - gettext
      - libchamplain-gtk-0.12-dev
      - libchamplain-0.12-dev
      - liblcms2-dev
      - libexiv2-dev
      - libgexiv2-dev
      - liblua5.1-0-dev
      - libffmpegthumbnailer-dev
      - libtiff-dev
      - libjpeg-dev
      - libheif-dev
      - libwebp-dev
      - libdjvulibre-dev
      - libopenjp2-7-dev
      - libpoppler-glib-dev
      - libchamplain-gtk-0.12-0
      - libchamplain-0.12-0
      - libclutter-1.0-0
      - libclutter-gtk-1.0-0
      - liblcms2-2
      - liblcms2-utils
      - libexiv2-27
      - libgexiv2-2
      - liblua5.1-0
      - libffmpegthumbnailer4v5
      - libtiff5
      - libjpeg8
      - librsvg2-common
      - libwmf0.2-7-gtk
      - exiftran
      - imagemagick
      - ufraw
      - exiv2
      - markdown
      - gphoto2
      - libimage-exiftool-perl
      - libheif1
      - libwebp6
      - libdjvulibre21
      - libopenjp2-7
      - libpoppler-glib8
      - libgpm2
      - libslang2

      snap/geeqie/current/usr: usr
    parse-info: [/root/parts/geeqie/build/org.geeqie.Geeqie.appdata.xml]

    interface: dbus
    bus: session
    name: geeqie.desktop
1 Like

I just used your yaml, with libexiv2-27 replaced with libexiv2-14 and ran snapcraft --use-lxd which build the application successfully and runs fine for me with the --disable-clutter option.


1 Like

You do not need libexiv2-14 on the system you are hosting Snapcraft on. The reason exiv2-14 is needed in stage packages, is because the snap is being built against Ubuntu 18.04.

The default for Snapcraft is to make an environment, whether by Virtual Machine (Multipass), or LXD with the --use-lxd paramaters, that mirrors the environment of the base snap. (I.E, it’ll literally download a lot of Ubuntu 18.04 if you choose to use Core18 base). Both of these are detatched from your host OS that is running Snapcraft. All the building is done in the VM or the LXD container.

As such, when you are building a core18 snap, it derives packages from the Core18 repository. It does not matter what version of Ubuntu you are on, or that you’re on Ubuntu at all. This is why libexiv2-27 wasn’t found. The snap you are building had access to 18.04s repositories, not 20.04.

It is not required nor assumed that you run Snapcraft on the system that matches the base snap.

It is possible to use the host system as a build environment, but that is advanced functionality that has few practical uses and is not generally recommended.

1 Like