I am building a core22 image on an Ubuntu 24.04.4 LTS OS with --use-lxd from a prebuilt directory created with cmake with my video player. The player uses RtAudio which can run with alsa, pulseaudio or jack.
The snapcraft build succeeds. However, upon running I get an alsa-lib error when loading plugins (audio, however does work):
ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_ctl_pipewire.so (/snap/mrv2/x1/bin/../usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_pipewire.so: cannot open shared object file: No such file or directory)
Here’s my basic snapcraft.yaml.in:
name: mrv2
version: '@VERSION@'
summary: Professional review tool for the VFX, animation and CGI industries.
description: |
mrv2 is an open-source professional review tool for the VFX, animation and CGI industries.
It supports many image and video formats, OpenColorIO 2, native OpenTimelineIO
timelines, a full featured Python API and OpenUSD OpenGL previews.
base: core22
grade: stable
confinement: classic # strict, classic or devmode
apps:
mrv2:
command: bin/mrv2.sh
environment:
LIBGL_ALWAYS_SOFTWARE: 0
plugs:
- alsa
- audio-playback
- desktop
- desktop-legacy
- home
- network
- network-bind
- opengl
- pulseaudio
- wayland
- x11
parts:
mrv2:
plugin: dump
source: @PACKAGE_NAME@
build-attributes:
- enable-patchelf
stage-packages:
- libasound2
- libasound2-plugins
- libegl1
- libfontconfig1
- libgl1
- libglu1-mesa
- libharfbuzz0b # b at end is fine
- libopengl0
- libpulse0
- libx11-6
- libx11-xcb1
- libxcb1
- libxcb-render0
- libxcb-shm0
- libxcomposite1
- libxcursor1
- libxdamage1
- libxext6
- libxft2
- libxfixes3
- libxi6
- libxinerama1
- libxrandr2
- libxrender1
- libxss1
- libxt6
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
The problem seems to be that:
$ apt-file find /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_pipewire.so pipewire-alsa: /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_ctl_pipewire.so
is not staged. However, when I try to add it to the stage-packages, the package is not found.
Here’s a simple Makefile that I use to download the package and build it:
VERSION := $(shell wget -q "https://api.github.com/repos/ggarra13/mrv2/releases/latest" -O - | grep tag_name | cut -d'"' -f4 | sed 's|^v||')
INSTALL := mrv2-v$(VERSION)-Linux-amd64/usr/local/mrv2-v$(VERSION)-Linux-64
FILENAME := mrv2-v$(VERSION)-Linux-amd64.tar.gz
URL := https://github.com/ggarra13/mrv2/releases/download/v$(VERSION)/$(FILENAME)
ARCH := amd64
PACKAGE := ./$(INSTALL)
all: snap
.PHONY: all snap
snap: desktop
sed "s#@VERSION@#$(VERSION)#g ; \
s#@ARCH@#$(ARCH)#g ; \
s#@PACKAGE_NAME@#$(PACKAGE)#" \
snapcraft.yaml.in > snap/snapcraft.yaml
# We will get a number of unused libraries that are loaded on demand
# with dlopen or python's imports.
snapcraft --debug --use-lxd
desktop: untar
mkdir -p snap/gui
cp -f $(INSTALL)/share/applications/mrv2.desktop snap/gui
cp -f $(INSTALL)/share/icons/hicolor/48x48/apps/mrv2.png snap/gui
sed -i "s#Exec=.*#Exec=mrv2# ; s#Icon=.*#Icon=mrv2.png#" snap/gui/mrv2.desktop
# Removed incorrect line in the .tar.gz desktop file.
sed -i "s#Categories=Graphics##" snap/gui/mrv2.desktop
download: clean
curl -C - -L $(URL) --output $(FILENAME)
untar: download
ifneq ($(wildcard $(INSTALL)), $(INSTALL))
tar xfv $(FILENAME)
endif
# Some incorrect libraries bundled
rm -f $(INSTALL)/lib/libndi*5*
rm -f $(INSTALL)/lib/libtinfo*
mrv2-$(VERSION)_$(ARCH).snap: snap
echo "Built snap"
install: mrv2-$(VERSION)_$(ARCH).snap
sudo SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=7 snap install ./mrv2_$(VERSION)_$(ARCH).snap --dangerous --classic
uninstall:
sudo snap remove mrv2
distclean: clean
rm -rf mrv2-*-Linux*
rm -f compile.log
clean:
rm -f mrv2_$(VERSION)_$(ARCH).snap
rm -rf snap/