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.
106 lines
3.5 KiB
Makefile
Executable file
106 lines
3.5 KiB
Makefile
Executable file
#!/usr/bin/make -f
|
|
#
|
|
# Debian package build for PostIt (Yavsc desktop client).
|
|
#
|
|
# Pipeline:
|
|
# 1. Clone pazof/yavsc at POSTIT_GIT_TAG into a clean working
|
|
# tree under build/yavsc-src.
|
|
# 2. dotnet publish src/PostIt/PostIt.Desktop — framework-
|
|
# dependent (not self-contained), into build/postit-app.
|
|
# 3. Render the icon at the hicolor sizes from
|
|
# src/PostIt/PostIt/Assets/Icon.png, plus the SVG as the
|
|
# scalable form.
|
|
# 4. Stage everything under debian/tmp/ — the layout dh_install
|
|
# expects:
|
|
# /usr/lib/postit/ (managed assemblies)
|
|
# /usr/bin/postit (wrapper script)
|
|
# /usr/share/applications/ (postit.desktop)
|
|
# /usr/share/icons/hicolor/ (icons)
|
|
# 5. dh_install moves it all into debian/postit/ and the rest
|
|
# of the dh_* helpers assemble the .deb.
|
|
|
|
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
|
|
POSTIT_TMP := $(CURDIR)/debian/tmp
|
|
POSTIT_TMP_LIB := $(POSTIT_TMP)/usr/lib/postit
|
|
POSTIT_TMP_BIN := $(POSTIT_TMP)/usr/bin
|
|
POSTIT_TMP_SHARE := $(POSTIT_TMP)/usr/share
|
|
|
|
ICON_SIZES := 16 32 48 64 128 256
|
|
|
|
%:
|
|
dh $@
|
|
|
|
override_dh_auto_clean:
|
|
rm -rf $(POSTIT_BUILD_DIR) $(POSTIT_TMP)
|
|
|
|
override_dh_auto_build:
|
|
# 1. Fetch the upstream source.
|
|
mkdir -p $(POSTIT_BUILD_DIR)
|
|
if [ -d $(POSTIT_SRC_DIR) ]; then \
|
|
git -C $(POSTIT_SRC_DIR) fetch --depth=1 origin $(POSTIT_GIT_TAG); \
|
|
git -C $(POSTIT_SRC_DIR) reset --hard $(POSTIT_GIT_TAG); \
|
|
else \
|
|
git clone --depth=1 --branch $(POSTIT_GIT_TAG) \
|
|
$(POSTIT_GIT_URL) $(POSTIT_SRC_DIR); \
|
|
fi
|
|
|
|
# 2. Publish PostIt.Desktop for the host architecture.
|
|
# --self-contained false : rely on the system .NET
|
|
# runtime (declared in Depends: in debian/control).
|
|
# -p:PublishReadyToRun=false : avoid R2R which inflates
|
|
# the binary for marginal startup gain on a desktop GUI.
|
|
dotnet publish $(POSTIT_SRC_DIR)/$(POSTIT_DESKTOP_PROJECT) \
|
|
-c Release \
|
|
--self-contained false \
|
|
--runtime $(POSTIT_RUNTIME) \
|
|
-p:PublishReadyToRun=false \
|
|
-o $(POSTIT_BUILD_DIR)/postit-app
|
|
|
|
|
|
override_dh_auto_test:
|
|
# No upstream test suite for PostIt.Desktop at this stage
|
|
# (Yavsc.Org.Tests covers the web front, not the desktop
|
|
# client). Build smoke is sufficient for the package.
|
|
|
|
override_dh_shlibdeps:
|
|
dh_shlibdeps
|
|
|
|
override_dh_strip:
|
|
dh_strip --exclude=.pdb
|
|
|
|
|
|
define stage_postit
|
|
mkdir -p $(POSTIT_TMP_LIB)
|
|
cp -r $(POSTIT_BUILD_DIR)/postit-app/. $(POSTIT_TMP_LIB)/
|
|
|
|
mkdir -p $(POSTIT_TMP_BIN)
|
|
cp $(CURDIR)/debian/postit.wrapper $(POSTIT_TMP_BIN)/postit
|
|
chmod 0755 $(POSTIT_TMP_BIN)/postit
|
|
|
|
mkdir -p $(POSTIT_TMP_SHARE)/applications
|
|
cp $(CURDIR)/debian/postit.desktop \
|
|
$(POSTIT_TMP_SHARE)/applications/postit.desktop
|
|
|
|
mkdir -p $(POSTIT_TMP_SHARE)/icons/hicolor/scalable/apps
|
|
cp $(POSTIT_SRC_DIR)/src/PostIt/PostIt/Assets/yavsc-logo.svg \
|
|
$(POSTIT_TMP_SHARE)/icons/hicolor/scalable/apps/postit.svg
|
|
|
|
for size in $(ICON_SIZES); do \
|
|
mkdir -p $(POSTIT_TMP_SHARE)/icons/hicolor/$${size}x$${size}/apps; \
|
|
convert $(POSTIT_SRC_DIR)/src/PostIt/PostIt/Assets/Icon.png \
|
|
-resize $${size}x$${size} \
|
|
$(POSTIT_TMP_SHARE)/icons/hicolor/$${size}x$${size}/apps/postit.png; \
|
|
done
|
|
endef
|
|
|
|
override_dh_install:
|
|
$(call stage_postit)
|
|
dh_install
|