I have tried a lot with this flutter based app, named snap. But I have still facing several issues with it.
This is the current snapcraft.yaml
file
name: saber # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '0.9.3' # just for humans, typically '1.2+git' or '1.3.2'
summary: A cross-platform libre handwritten notes app # 79 char long summary
description: |
A cross-platform libre handwritten notes app, available for Android, iOS, Linux, Windows, and the web!
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
license: GPL-3.0+
architectures:
- build-on: amd64
layout:
$SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0::
symlink: $SNAP/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
slots:
saber-svc:
interface: dbus
bus: session
name: com.adilhanney.saber
parts:
desktop:
source: .
plugin: dump
after:
- flutter-git
- saber
flutter-git:
source: https://github.com/flutter/flutter.git
source-tag: 3.7.0
plugin: nil
override-build: |
set -eux
mkdir -p $CRAFT_PART_INSTALL/usr/bin
mkdir -p $CRAFT_PART_INSTALL/usr/libexec
cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter
ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter
export PATH="$CRAFT_PART_INSTALL/usr/bin:$PATH"
flutter doctor
build-packages:
- clang
- cmake
- curl
- ninja-build
- unzip
override-prime: ''
saber:
# See 'snapcraft plugins'
after:
- flutter-git
plugin: nil
source: https://github.com/adil192/saber.git
source-tag: v${SNAPCRAFT_PROJECT_VERSION}
build-packages:
- libsecret-1-dev
- libjsoncpp-dev
- zenity
stage-packages:
- libjsoncpp25
- libsecret-1-0
- zenity
- libpango-1.0-0
override-build: |
set -eux
flutter pub get || true
flutter build linux --release -v
mkdir -p $CRAFT_PART_INSTALL/bin
cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/
mkdir -p $CRAFT_PART_INSTALL/gnome-platform/usr/lib/x86_64-linux-gnu/
ln -sf /snap/saber/current/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.5000.6 $CRAFT_PART_INSTALL/gnome-platform/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
cleanup:
after: # Make this part run last; list all your other parts here
- saber
- flutter-git
- desktop
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- core22
- gnome-42-2204
- gnome-42-2204-sdk
override-prime: |
set -eux
for snap in "core22" "gnome-42-2204" "gnome-42-2204-sdk"; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done
apps:
saber:
command: bin/saber
extensions: [gnome]
common-id: com.adilhanney.saber
desktop: snap/local/saber.desktop
environment:
HOME: $SNAP_REAL_HOME
plugs:
- home
- network
slots:
- saber-svc
But whenever I run this, I get
/snap/saber/19/bin/saber: symbol lookup error: /snap/saber/19/gnome-platform/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_ot_layout_get_horizontal_baseline_tag_for_script
If I use the flutter extension
the theming will not work perfectly, there will be cursor icon issues & the maximize and minimize button would have gone. Can anyone please help me?
Hello anyone please help with this. I am getting this error in two more snaps. Kindly help @ogra @alexmurray @tigarmo
These are those snaps
snapcraft.yaml for metadata-cleaner
name: metadata-cleaner # you probably want to 'snapcraft register ’
base: core22 # the base snap is the execution environment for this snap
version: ‘2.4.0’ # just for humans, typically ‘1.2+git’ or ‘1.3.2’
summary: View and clean metadata in files # 79 char long summary
description: |
Metadata within a file can tell a lot about you. Cameras record data about when and where a picture was taken and which camera was used. Office applications automatically add author and company information to documents and spreadsheets. This is sensitive information and you may not want to disclose it. This tool allows you to view metadata in your files and to get rid of it, as much as possible.
license: GPL-3.0+
architectures:
grade: stable # must be ‘stable’ to release into candidate/stable channels
confinement: strict # use ‘strict’ once you have the right plugs and slots
compression: lzo
layout:
/usr/lib:
bind: $SNAP/usr/lib
/usr/share/locale:
bind: $SNAP/usr/share/locale
/usr/share/metadata-cleaner:
bind: $SNAP/usr/share/metadata-cleaner
environment:
WORKAROUND: Add python modules in Snap to search path
PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
parts:
mutagen:
after: [ffmpeg]
plugin: python
source: https://github.com/quodlibet/mutagen.git
source-tag: release-1.46.0
source-type: git
python-packages:
- mat2
- importlib-metadata
- importlib-resources
- PyGObject
build-packages:
- gir1.2-poppler-0.18
- gir1.2-gdkpixbuf-2.0
- libimage-exiftool-perl
stage-packages:
- libimage-exiftool-perl
- gir1.2-gdkpixbuf-2.0
- gir1.2-poppler-0.18
ffmpeg:
# WORKAROUND:
# Build from source because the ffmpeg package installs libraries as dependencies
# that conflict with the Gnome extension
plugin: autotools
source: https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz
source-checksum: sha256/619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc
autotools-configure-parameters:
# WORKAROUND: Install to /usr instead of /usr/local because it’s not in search paths
- --prefix=/usr
- --disable-debug
- --disable-doc
- --disable-static
- --enable-gpl
- --enable-shared
- --disable-ffplay
- --disable-devices
- --enable-gnutls
- --enable-libmp3lame
- --enable-libvorbis
build-packages:
- nasm
- libgnutls28-dev
- libmp3lame-dev
- libvorbis-dev
stage-packages:
- libmp3lame0
stage:
- -usr/include
metadata-cleaner:
# See ‘snapcraft plugins’
plugin: meson
after:
- ffmpeg
source: https://gitlab.com/rmnvgr/metadata-cleaner.git
source-tag: v${SNAPCRAFT_PROJECT_VERSION}
meson-parameters:
- --prefix=/usr
build-environment:
# WORKAROUND: The python plugin is broken with gnome extension
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
- PYTHONPATH: “”
stage-packages:
- perl
- libpoppler118
- libpoppler-glib8
- libpng-tools
- python3-gi-cairo
- gir1.2-poppler-0.18
- gir1.2-gdkpixbuf-2.0
- gir1.2-rsvg-2.0
- libimage-exiftool-perl
override-pull: |
craftctl default
sed -e ‘s|Icon=fr.romainvigier.MetadataCleaner|Icon=usr/share/icons/hicolor/scalable/apps/fr.romainvigier.MetadataCleaner.svg|g’ -i application/data/fr.romainvigier.MetadataCleaner.desktop.in
override-stage: |
craftctl default
#sed -e ‘s|/usr/share/locale|/snap/metadata-cleaner/current/usr/share/locale|g’ -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#sed -e ‘s|/usr/share/metadata-cleaner/data|/snap/metadata-cleaner/current/usr/share/metadata-cleaner/data|g’ -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#sed -e ‘s|/usr/share/metadata-cleaner/src|/snap/metadata-cleaner/current/usr/share/metadata-cleaner/src|g’ -i $SNAPCRAFT_STAGE/usr/bin/metadata-cleaner
#mkdir -p gnome-platform/usr/lib/x86_64-linux-gnu/
#ln -sf /snap/metadata-cleaner/current/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0.5000.6 $CRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
cleanup:
after: # Make this part run last; list all your other parts here
- metadata-cleaner
- ffmpeg
plugin: nil
build-snaps: # List all content-snaps and base snaps you’re using here
- gnome-42-2204
- core22
override-prime: |
set -eux
for snap in “core22” “gnome-42-2204” “gnome-42-2204-sdk”; do # List all content-snaps and base snaps you’re using here
cd “/snap/$snap/current” && find . -type f,l -exec rm -f “$SNAPCRAFT_PRIME/{}” ;
done
apps:
metadata-cleaner:
command: usr/bin/metadata-cleaner
desktop: usr/share/applications/fr.romainvigier.MetadataCleaner.desktop
extensions: [gnome]
plugs:
- home
common-id: fr.romainvigier.MetadataCleaner
snapcraft.yaml for audio-sharing
name: audio-sharing # you probably want to 'snapcraft register ’
base: core22 # the base snap is the execution environment for this snap
version: ‘0.2.1’ # just for humans, typically ‘1.2+git’ or ‘1.3.2’
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap’s description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: strict # use ‘strict’ once you have the right plugs and slots
slots:
dbus-svc:
interface: dbus
bus: session
name: de.haeckerfelix.AudioSharing
parts:
rust:
plugin: nil
build-snaps:
- rustup
override-build: |
rustup install stable
audio-sharing:
# See ‘snapcraft plugins’
after: [rust]
plugin: meson
source: https://gitlab.gnome.org/World/AudioSharing.git
source-type: git
source-tag: 0.2.1
meson-parameters:
- --prefix=/usr
build-packages:
- libelf-dev
- elfutils
- libgstreamer1.0-dev
stage-packages:
- libgstreamer1.0-0
- libgstrtspserver-1.0-dev
- libfreetype-dev
- elfutils
- libelf1
- libwebpmux3
override-prime: |
craftctl default
sed -e ‘s|Icon=de.haeckerfelix.AudioSharing|Icon=/usr/share/icons/hicolor/scalable/apps/de.haeckerfelix.AudioSharing|’ -i usr/share/applications/de.haeckerfelix.AudioSharing.desktop
cleanup:
after: # Make this part run last; list all your other parts here
- audio-sharing
- rust
plugin: nil
build-snaps: # List all content-snaps and base snaps you’re using here
- gnome-42-2204
- core22
override-prime: |
set -eux
for snap in “gnome-42-2204” “core22”; do
cd “/snap/$snap/current” && find . -type f,l -exec rm -f “$SNAPCRAFT_PRIME/{}” ;
done
find $CRAFT_PRIME/usr/share/doc/ -type f -not -name ‘copyright’ -delete
apps:
audio-sharing:
command: usr/bin/audio-sharing
desktop: usr/share/applications/de.haeckerfelix.AudioSharing.desktop
common-id: de.haeckerfelix.AudioSharing
extensions: [gnome]
plugs:
- home
- network
- network-bind
- mount-observe
- network-manager
slots:
- dbus-svc