Autotools missing "make install"?

Hello, I would like to create a snap for gtk-gnutella. This is the script:

name: gtk-gnutella
version: ‘1.1.14’
summary: The Most Efficient Gnutella Client
description: |
gtk-gnutella is a server/client for the Gnutella peer-to-peer network.
It runs on Microsoft Windows, MacOS and every Unix-like system which supports GTK+ (1.2 or above)
grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: devmode # use ‘strict’ once you have the right plugs and slots

parts:
gtk-gnutella:
plugin: autotools
override-build: ./build.sh
source-type: git
source: https://github.com/gtk-gnutella/gtk-gnutella.git

build-packages:
  - g++
  - make
  - libsdl1.2-dev
  - libpng12-dev
  - libsdl-net1.2-dev
  - libsdl-sound1.2-dev
  - libasound2-dev
  • libgtk2.0-dev

The process runs without apparent errors, ending with:

parts/gtk-gnutella/build"
Run “make install” to install gtk-gnutella.
Staging gtk-gnutella
Priming gtk-gnutella
Snapping ‘gtk-gnutella’ |
Snapped gtk-gnutella_1.1.14_amd64.snap

However what I get is an empty snap package. Maybe the “make install” step is not performed. What am I missing?
Thank you

Lucio

Hello Lucio,

The reason for the empty snap is that you overrode build, and in this case you should also add the command to install the package. You can use something like:

      override-build: |
          ./build.sh --prefix=/
          make install INSTALL_PREFIX=$SNAPCRAFT_PART_INSTALL

since this specific buildsystem uses the INSTALL_PREFIX variable instead of DESTDIR to set the installation directory. To have consistent, reproducible builds, and to use all the features available in Snapcraft 3, it’s also a good idea to add base: core and the necessary stage packages to your snapcraft.yaml file.

Update: are you sure gtk-gnutella uses SDL and ALSA libraries?

Thank you, as told on IRC I was able to build a non-empty snap (not sure how to test it locally), however when I build it on snapcraft.io I get (2?) errors. The log should be here:

I believe the critical info are:


/bin/sh: 4: msgfmt: not found
make[3]: *** [de.gmo] Error 127
Makefile:195: recipe for target ‘de.gmo’ failed
make[3]: Leaving directory ‘/build/gtk-gnutella/parts/gtk-gnutella/build/po’
Makefile:231: recipe for target ‘stamp-po’ failed
make[2]: Leaving directory ‘/build/gtk-gnutella/parts/gtk-gnutella/build/po’
make[2]: *** [stamp-po] Error 2
Makefile:108: recipe for target ‘subdirs’ failed
make[1]: Leaving directory ‘/build/gtk-gnutella/parts/gtk-gnutella/build’
make[1]: *** [subdirs] Error 1
Makefile:186: recipe for target ‘all’ failed
make: *** [all] Error 2

ERROR: Compiling failed.
Failed to run ‘override-build’: Exit code was 1.
Build failed

Any hint?

The important error is this:

/bin/sh: 4: msgfmt: not found

The gettext package includes the msgfmt tool, so you need to include gettext in your build-packages.

Adding gettext produced the first successful build on snapcraft.io!
Consequently I installed the published snap and gtk-gnutella started with a number of errors, probably related to missing files in the snap. The GUI also shows all squares instead of characters. This is what I get when launching from the console; how can I solve this?

