Error setting path in crafting

Hi all,

I’m trying to create a working snap from GNOME Commander using autotools after installing gcc-9.
(I’m using core18 Ubuntu 18.04.5 LTS).

The crafting process goes through, however the path for installing doesn’t seem to be correct, and I don’t now how to get it right:

This is from my snapcraft.yaml:


parts:
gcmd:
source: https://download.gnome.org/sources/gnome-commander/1.10/gnome-commander-1.10.3.tar.xz
plugin: autotools
configflags: [–prefix=/usr/local/]

Below is from the build process:

./configure --prefix= --prefix=/usr/local/

The result can be seen at the bottom right before staging process:


Note that ‘/root/parts/gcmd/install//usr/local/share/gnome-commander’ is not in the search path
set by the XDG_DATA_HOME and XDG_DATA_DIRS
environment variables, so applications may not
be able to find it until you set them. The
directories currently searched are:

  • /root/.local/share
  • /usr/local/share
  • /usr/share
  • /var/lib/snapd/desktop

make[3]: Leaving directory ‘/root/parts/gcmd/build/data’
make[2]: Leaving directory ‘/root/parts/gcmd/build/data’
make[1]: Leaving directory ‘/root/parts/gcmd/build/data’
Making install in tests
make[1]: Entering directory ‘/root/parts/gcmd/build/tests’
make[2]: Entering directory ‘/root/parts/gcmd/build/tests’
make[2]: Nothing to be done for ‘install-exec-am’.
make[2]: Nothing to be done for ‘install-data-am’.
make[2]: Leaving directory ‘/root/parts/gcmd/build/tests’
make[1]: Leaving directory ‘/root/parts/gcmd/build/tests’
make[1]: Entering directory ‘/root/parts/gcmd/build’
make[2]: Entering directory ‘/root/parts/gcmd/build’
make[2]: Nothing to be done for ‘install-exec-am’.
make[2]: Nothing to be done for ‘install-data-am’.
make[2]: Leaving directory ‘/root/parts/gcmd/build’
make[1]: Leaving directory ‘/root/parts/gcmd/build’


How can the correct path /usr/local/bin be set?

Your snap package’s parts will be installed to /root/parts/*/install so if you specify a prefix of /usr/local then it will install to /root/parts/*/install/usr/local. This is correct and expected.

Unfortunately the snap cannot start after installing. Is this not due to missing files?

$ gnome-commander
Creating directory /home/stefan/.config/gnome-commander…
** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/gnome_cmd_arrow_up.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/gnome_cmd_arrow_down.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/gnome_cmd_arrow_blank.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/gnome-commander.svg instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/exec_wheel.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/menu_bookmark.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.749: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory

** (gnome-commander:4870): WARNING **: 23:11:40.749: Couldn’t load installed file type pixmap, trying to load …/pixmaps/overlay_symlink.xpm instead

** (gnome-commander:4870): WARNING **: 23:11:40.750: Can’t find the pixmap anywhere. Make sure you have installed the program or is executing gnome-commander from the gnome-commander-1.10.3/src directory
Could not load schemas from /usr/local/share/glib-2.0/schemas: Failed to open file “/usr/local/share/glib-2.0/schemas/gschemas.compiled”: open() failed: Datei oder Verzeichnis nicht gefunden
(gnome-commander:4870): GLib-GIO-CRITICAL **: 23:11:40.752: g_settings_schema_source_lookup: assertion ‘source != NULL’ failed

(gnome-commander:4870): GLib-GIO-CRITICAL **: 23:11:40.752: g_settings_new_full: assertion ‘schema != NULL’ failed

Are you using a gnome snapcraft-extension or the gnome-platform parts from snapcraft-desktop-helpers on GitHub? If you aren’t then there are likely runtime paths that need to be set-up appropriately. The easiest way to fix that is to use the gnome-3-28 extension by adding extensions: [gnome-3-28] to your app block in your snapcraft.yaml:

... # the rest of your yaml

apps:
  gnome-commander:
    extensions: [gnome-3-28]
    ... # the rest of your app config

... # the rest of your yaml

You’ll need to be targetting core18 for this to work, however:

base: core18

core18 already was used before. Sorry, but your hint didn’t improve the situation. I’m still getting those errors shown above.