For a strict confined snap, you won’t be able to update symlinks in /etc
, so update-alternatives won’t help. What you probably want to do is bake the correct symlink into the snap’s squashfs file system so that it isn’t necessary to fix anything up at runtime.
It might be easiest to do this by adding an install:
stanza to your part that creates the appropriate symlink. I haven’t tested it, but the following might do the trick:
install: |
set -ex
for dir in $SNAPCRAFT_PART_INSTALL/usr/lib/*/; do
(cd $dir;
if [ -f blas/libblas.so.3.* ]; then
ln -s blas/libblas.so.3.* libblas.so.3
fi)
done
This could be simplified a bit if you don’t mind your snapcraft.yaml hard coding the architecture in the ln -s
invocation.