1
0
mirror of https://gitlab.com/openlp/packaging.git synced 2024-12-22 04:52:50 +00:00
packaging/flatpak/build.sh

33 lines
1.5 KiB
Bash
Raw Normal View History

2024-08-26 21:00:24 +00:00
#!/bin/bash
OPENLP_VERSION=3.1.3
OPENLP_PACK_REVISION=1
BUNDLE_VERSION=${OPENLP_VERSION}-${OPENLP_PACK_REVISION}
# checkout the flathub shared-modules, needed for the VLC build
git submodule update --init --recursive
# 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, install for the user and into a repo in the repo-folder
mkdir repo
flatpak-builder --user --install --force-clean --repo=repo openlp-flatpak-builddir org.openlp.OpenLP.yml
# create flatpak bundle file
echo "Bundle into a flatpak file, this can take a while..."
flatpak build-bundle repo openlp-${BUNDLE_VERSION}.flatpak org.openlp.OpenLP