19-04-21 08:36:44.767 (WARNING): prop_save_to_file(): could not stat “/home/lucio/snap/gtk-gnutella/5/.gtk-gnutella/config_gnet”: ENOENT (No such file or directory)
19-04-21 08:36:44.778 (INFO): malloc() allocated 3352 bytes of heap (3352 remain)
19-04-21 08:36:44.817 (WARNING): locale not supported by C library
19-04-21 08:36:44.883 (WARNING): Locale not supported by C library.
Using the fallback ‘C’ locale.
19-04-21 08:36:44.934 (MESSAGE): Failed to load module “overlay-scrollbar”
19-04-21 08:36:44.935 (MESSAGE): Failed to load module “gail”
19-04-21 08:36:44.935 (MESSAGE): Failed to load module “atk-bridge”
19-04-21 08:36:44.935 (MESSAGE): Failed to load module “unity-gtk-module”
19-04-21 08:36:45.015 (MESSAGE): Failed to load module “canberra-gtk-module”
19-04-21 08:36:45.113 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.205 (WARNING): Couldn’t find pixmap file: smallserver.xpm
19-04-21 08:36:45.209 (WARNING): Couldn’t find pixmap file: upload.xpm
19-04-21 08:36:45.209 (WARNING): Couldn’t find pixmap file: download.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: offline.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: online.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: upnp-unusable.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: upnp.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: natpmp.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: pause.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: chip.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: hungup.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: no_listening.xpm
19-04-21 08:36:45.210 (WARNING): Couldn’t find pixmap file: warning.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: upload.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: upload-yellow.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: upload-red.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: clanbomber_yellow.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: clanbomber_red.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: stock_form-time-field-16.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: save.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: booksha.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: bookshav.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: booktth.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: booktthv.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: booklib.xpm
19-04-21 08:36:45.211 (WARNING): Couldn’t find pixmap file: firewall.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: firewall_punchable.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: firewall_tcp.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: firewall_udp.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: firewall_udp_punchable.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: no_firewall.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: ultra.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: leaf.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: legacy.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: star-black.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: star-violet.xpm
19-04-21 08:36:45.212 (WARNING): Couldn’t find pixmap file: star-blue.xpm
19-04-21 08:36:45.213 (WARNING): Couldn’t find pixmap file: star-green.xpm
19-04-21 08:36:45.213 (WARNING): Couldn’t find pixmap file: star-yellow.xpm
19-04-21 08:36:45.213 (WARNING): Couldn’t find pixmap file: star-red.xpm
19-04-21 08:36:45.226 (WARNING): Couldn’t find pixmap file: filter.xpm
19-04-21 08:36:45.244 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.245 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.245 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.245 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.246 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.246 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.249 (WARNING): Couldn’t find pixmap file: icon.48x48.xpm
19-04-21 08:36:45.275 (WARNING): Couldn’t find pixmap file: magnet.16x16.png
19-04-21 08:36:45.290 (WARNING): Couldn’t find pixmap file: magnet.16x16.png
19-04-21 08:36:45.291 (WARNING): Couldn’t find pixmap file: go_back.xpm
19-04-21 08:36:45.326 (WARNING): can’t read file “/home/lucio/snap/gtk-gnutella/5/.gtk-gnutella/config_gui”: ENOENT (No such file or directory)

(gtk-gnutella:11291): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
19-04-21 08:36:45.602 (WARNING): Couldn’t find pixmap file: smallserver.xpm
19-04-21 08:36:45.602 (WARNING): Couldn’t find pixmap file: upload.xpm
19-04-21 08:36:45.602 (WARNING): Couldn’t find pixmap file: download.xpm
19-04-21 08:36:45.602 (WARNING): Couldn’t find pixmap file: icon.16x16.xpm
19-04-21 08:36:46.309 (MESSAGE): BOOT will be contacting an UHC
19-04-21 08:37:07.943 (WARNING): prop_save_to_file(): could not stat “/home/lucio/snap/gtk-gnutella/5/.gtk-gnutella/config_gui”: ENOENT (No such file or directory)

Just for everyone’s convenience, the Snapcraft recipe is located at: https://github.com/luciomarinelli/gtk-gnutella/blob/master/snap/snapcraft.yaml

Gtk applications are required to use the desktop-{gtk,gnome}* support part and launcher to handle runtime issues, refer Desktop App Support - GTK for more info.

I added

parts:
desktop-gtk2:

the strange thing is that the snap is created including gtk2 when built locally, while the same yaml is not accepted in snapcraft (the build process does not start)…