From 90b12c34debaa4aa816d4e6862cdb4e39c7181e4 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Fri, 16 Jan 2026 15:42:23 +0100 Subject: Add flatpak building Add flatpak --- Makefile | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ae184c7..f179087 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu app_name := map deploy_host := deploy@build.r.bdr.sh deploy_path := /srv/http/build.r.bdr.sh/$(app_name) +install_path := /usr/local/bin/$(app_name) define sign_and_deploy @./scripts/sign.sh "$(1)" "$(channel)" "$(architecture)" @@ -17,11 +18,18 @@ set_rust: rustup default stable prepare: +ifneq ($(skip_prepare),1) rustup target add $(target) +endif + +# Build ######################################################################## build: prepare + @$(eval target_dir := ./target/$(target)/$(profile)/map) cargo build --profile $(profile) --target $(target) +# Code Quality ################################################################# + test: cargo test @@ -34,15 +42,15 @@ format: lint: cargo fmt -- --check && cargo clippy +# Packaging #################################################################### + +package: $(architectures) + release: rpm tar deb @$(eval filename := $(app_name)-$(target)-$(channel)) -$(architectures): -ifneq ($(channel),) - $(MAKE) -e channel=$(channel) -e target=$@ release -else - $(MAKE) -e target=$@ build -endif +flatpak: + @flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/systems.tranquil.Map.yml deb: build ifeq ($(findstring linux,$(target)),linux) @@ -65,15 +73,12 @@ tar: build tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name) @$(call sign_and_deploy,$(filename).tar.gz) -package: $(architectures) +# Distribution ################################################################# -mac: - @$(eval mac_architectures := x86_64-apple-darwin aarch64-apple-darwin) -ifeq ($(tag),) - $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=unstable package -else - $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package -endif +install: build + @cp target/$(target)/$(profile)/ $(install_path) + +# CI ########################################################################### ci: lint coverage ifeq ($(GIT_REF),refs/heads/main) @@ -82,4 +87,12 @@ else ifneq (,$(findstring refs/tags/,$(GIT_REF))) $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package endif -.PHONY: default build $(architectures) rpm package prepare set_rust ci release test coverage format +$(architectures): +ifneq ($(channel),) + $(MAKE) -e channel=$(channel) -e target=$@ release +else + $(MAKE) -e target=$@ build +endif + + +.PHONY: default build $(architectures) rpm package prepare set_rust ci release test coverage format flatpak -- cgit