Merge branch 'flatpak' into 'master'

Draft: Support for flatpak packaging

See merge request openlp/packaging!26
This commit is contained in:
Tomas Groth 2024-02-19 16:19:32 +00:00
commit 749b46b71a
3 changed files with 84 additions and 0 deletions

20
flatpak/build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# build PyMuPdf dependency file
PYMUPDF_VER=1.23.22
PY_TARGET=311
# first get the req2flatpak tool if not already present. Alternatively get req2flatpak from https://pypi.org/project/req2flatpak/
if [ ! -f "req2flatpak.py" ]; then
curl -O https://raw.githubusercontent.com/johannesjh/req2flatpak/main/req2flatpak.py
fi
python3 req2flatpak.py --requirements pymupdf==${PYMUPDF_VER} pymupdfb==${PYMUPDF_VER} --target-platforms ${PY_TARGET}-x86_64 ${PY_TARGET}-aarch64 --outfile python3-pymupdf.yaml
# build the openlp dependency file - remember to update requirements.txt if needed. Certain devel packages might be needed.
# first get the flatpak-pip-generator tool if not already present
if [ ! -f "flatpak-pip-generator" ]; then
curl -O https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/pip/flatpak-pip-generator
fi
python flatpak-pip-generator --requirements-file requirements.txt
# Finally do the build
flatpak-builder --user --install --force-clean openlp-flatpak-builddir org.openlp.OpenLP.yml

View File

@ -0,0 +1,33 @@
app-id: org.openlp.OpenLP
runtime: org.kde.Platform
runtime-version: '5.15-23.08'
sdk: org.kde.Sdk
base: com.riverbankcomputing.PyQt.BaseApp
base-version: '5.15-23.08'
command: 'openlp'
cleanup-commands:
- /app/cleanup-BaseApp.sh
modules:
- name: OpenLP
finish-args:
- --socket=x11
- --share=ipc
- --device=dri
- --share=network
- --socket=pulseaudio
- --env=QTWEBENGINEPROCESS_PATH=/app/bin/QtWebEngineProcess
- --filesystem=host
modules:
- python3-pymupdf.yaml
- python3-requirements.json
- name: OpenLP
buildsystem: simple
build-commands:
- pip install --no-deps --no-build-isolation --prefix=$FLATPAK_DEST .
- mkdir -p /app/share/applications && cp resources/openlp.desktop /app/share/applications/org.openlp.OpenLP.desktop && sed -ie s/Icon=openlp/Icon=org.openlp.OpenLP/ /app/share/applications/org.openlp.OpenLP.desktop
- mkdir -p /app/share/icons/hicolor/256x256/apps/ && cp resources/images/openlp-logo-256x256.png /app/share/icons/hicolor/256x256/apps/org.openlp.OpenLP.png
- mkdir -p /app/share/icons/hicolor/scalable/apps/ && cp resources/images/openlp-logo.svg /app/share/icons/hicolor/scalable/apps/org.openlp.OpenLP.svg
sources:
- type: archive
url: https://gitlab.com/openlp/openlp/-/archive/e5e8bc4164513ff4858b125c5efc2c157d758ea5/openlp-e5e8bc4164513ff4858b125c5efc2c157d758ea5.tar.gz
sha256: 5de48fb834cd831216ceb97f43846517cf427a85254236057ba20127288c2284

31
flatpak/requirements.txt Normal file
View File

@ -0,0 +1,31 @@
# Note:
# PyQt* packages is missing due to being included in the base flatpak image
# PyMuPDF is installed seperately due to some dependency issues
# dbus-python and psycopg2 install didn't work...
alembic
beautifulsoup4
chardet
#dbus-python
distro
flask
flask-cors
lxml
Mako
platformdirs
PyICU
pymediainfo
QtAwesome
qrcode
requests
SQLAlchemy
waitress
websockets
#PyMuPDF
QDarkStyle
#PyMySQL
python-vlc
#psycopg2
pyenchant
pysword
pytest
pytest-runner