fix: snapcraft build (#656)

This commit is contained in:
Chidi Williams 2024-01-03 21:54:39 +00:00 committed by GitHub
parent c758a25a41
commit 5456774d96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 786 additions and 810 deletions

View file

@ -7,4 +7,4 @@ omit =
directory = coverage/html
[report]
fail_under = 73
fail_under = 75

View file

@ -24,7 +24,12 @@ jobs:
- uses: snapcore/action-build@v1
id: snapcraft
- run: |
sudo snap install --devmode *.snap
sudo apt-get update
sudo apt-get install libportaudio2
- run: sudo snap install --devmode *.snap
- run: |
cd $HOME
xvfb-run buzz --version
- uses: actions/upload-artifact@v3
with:
name: snap

1486
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@ keyring = "^23.13.1"
openai-whisper = "v20231106"
platformdirs = "^3.5.3"
dataclasses-json = "^0.5.9"
ffmpeg-python = "^0.2.0"
ffmpeg-python = "0.2.0"
[tool.poetry.group.dev.dependencies]
autopep8 = "^1.7.0"
@ -50,7 +50,6 @@ requires = ["poetry-core", "ctypesgen", "setuptools", "cmake"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.build]
generate-setup-file = true
script = "build.py"
[tool.poetry.scripts]

View file

@ -79,90 +79,34 @@ parts:
plugin: python
source: .
build-packages:
- execstack
- portaudio19-dev
- python3-poetry
stage-packages:
# Audio
- ffmpeg
- libportaudio2
- libpulse0
- libasound2
- libasound2-plugins
- libyaml-dev
- libegl1-mesa
# Display
- libxkbcommon-x11-0
- libxcb-icccm4
- libxcb-image0
- libxcb-keysyms1
- libxcb-randr0
- libxcb-render-util0
- libxcb-xinerama0
- libxcb-shape0
- libxcb-cursor0
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
pip install .
python build.py
mkdir $CRAFT_PART_INSTALL/buzz
cp $CRAFT_PART_BUILD/buzz/whisper_cpp.py $CRAFT_PART_INSTALL/buzz/
cp $CRAFT_PART_BUILD/buzz/libwhisper.so $CRAFT_PART_INSTALL/buzz/
after: [ desktop-qt5 ]
desktop-file:
@ -173,7 +117,7 @@ parts:
apps:
buzz:
command: bin/desktop-launch python $SNAP/main.py
command: bin/desktop-launch python3 -m buzz
desktop: usr/share/applications/buzz.desktop
environment:
PATH: $SNAP/usr/bin:$SNAP/bin:$PATH