Hi, I am new to building snaps, and I would like to some help this.
I am overriding the build in the yaml file with the following scriptlet.
fix-fontconfig:
plugin: nil
override-build: |
mkdir $SNAPCRAFT_PART_INSTALL/bin
echo "[[ -e \$SNAP_USER_COMMON/Config.ini ]] || cp \$SNAP/bin/Config.ini \$SNAP_USER_COMMON/Config.ini" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "[[ -e \$SNAP_USER_COMMON/Config.productspec ]] || cp \$SNAP/bin/Config.productspec \$SNAP_USER_COMMON/Config.productspec" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "mkdir \$SNAP_USER_DATA/.config" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "mkdir \$SNAP_USER_DATA/.config/fontconfig" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "cp \$SNAP/etc/fonts/fonts.conf \$SNAP_USER_DATA/.config/fontconfig/fonts.conf" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "sed -i \"s#<dir>/usr#<dir>\$SNAP/usr#g\" \$SNAP_USER_DATA/.config/fontconfig/fonts.conf" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "cd \$SNAP/bin" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
echo "./PanelApp -p $SNAP_USER_COMMON/Config.productspec" >> $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
chmod +x $SNAPCRAFT_PART_INSTALL/bin/start_bms.sh
When the snap is installed and I inspect the start_bms.sh script, I find that the $SNAP_USER_COMMON translated to /root/snap/snapcraft/common, instead of /home/<user_dir>/snap/<snap_name>/common.
What I would like is that $SNAP_USER_COMMON translate to /home/<user_dir>/snap/<snap_name>/common during the execution of the override-build.
How do I do that?
Any help would be appreciated, thanks in advance.