Thank you, I fixed it by using the code below:
name: main
version: '1.0'
summary: streaming app
description: our streaming app
confinement: strict
grade: stable
base: core22
parts:
alsa-mixin:
plugin: nil
source: https://github.com/diddledan/snapcraft-alsa.git
override-pull: |
craftctl default
cat > alsa.conf <<EOF
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}
}
ctl.!default {
type pulse
fallback "sysdefault"
}
EOF
override-build: |
craftctl default
install -m644 -D -t $CRAFT_PART_INSTALL/etc alsa.conf
build-packages:
- libasound2-dev
stage-packages:
- libasound2
- libasound2-plugins
libraries:
plugin: dump
source: lib/tokbox/lib/.
organize:
libopentok.so: lib/libopentok.so
stage-packages:
- libc++1
- libc++abi1
stream:
plugin: cmake
source: .
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/
override-build: |
craftctl default
apt install build-essential libc++-dev libc++abi-dev libuv1-dev libasound2-dev libsdl2-dev -y
apt install libunwind-dev -y
stage-packages:
- libc++1
- libc++abi1
- libunwind8
- libuv1
- libasound2
- libasound2-plugins
- libsdl2-2.0-0
after:
- alsa-mixin
layout:
/usr/lib/$CRAFT_ARCH_TRIPLET/alsa-lib:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/alsa-lib
/usr/share/alsa:
bind: $SNAP/usr/share/alsa
apps:
main:
command: bin/main
plugs:
- alsa
- audio-record
- audio-playback
- camera
- pulseaudio
- network
- network-bind
- network-observe
- network-control
environment:
ALSA_CONFIG_PATH: /snap/$CRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf
It’s core22
so I had to use craftctl default
instead of commands like snapcraftctl build
or snapcraftcl pull
.
Now it builds without any issues.