I made some changes in the yaml file and the file is this,
name: frog # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '1.2.0' # 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: devmode # use 'strict' once you have the right plugs and slots
compression: lzo
#environment:
# WORKAROUND: Add python modules in Snap to search path
# PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
layout:
/usr/share/frog:
bind: $SNAP/usr/share/frog
/usr/local/lib/python3.10/dist-packages/frog:
bind: $SNAP/usr/local/lib/python3.10/dist-packages/frog
parts:
meson:
plugin: python
source: https://github.com/mesonbuild/meson.git
source-tag: 1.0.0
build-environment:
# WORKAROUND: The python plugin is broken with gnome extension
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
- PYTHONPATH: ""
stage:
# WORKAROUND: Skip venv from python plugin
- -bin/activate
- -bin/activate.csh
- -bin/activate.fish
- -bin/Activate.ps1
- -bin/python
- -bin/python3
- -bin/python3.10
- -bin/pip
- -bin/pip3
- -bin/pip3.10
- -pyvenv.cfg
frog:
after: [meson]
plugin: meson
source: https://github.com/TenderOwl/Frog.git
source-type: git
source-tag: "1.2.0"
meson-parameters:
- --prefix=/usr
- --buildtype=release
# See 'snapcraft plugins'
build-packages:
- ninja-build
- gettext
- pkg-config
- glibc-source
- libglib2.0-dev
- desktop-file-utils
- appstream
- libappstream-dev
- libglib2.0-bin
- libappstream-glib-dev
- python-is-python3
- python3-gi
- python-gi-dev
- python3-pyzbar
- python3-pydbus
- python3-tesserocr
- tesseract-ocr
- libnotify-dev
- libleptonica-dev
- libgtk-3-dev
stage-packages:
- gettext
- pkg-config
- glibc-source
- libglib2.0-0
- libglib2.0-dev
- desktop-file-utils
- appstream
- libappstream-dev
- libglib2.0-bin
- libappstream-glib-dev
- python-is-python3
- python3-gi
- python-gi-dev
- python3-pyzbar
- python3-pydbus
- python3-tesserocr
- tesseract-ocr
- libnotify-dev
- libleptonica-dev
- libgtk-3-dev
override-pull: |
craftctl default
# WORKAROUND: Point icon directly to SVG otherwise snapcraft can't find it
sed -e 's|Icon=com.github.tenderowl.frog|Icon=/usr/share/icons/hicolor/scalable/apps/com.github.tenderowl.frog.svg|' -i data/com.github.tenderowl.frog.desktop.in
override-build: |
craftctl default
# WORKAROUND: Use python from search path, the path detected by meson doesn't exist when running the Snap
sed -e '1c#!/usr/bin/env python3' -i "${CRAFT_PART_INSTALL}/usr/bin/frog"
parse-info: [/usr/share/appdata/com.github.tenderowl.frog.appdata.xml]
organize:
snap/frog/current/usr: usr
slots:
frog:
interface: dbus
bus: session
name: com.github.tenderowl.frog
plugs:
pictures:
interface: personal-files
write:
- $HOME/Pictures
apps:
frog:
command: usr/bin/frog
common-id: com.github.tenderowl.frog
extensions: [gnome]
desktop: usr/share/applications/com.github.tenderowl.frog.desktop
environment:
PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages
XDG_DATA_HOME: $SNAP_USER_DATA/.local/share
plugs:
- home
- pictures
- network
But still I’m getting some error
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy” has path “/system/proxy/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.http” has path “/system/proxy/http/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.https” has path “/system/proxy/https/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.ftp” has path “/system/proxy/ftp/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Warning: Schema “org.gnome.system.proxy.socks” has path “/system/proxy/socks/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
** (process:21265): WARNING **: 20:53:34.490: Failed to load shared library 'libgtk-4.so.1' referenced by the typelib: /snap/frog/x2/gnome-platform/usr/lib/x86_64-linux-gnu/libgtk-4.so.1: undefined symbol: hb_font_get_var_coords_design
Traceback (most recent call last):
File "/snap/frog/x2/usr/bin/frog", line 59, in <module>
from frog import main
File "/usr/local/lib/python3.10/dist-packages/frog/main.py", line 39, in <module>
from gi.repository import Gtk, Gio, GLib, Notify, Adw, GdkPixbuf
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 632, in _load_backward_compatible
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/importer.py", line 150, in load_module
dynamic_module = load_overrides(introspection_module)
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 118, in load_overrides
override_mod = importlib.import_module(override_package_name)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 111, in <module>
class Widget(Gtk.Widget):
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/module.py", line 168, in __getattr__
interfaces = tuple(interface for interface in get_interfaces_for_object(info)
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/module.py", line 94, in get_interfaces_for_object
interfaces.append(getattr(module, name))
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 32, in __getattr__
return getattr(self._introspection_module, name)
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/module.py", line 207, in __getattr__
wrapper = metaclass(name, bases, dict_)
File "/snap/frog/x2/usr/lib/python3/dist-packages/gi/types.py", line 247, in __init__
register_interface_info(cls.__info__.get_g_type())
TypeError: must be an interface