I am packaging snap for an app, which use the nuitka compiler. So, I setup my snapcraft.yaml
file for that app. But the nuitka compiler isn’t working as expected. Everytime I’m getting an error mentioned below.
snapcraft.yaml
name: monophony # 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: strict # 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
parts:
nuitka:
plugin: python
source: https://github.com/Nuitka/Nuitka.git
source-tag: 1.4.8
source-type: git
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
python-packages:
- requests
- PyGObject
- ytmusicapi
ffmpeg:
after: [nuitka]
# 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
monophony:
# See 'snapcraft plugins'
after:
- ffmpeg
- nuitka
plugin: make
source: https://gitlab.com/zehkira/monophony.git
source-tag: v$SNAPCRAFT_PROJECT_VERSION
source-subdir: source
source-type: git
build-packages:
- libgstreamer1.0-dev
- gstreamer1.0-libav
- gstreamer1.0-plugins-good
stage-packages:
- gstreamer1.0-libav
- gstreamer1.0-plugins-good
- yt-dlp
override-pull: |
craftctl default
sed 's|python3 -m nuitka bin/monophony.py --remove-output --clean-cache=all --follow-import-to=monophony -o /usr/bin/monophony|nuitka bin/monophony.py --remove-output --clean-cache=all --follow-import-to=monophony -o /usr/bin/monophony|' -i source/Makefile
apps:
monophony:
command: usr/bin/monophony
desktop: usr/share/applications/io.gitlab.zehkira.Monophony.desktop
extensions: [gnome]
plugs:
- home
slots:
- mpris
And the error I’m getting is
2023-02-23 13:11:21.877 :: 2023-02-23 07:40:58.466 :: + make -j16
2023-02-23 13:11:21.877 :: 2023-02-23 07:40:58.473 :: mkdir -p /usr/bin/
2023-02-23 13:11:21.877 :: 2023-02-23 07:40:58.476 :: python3 -m nuitka bin/monophony.py --remove-output --clean-cache=all --follow-import-to=monophony -o /usr/bin/monophony
2023-02-23 13:11:21.877 :: 2023-02-23 07:40:58.645 :: /snap/gnome-42-2204-sdk/current/usr/bin/python3: No module named nuitka
2023-02-23 13:11:21.877 :: 2023-02-23 07:40:58.652 :: make: *** [Makefile:11: install] Error
Can anyone please help me?