diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-04-05 21:25:35 +0200 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-04-06 00:46:50 +0200 |
| commit | 100fcf7bdf7a5e711475e6173f28ca6d407483bd (patch) | |
| tree | aa63de7116b06755a9b531d3d0ac8ddbbea1e349 /Makefile | |
| parent | d9245d341ed1f258a3dd1073cdfa656115c5b26d (diff) | |
Move rest of Makefile and scripts to the justfile
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index d3be667..0000000 --- a/Makefile +++ /dev/null @@ -1,204 +0,0 @@ -profile := dev -target = $(shell rustc -vV | grep host | awk '{print $$2}') -channel := unstable - -# Config: Directories & Locations ############################################## -# Cargo outputs dev profile to 'debug' directory, not 'dev' -prefix := /usr/local -ifeq ($(profile),dev) -output_dir := debug -else -output_dir := $(profile) -endif -flatpak_cargo_generator := $(HOME)/projects/vendor/flatpak-builder-tools/cargo - -# Config: Packaging Config ##################################################### -linuxdeploy_url := https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(shell uname -m).AppImage -linuxdeploy := .cache/linuxdeploy.AppImage -pkgver := $(shell grep '^pkgver=' build-aux/arch/PKGBUILD | cut -d= -f2) -pkgrel := $(shell grep '^pkgrel=' build-aux/arch/PKGBUILD | cut -d= -f2) - -# Filename format: map-aarch64-unstable.flatpak or map-aarch64-unstable-fedora43.rpm -filename = $(app_name)-$(arch)-$(channel) - -# Config: Naming ############################################################### -arch = $(firstword $(subst -, ,$(target))) -app_name := map - -# Config: Container Images ##################################################### -fedora_versions := fedora43 fedora44 fedora-rawhide -debian_versions := trixie forky -all_containers := arch $(fedora_versions) $(debian_versions) -container_image_prefix := map-build -clean_images := 0 - -# Config: Release Location ##################################################### -deploy_host := deploy@build.r.bdr.sh -deploy_path := /srv/http/build.r.bdr.sh/$(app_name)-linux - -define sign_and_deploy - @./scripts/sign.sh "$(1)" "$(channel)" "$(arch)" - rsync -avz $(1) $(deploy_host):$(deploy_path) - rsync -avz $(1).minisig $(deploy_host):$(deploy_path) -endef - -# Container Images ############################################################# - -build-container-%: -ifeq ($(clean_images),1) - podman system prune -af -endif - @echo "=== Building container image: $(container_image_prefix):$* ===" - podman build -t $(container_image_prefix):$* build-containers/$* - -build-containers: $(addprefix build-container-,$(all_containers)) - -# Packaging #################################################################### - - -# Generic packages -# These run directly on the host machine, since the assumption is that it -# shouldn't affect the outcome. - -update_flatpak_dependencies: - cd $(flatpak_cargo_generator) && `poetry env activate` && python3 flatpak-cargo-generator.py $(CURDIR)/Cargo.lock -o $(CURDIR)/build-aux/flatpak/cargo-sources.json && deactivate - -package-flatpak: update_flatpak_dependencies - flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/flatpak/systems.tranquil.Map.yml - flatpak build-bundle repo dist/$(filename).flatpak systems.tranquil.Map - -$(linuxdeploy): - @mkdir -p .cache - curl -L -o $(linuxdeploy) $(linuxdeploy_url) - chmod +x $(linuxdeploy) - -package-appimage: $(linuxdeploy) -ifeq ($(findstring linux,$(target)),linux) - $(MAKE) build-container-trixie - @echo "=== Building AppImage ===" - ./scripts/build_appimage.sh $(container_image_prefix) trixie $(app_name) $(arch) $(channel) $(linuxdeploy) -ifeq ($(clean_images),1) - podman rmi $(container_image_prefix):trixie -endif -endif - -# Distro-specific packages -# These run inside containers, as we want to make sure they're built with the -# libraries available in that particular distribution. - -package-arch: build-container-arch - @echo "=== Building Arch package for $(arch) ===" - ./scripts/build_arch.sh $(container_image_prefix) arch $(app_name) $(arch) $(channel) -ifeq ($(clean_images),1) - podman rmi $(container_image_prefix):arch -endif - -package-rpm: -ifndef distro - $(error distro is required, e.g., make package-rpm distro=fedora43) -endif - $(MAKE) build-container-$(distro) - @echo "=== Building RPM for $(distro) ($(arch)) ===" - ./scripts/build_rpm.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel) -ifeq ($(clean_images),1) - podman rmi $(container_image_prefix):$(distro) -endif - -package-deb: -ifndef distro - $(error distro is required, e.g., make package-deb distro=trixie) -endif - $(MAKE) build-container-$(distro) - @echo "=== Building DEB for $(distro) ($(arch)) ===" - ./scripts/build_deb.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel) -ifeq ($(clean_images),1) - podman rmi $(container_image_prefix):$(distro) -endif - -package-rpm-all: - @for v in $(fedora_versions); do \ - $(MAKE) distro=$$v package-rpm; \ - done - -package-deb-all: - @for v in $(debian_versions); do \ - $(MAKE) distro=$$v package-deb; \ - done - -package: package-tar package-flatpak package-appimage package-arch package-rpm-all package-deb-all - -# Distribution ################################################################# - -distribute-flatpak: - @$(call sign_and_deploy,$(filename).flatpak) - -distribute-appimage: - @$(call sign_and_deploy,$(filename).AppImage) - -distribute-pacman: - @$(call sign_and_deploy,$(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz) - -distribute-rpm: - @for v in $(fedora_versions); do \ - ./scripts/sign.sh "$(filename)-$$v.rpm" "$(channel)" "$(arch)" && \ - rsync -avz $(filename)-$$v.rpm $(deploy_host):$(deploy_path) && \ - rsync -avz $(filename)-$$v.rpm.minisig $(deploy_host):$(deploy_path); \ - done - -distribute-deb: - @for v in $(debian_versions); do \ - ./scripts/sign.sh "$(filename)-$$v.deb" "$(channel)" "$(arch)" && \ - rsync -avz $(filename)-$$v.deb $(deploy_host):$(deploy_path) && \ - rsync -avz $(filename)-$$v.deb.minisig $(deploy_host):$(deploy_path); \ - done - -distribute: distribute-tar distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb - -# Release ###################################################################### - -release: - $(MAKE) profile=release package distribute - -# Installation ################################################################# - -install: build - install -Dm0755 target/$(target)/$(output_dir)/$(app_name) $(prefix)/bin/$(app_name) - install -Dm0644 resources/logo.svg $(prefix)/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg - install -Dm0644 resources/systems.tranquil.Map.desktop $(prefix)/share/applications/systems.tranquil.Map.desktop - install -Dm0644 resources/systems.tranquil.Map.metainfo.xml $(prefix)/share/metainfo/systems.tranquil.Map.metainfo.xml - install -Dm0644 resources/systems.tranquil.Map.service $(prefix)/share/dbus-1/services/systems.tranquil.Map.service - install -Dm0644 resources/wmap.lang $(prefix)/share/gtksourceview-5/language-specs/wmap.lang - @for po_file in po/*.po; do \ - locale=$$(basename "$$po_file" .po); \ - install -Dm0644 po/$$locale/LC_MESSAGES/systems.tranquil.Map.mo $(prefix)/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \ - done - -uninstall: - rm -f $(prefix)/bin/$(app_name) - rm -f $(prefix)/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg - rm -f $(prefix)/share/applications/systems.tranquil.Map.desktop - rm -f $(prefix)/share/metainfo/systems.tranquil.Map.metainfo.xml - rm -f $(prefix)/share/dbus-1/services/systems.tranquil.Map.service - rm -f $(prefix)/share/gtksourceview-5/language-specs/wmap.lang - @for po_file in po/*.po; do \ - locale=$$(basename "$$po_file" .po); \ - rm -f $(prefix)/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \ - done - -ci: lint -ifeq ($(GIT_REF),refs/heads/main) - $(MAKE) -e channel=unstable release -else ifneq (,$(findstring refs/tags/,$(GIT_REF))) - $(MAKE) -e channel=$(subst refs/tags/,,$(GIT_REF)) release -else - @echo "Not in CI environment." -endif - -.PHONY: default \ - update_flatpak_dependencies \ - package-flatpak package-appimage \ - package-arch package-rpm package-deb \ - package-rpm-all package-deb-all package \ - distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb distribute \ - release install uninstall \ - build-containers |