Missing library libudev.so.0

When using strict confinement, how do I add the old libudev.so.0 dependency? I am already using the oldest core18 but Ubuntu moved on to libudev.so.1.

This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:

  • libudev.so.0
1 Like

It looks like this is not packaged for Ubuntu 18.04 (and hence base: core18 snaps) however I see there is a package which you may be able to build from source as a separate part which wraps libudev.so.1 to provide this - https://github.com/archlinux/libudev0-shim

https://packages.ubuntu.com/hirsute/libudev0 21.04 seems to package it.

that does not help … if you pick base: core18 packages from 18.04 are available to your build environment.

if you pick base: core20 you can use packages from 20.04 …

the next base will be core22 to be released some time in april or shortly after, there you will be able to use the library you linked to (since it will likely be available in 22.04)…

if you need any libs or binaries outside of that scope you need to build them from source with their own snapcraft.yaml part, ship them pre-built in your project dir or find another way to supply them as binaries (though note that they need to link against the libc shipped in the base you picked in case you pick to ship them in pre-compiled binary form)

libudev0:
  plugin: make
  artifacts:
    - libudev.so.0.0.9999 # TODO
  source: https://github.com/archlinux/libudev0-shim/archive/refs/tags/v1.tar.gz
  source-type: tar
  build-packages:
    - libudev-dev

builds it, but I am not sure how to rename and install it properly.

out of interest i played a little with your snapcaft.yaml from above during my lunch break today … here is a git diff that gets you some usable themeing (it also makes the snap a proper strict snap since there is no way you will ever get classic granted for such an app):

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 8e55c58..d8fff82 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -1,5 +1,5 @@
 name: openchrom
-base: core18
+base: core20
 
 version: '1.4.0.202112230244'
 summary: Visualization and Analysis of mass spectrometric and chromatographic data.
@@ -8,24 +8,42 @@ description:
   mass spectrometric and chromatographic data developed by Lablicate GmbH.
 
 grade: stable
-confinement: classic
+confinement: strict
 
 architectures:
   - build-on: amd64
 
 apps:
   openchrom:
+    extensions: [gnome-3-38]
     command: bin/openchrom-wrapper
+    environment:
+      GTK2_RC_FILES: $SNAP/usr/share/themes/Yaru/gtk-2.0/gtkrc
+      GTK_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0
+    plugs:
+      - home
+      - mount-observe
+      - network
+      - network-bind
+      - raw-usb
 
 parts:
   openchrom:
     plugin: dump
     source: https://products.lablicate.com/openchrom/1.4.x/openchrom-lablicate_linux.x86_64_1.4.x.tar.gz
-    source-checksum: "sha256/e5e7cb90763f0f45f0545fb9b0ec472e4989214a7ebead2f136d759f029eac37"
-    build-attributes:
-      - no-patchelf
+    source-checksum: "sha256/d72b271ef6eab7f61ed6d68b9db3677c862d9f319cdc549561379c31551ba906"
+    override-build: |
+      snapcraftctl build
+      sed -i 's;^-Xmx2g;-Xmx2g\n-Duser.home=@user.home/snap/openchrom/current;' $SNAPCRAFT_PART_INSTALL/openchrom.ini
+    stage-packages:
+      - libusb-1.0-0
   wrappers:
     plugin: dump
     source: snap/local/wrappers
     organize:
       openchrom: bin/openchrom-wrapper
+  gtk-2:
+    plugin: nil
+    stage-packages:
+      - yaru-theme-gtk
+      - libgtk2.0-0

just save it to a file and use git apply to apply that patch …

i’d also suggest to use the proper upstream source to get libudev and not some other distros (archlinux) source …

(btw, the app opens and seems to run fine without libudev0 here, at least for the demo chromatogram it offers)

Oh wow you solved the theming issue. I was about to give up. Thanks!