Page MenuHomePhorge

D362.1788416282.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D362.1788416282.diff

diff --git a/packaging/GNU-Linux/flatpak/Makefile b/packaging/GNU-Linux/flatpak/Makefile
new file mode 100644
--- /dev/null
+++ b/packaging/GNU-Linux/flatpak/Makefile
@@ -0,0 +1,45 @@
+
+all: kazv.flatpak
+.PHONY: clean distclean vodozemac-bindings-update
+
+PYTHON := $(shell which python)
+NJOBS := $(shell nproc)
+FLATHUB_REPO := https://flathub.org/repo/flathub.flatpakrepo
+FLATPAK_CARGO_GENERATOR := https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py
+ifneq ($(GPG_KEY),)
+SIGN_ARGS = --gpg-sign=$(GPG_KEY)
+else
+SIGN_ARGS =
+endif
+
+repo: add-flathub-repo cargo-sources.json
+ flatpak-builder --jobs=$(NJOBS) --user --install-deps-from=flathub --force-clean --ccache --repo=repo $(SIGN_ARGS) flatpak-build moe.kazv.mxc.kazv.yaml
+
+kazv.flatpak: repo
+ flatpak build-bundle repo kazv.flatpak --runtime-repo='$(FLATHUB_REPO)' $(SIGN_ARGS) moe.kazv.mxc.kazv
+
+venv/bin/flatpak-cargo-generator: venv
+ wget -O $@ '$(FLATPAK_CARGO_GENERATOR)'
+ chmod +x $@
+
+venv: $(PYTHON)
+ $(PYTHON) -m venv $@
+ ./venv/bin/pip3 install aiohttp tomlkit
+
+add-flathub-repo:
+ flatpak remote-add --user --if-not-exists flathub '$(FLATHUB_REPO)'
+
+vodozemac-bindings:
+ git clone https://lily-is.land/kazv/vodozemac-bindings.git
+
+vodozemac-bindings-update: vodozemac-bindings
+ cd vodozemac-bindings && git pull --rebase
+
+cargo-sources.json: venv/bin/flatpak-cargo-generator vodozemac-bindings-update
+ . ./venv/bin/activate && venv/bin/flatpak-cargo-generator vodozemac-bindings/Cargo.lock -o cargo-sources.json
+
+clean:
+ rm -rf repo kazv.flatpak flatpak-build
+
+distclean: clean
+ rm -rf venv vodozemac-bindings cargo-sources.json
diff --git a/packaging/GNU-Linux/flatpak/README.md b/packaging/GNU-Linux/flatpak/README.md
--- a/packaging/GNU-Linux/flatpak/README.md
+++ b/packaging/GNU-Linux/flatpak/README.md
@@ -1,5 +1,15 @@
# Building flatpak for kazv
+## Automatically
+
+In this directory, run
+
+```
+make NJOBS=<number of jobs>
+```
+
+## Manually
+
All blocks are run from the repository root unless specified.
Setup the environment:

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 2, 11:18 PM (21 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1739580
Default Alt Text
D362.1788416282.diff (2 KB)

Event Timeline