Snap works on one machine but not on another

Okay, progress is being made.

Here’s where it’s at as the snap has successfully been built, but when attempting to launch it via terminal, this is the result:

clementine: error while loading shared libraries: liblastfm.so.1: cannot open shared object file: No such file or directory

Additionally, building it via build.snapcraft.io is successful, but upon reviewing the reason it’s not being published to the store:

desktop interfaces (unity7,x11) specified without a corresponding meta/gui/*.desktop file. If using snapcraft, please see https://snapcraft.io/docs/build-snaps/metadata#fixed-assets. Otherwise, please provide a desktop file in meta/gui/*.desktop (it should reference one of the 'apps' from your snapcraft/snap.yaml). lint-snap-v2_meta_gui_desktop

So, it looks like I need to specify a gui desktop, but is that necessary since it’s meant to be used on …whatever (e.g. Cinnamon, Budgie, KDE, etc)?

BTW, I’d really like to credit you all for helping me with this. It’s inevitably gonna make a lot of Clementine users very happy once it’s done.

It’s not asking you to specify a “desktop” (Unity, KDE) it’s asking you to specify a desktop file which is a text file which tells all the standard Linux desktops use to present the application icon, description and executable location.

I’d also consider renaming the snap from clementine-snap to clementine. It doesn’t really make sense to have suffixes on the snaps.

1 Like

See the ever-helpful Arch wiki (in this case, their page on desktop entries).

3 Likes

I’m not sure how I feel about this…I’m afraid to try it…

EDIT: FAIL

bad system call

Okay, I’ve got it down to a problem with SHARED LIBS. I am having trouble finding documentation on this subject as it directly pertains to snap packages. Anyone know where to look?

I am not a dev so you have to talk to me like a dummy, lol. BTW, thanks for all the help so far. It’s been very much appreciated.

You’ll see the error below. So, just to test this out, I installed liblastfm1 via apt. Then I got ANOTHER shared library error (libqjson). These libs are in the YAML under stage-packages:

So, I am in doubt about needing anymore libs (I can be wrong).

Here’s a sample of what I’m facing:

clementine: error while loading shared libraries: liblastfm.so.1: cannot open shared object file: No such file or directory

Do you have the right liblastfm in your stage-packages ?

ogra@anubis:~$ apt-cache search liblastfm
...
liblastfm1 - Last.fm web services library (Qt4 build)
liblastfm5-1 - Last.fm web services library (Qt5 build)
...
ogra@anubis:~$

So, last night I discovered a terrible truth…

The snap is NOT including ANY libs at all. So, that’s where I’m at with this, learning how to include all the libs IN the snap. I can’t seem to find anything that can spell it out for a newb.

The snapcraft.yaml as in your git repository of a few minutes ago builds correctly including all the required libs. I haven’t tried running the snap yet, but all the libs look to be included properly.

Edit: It looks like you’re trying to call $SNAP/bin/clementine but that file is at $SNAP/bin/bin/clementine

Yeah I got that fixed, thanks! But now, as you’ll see I’ve got a new problem…a good one IMO.

As requested by @popey, I have included the output (and a video demonstrating the snap actually starting up and “running”) but with a segmentation fault in --devmode

(clementine:25730): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed
21:07:14.159 ERROR logging:56                       g_object_set: assertion 'G_IS_OBJECT (object)' failed 
Segmentation fault (core dumped)

Here’s a link to my YouTube video: https://youtu.be/UDw9wVsbR4U?t=6m47s

Thanks. Can you please post your latest yaml and we can take a look.

After adding gstreamer1.0-plugins-bad to support my m4a audio and compiling the snap from the yaml in your github it worked fine for me

name: clementine-snap # check to see if it's available
version: '1.3.1.22' # check the version number of clementine's packages
summary: Clementine is a modern music player. # 79 char long summary
description: |
  Clementine is a modern music player and library organizer for Windows, Linux and Mac OS X.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs

apps:
  clementine:
    command: desktop-launch $SNAP/bin/clementine 
    desktop: share/applications/clementine.desktop
    plugs:
      - network
      - home
      - pulseaudio
      - unity7
      - x11
      - gsettings
      - optical-drive
      - removable-media
      - screen-inhibit-control
      - alsa
  
parts:
  my-part:
    # See 'snapcraft plugins'
    build-packages:

       [liblastfm-dev,libtag1-dev,gettext,libboost-dev,libboost-serialization-dev,libqt4-dev,qt4-dev-tools,libqt4-opengl-dev,cmake,libgstreamer1.0-dev,libgstreamer-plugins-base1.0-dev,libglew1.5-dev,libqjson-dev,libgpod-dev,libplist-dev,libusbmuxd-dev,libmtp-dev,libcdio-dev,protobuf-compiler,libprotobuf-dev,libcrypto++-dev,libfftw3-dev,libsparsehash-dev,libsqlite3-dev,libpulse-dev,libqtwebkit-dev,libechonest-dev,libchromaprint-dev,libqca2-dev]
  
    stage-packages: 
      - libc6
      - libcdio13
      - libchromaprint0
      - libcrypto++9v5
      - libechonest2.3
      - libfftw3-double3
      - libgcc1 
      - libgl1-mesa-glx
      - libgl1
      - libglew1.13
      - libglib2.0-0
      - libgpod4
      - libgstreamer-plugins-base1.0-0
      - libgstreamer1.0-0
      - liblastfm1
      - libmtp9
      - libprotobuf9v5
      - libpulse0
      - libqjson0
      - libqt4-dbus
      - libqt4-network
      - libqt4-opengl
      - libqt4-sql
      - libqtcore4
      - libqtgui4
      - libsqlite3-0
      - libstdc++6
      - libtag1v5
      - libx11-6
      - zlib1g
      - gstreamer1.0-plugins-base
      - gstreamer1.0-plugins-good
      - gstreamer1.0-plugins-ugly
      - gstreamer1.0-plugins-bad 
      - gstreamer1.0-pulseaudio
      - libprojectm2v5
      - projectm-data

    source-type: git
    source: https://github.com/clementine-player/Clementine
    after: [desktop-qt4] 
    plugin: cmake

As you can see, I’ve added the suggested package to staging (thanks @lucyllewy). I’m building now and will post results.

Yep! It’s working fine in --devmode .

I’m building v23 now and will upload it to the --edge channel.

Thanks all of you for your help! I think this is nearing a finished product.

Please consider renaming the snap to “clementine” and not “clementine-snap”. There’s no real reason to add the -snap now you can register official names.

1 Like

I would, but it’s been reserved by someone else.

EDIT: I have requested the name anyway. I don’t know if it’s going to work.

BTW, I accidentally replied to the wrong thread. I’ve provided a link to that thread’s comments as they are relevant here.

THREAD: Review of build-packages vs stage-packages for mumble snap

This is the current YAML:

name: clementine-snap # check to see if it's available
version: '1.3.1.25' # check the version number of clementine's packages
summary: Clementine is a modern music player. # 79 char long summary
description: |
  Clementine is a modern music player and library organizer for Windows, Linux and Mac OS X.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs

apps:
  clementine:
    command: desktop-launch $SNAP/bin/clementine 
    desktop: share/applications/clementine.desktop
    plugs:
      - network
      - network-bind
      - home
      - pulseaudio
      - unity7
      - x11
      - gsettings
      - optical-drive
      - removable-media
      - screen-inhibit-control
      - alsa
      - raw-usb
  
parts:
  my-part:
    # See 'snapcraft plugins'
    build-packages:

       [liblastfm-dev,libtag1-dev,gettext,libboost-dev,libboost-serialization-dev,libqt4-dev,qt4-dev-tools,libqt4-opengl-dev,cmake,libgstreamer1.0-dev,libgstreamer-plugins-base1.0-dev,libglew1.5-dev,libqjson-dev,libgpod-dev,libplist-dev,libusbmuxd-dev,libmtp-dev,libcdio-dev,protobuf-compiler,libprotobuf-dev,libcrypto++-dev,libfftw3-dev,libsparsehash-dev,libsqlite3-dev,libpulse-dev,libqtwebkit-dev,libechonest-dev,libchromaprint-dev,libqca2-dev]
  
    stage-packages: 
      - libc6
      - libcdio13
      - libchromaprint0
      - libcrypto++9v5
      - libechonest2.3
      - libfftw3-double3
      - libgcc1 
      - libgl1-mesa-glx
      - libgl1
      - libglew1.13
      - libglib2.0-0
      - libgpod4
      - libgstreamer-plugins-base1.0-0
      - libgstreamer1.0-0
      - liblastfm1
      - libmtp9
      - libprotobuf9v5
      - libpulse0
      - libqjson0
      - libqt4-dbus
      - libqt4-network
      - libqt4-opengl
      - libqt4-sql
      - libqtcore4
      - libqtgui4
      - libsqlite3-0
      - libstdc++6
      - libtag1v5
      - libx11-6
      - zlib1g
      - gstreamer1.0-plugins-base
      - gstreamer1.0-plugins-good
      - gstreamer1.0-plugins-ugly
      - gstreamer1.0-plugins-bad 
      - gstreamer1.0-pulseaudio
      - libprojectm2v5
      - projectm-data

    source-type: git
    source: https://github.com/clementine-player/Clementine
    after: [desktop-qt4] 
    plugin: cmake

Thank you very much

The player is running fine !!!

A lot of work !!!

1 Like

For anyone interested in the final outcome and how this was resolved, you may have to infer from your reading here.

For reference, what I’ve learned in the process of building this snap, was that you really have to “build it and see” as @popey once mentioned in another place.

As you may gather, the last piece of the puzzle was one stage-package (gstreamer1.0-plugins-bad).

Just in case it may help you, please see my current/ongoing yaml on Github: