buzz/snap/snapcraft.yaml
2023-10-28 18:32:31 +01:00

226 lines
6.3 KiB
YAML

name: buzz
base: core22
version: git
summary: Buzz, offline audio transcription and translation
website: https://buzzcaptions.com
source-code: https://github.com/chidiwilliams/buzz
issues: https://github.com/chidiwilliams/buzz/issues
description: |
Buzz transcribes and translates audio to text offline using OpenAI's Whisper.
Import audio and video files into Buzz and export them as TXT, SRT, or VTT files.
Buzz supports Whisper, Whisper.cpp, Faster Whisper, Whisper-compatible models
from the Hugging Face repository, and the OpenAI Whisper API.
grade: stable
confinement: strict
license: MIT
icon: buzz/assets/buzz.svg
architectures:
- build-on: amd64
parts:
desktop-qt5:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: [ "FLAVOR=qt5" ]
build-packages:
- qtbase5-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- fonts-ubuntu
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- locales-all
- libglib2.0-0
override-prime: |
craftctl default
glib-compile-schemas usr/share/glib-2.0/schemas
platform-modules:
plugin: nil
stage-packages:
- appmenu-gtk3-module
- libcanberra-gtk3-module
qt5-gtk-platform:
plugin: nil
stage-packages:
- qt5-gtk-platformtheme
alsa-pulseaudio:
plugin: dump
source: .
override-pull: |
mkdir etc -p
cat > etc/asound.conf <<EOF
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}
}
ctl.!default {
type pulse
fallback "sysdefault"
}
EOF
buzz:
plugin: python
source: .
build-packages:
- execstack
stage-packages:
- ffmpeg
- libportaudio2
- libpulse0
- libasound2
- libasound2-plugins
override-build: |
craftctl default
cp $CRAFT_PART_BUILD/libwhisper.so $CRAFT_PART_INSTALL/
cp $CRAFT_PART_BUILD/libwhisper.so $CRAFT_PART_INSTALL/usr/lib/
cp $CRAFT_PART_BUILD/whisper_cpp $CRAFT_PART_INSTALL/
mkdir $CRAFT_PART_INSTALL/buzz && cp $CRAFT_PART_BUILD/buzz/whisper_cpp.py $CRAFT_PART_INSTALL/buzz/
# execstack --clear-execstack $CRAFT_PART_INSTALL/lib/python3.10/site-packages/ctranslate2.libs/libctranslate2-7e7a7741.so.3.15.1
execstack --clear-execstack $CRAFT_PART_INSTALL/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-310-x86_64-linux-gnu.so
# execstack --clear-execstack $CRAFT_PART_INSTALL/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so
python-packages:
- aiohttp==3.8.4
- aiosignal==1.3.1
- appdirs==1.4.4
- async-timeout==4.0.2
- attrs==23.1.0
- av==10.0.0
- certifi==2023.5.7
- cffi==1.15.1
- charset-normalizer==3.1.0
- colorama==0.4.6
- coloredlogs==15.0.1
- cryptography==41.0.1
- ctranslate2==3.15.1
- dataclasses-json==0.5.9
- faster-whisper==0.4.1
- ffmpeg-python==0.2.0
- filelock==3.12.1
- flatbuffers==23.5.26
- frozenlist==1.3.3
- fsspec==2023.6.0
- future==0.18.3
- huggingface-hub==0.15.1
- humanfriendly==10.0
- humanize==4.6.0
- idna==3.4
- importlib-metadata==6.6.0
- jaraco-classes==3.2.3
- jeepney==0.8.0
- keyring==23.13.1
- marshmallow-enum==1.5.1
- marshmallow==3.19.0
- more-itertools==9.1.0
- mpmath==1.3.0
- multidict==6.0.4
- mypy-extensions==1.0.0
- numpy==1.24.3
- onnxruntime==1.14.1
- openai-whisper==20230124
- openai==0.27.8
- packaging==23.1
- platformdirs==3.5.3
- protobuf==4.23.2
- pycparser==2.21
- pyqt6-qt6==6.4.1
- pyqt6-sip==13.4.0
- pyqt6==6.4.0
- pyreadline3==3.4.1
- pywin32-ctypes==0.2.0
- pyyaml==6.0
- regex==2023.6.3
- requests==2.31.0
- secretstorage==3.3.3
- six==1.16.0
- sounddevice==0.4.6
- stable-ts==1.0.2
- sympy==1.12
- tokenizers==0.13.3
- torch==1.12.1
- tqdm==4.65.0
- transformers==4.24.0
- typing-extensions==4.6.3
- typing-inspect==0.9.0
- urllib3==2.0.3
- whisper==1.1.10
- yarl==1.9.2
- zipp==3.15.0
after: [ desktop-qt5 ]
desktop-file:
plugin: dump
source: .
organize:
buzz.desktop: usr/share/applications/buzz.desktop
apps:
buzz:
command: bin/desktop-launch python $SNAP/main.py
desktop: usr/share/applications/buzz.desktop
environment:
PATH: $SNAP/usr/bin:$SNAP/bin:$PATH
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP:$LD_LIBRARY_PATH
PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$SNAP/usr/lib/python3.10/site-packages:$SNAP/usr/local/lib/python3.10/dist-packages:$SNAP/usr/lib/python3.10/dist-packages:$PYTHONPATH
# Fallback to XWayland if running in a Wayland session.
DISABLE_WAYLAND: 1
# Use GTK3 cursor theme, icon theme and open/save file dialogs.
QT_QPA_PLATFORMTHEME: gtk3
ALSA_CONFIG_PATH: $SNAP/etc/asound.conf
XDG_CONFIG_DIRS: $SNAP/etc/xdg:$XDG_CONFIG_DIRS
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS
plugs:
- x11
- unity7
- home
- network
- network-bind
- desktop
- desktop-legacy
- gsettings
- opengl
- removable-media
- pulseaudio
- audio-playback
- audio-record
- password-manager-service
plugs:
gtk-2-engines:
interface: content
target: $SNAP/lib/gtk-2.0
default-provider: gtk2-common-themes
gtk-3-themes:
interface: content
target: $SNAP/share/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/share/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/share/sounds
default-provider: gtk-common-themes
layout:
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib