From 28303435ccb06dc082af97567aed79c5c2766879 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 28 Jun 2026 00:51:14 +0100 Subject: [PATCH] debian+makefile: expose POSTIT_RUNTIME override for arm64 builds Default stays linux-x64 (the only architecture built today). Override on the command line to target arm64 (or any other RID supported by Avalonia 12 on Linux): make deb POSTIT_RUNTIME=linux-arm64 The Makefile passes POSTIT_RUNTIME through to dpkg-buildpackage, which propagates it to debian/rules, which threads it into dotnet publish --runtime. Note: the .deb is mono-architecture. For a multi-arch .deb, the build must run twice (once per RID) and the resulting .debs can be combined with dpkg-gencontrol / Multi-Arch: same. Update README accordingly. --- Makefile | 10 ++++++---- README.md | 15 ++++++++++++++- debian/rules | 6 +++++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 87b934d..55a5366 100644 --- a/Makefile +++ b/Makefile @@ -11,18 +11,20 @@ # debugging the publish step. # # Environment overrides (or pass on the make command line): -# POSTIT_GIT_URL default: https://github.com/pazof/yavsc.git -# POSTIT_GIT_TAG default: 1.0.0 -# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here) +# POSTIT_GIT_URL default: https://github.com/pazof/yavsc.git +# POSTIT_GIT_TAG default: 1.0.0 +# POSTIT_RUNTIME default: linux-x64 (override to linux-arm64 etc.) +# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here) POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git POSTIT_GIT_TAG ?= 1.0.0 +POSTIT_RUNTIME ?= linux-x64 POSTIT_OUT_DIR ?= $(CURDIR)/.. .PHONY: deb clean source deb: - POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) \ + POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) \ dpkg-buildpackage -us -uc -b mv ../postit_*$(POSTIT_GIT_TAG)*.deb $(POSTIT_OUT_DIR)/ 2>/dev/null || \ mv ../postit_*.deb $(POSTIT_OUT_DIR)/ || true diff --git a/README.md b/README.md index 1658f33..8c4360c 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,22 @@ sudo apt -f install # résout les dépendances manquantes Pour installer sur **arm64** : ```bash -make clean && make deb # sur une machine arm64, le .deb sera _arm64.deb +# Sur une machine arm64 : +make clean && make deb # le .deb sera _arm64.deb ``` +Le `debian/rules` publie avec `--runtime linux-x64` pour +amd64. Pour produire un .deb arm64, override : + +```bash +make deb POSTIT_RUNTIME=linux-arm64 +``` + +(le paramètre est exposé par `debian/rules` ; bump à ajouter si +besoin). À noter : **un seul runtime par build** — le `--runtime` +exclut les autres plateformes, donc le .deb est portable mais +mono-architecture. + ## Vérification Après installation : diff --git a/debian/rules b/debian/rules index 0dceff9..0232fe1 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,10 @@ POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git POSTIT_GIT_TAG ?= 1.0.0 +# Runtime identifier passed to `dotnet publish --runtime`. Override +# at build time for non-amd64 targets: +# make deb POSTIT_RUNTIME=linux-arm64 +POSTIT_RUNTIME ?= linux-x64 POSTIT_DESKTOP_PROJECT := src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj POSTIT_BUILD_DIR := $(CURDIR)/build POSTIT_SRC_DIR := $(POSTIT_BUILD_DIR)/yavsc-src @@ -56,7 +60,7 @@ override_dh_auto_build: dotnet publish $(POSTIT_SRC_DIR)/$(POSTIT_DESKTOP_PROJECT) \ -c Release \ --self-contained false \ - --runtime linux-x64 \ + --runtime $(POSTIT_RUNTIME) \ -p:PublishReadyToRun=false \ -o $(POSTIT_BUILD_DIR)/postit-app