feat/release-page #2
1 changed files with 12 additions and 6 deletions
Makefile: direct -aarm64 + DEB_HOST_ARCH env, bypass dpkg-architecture
Some checks failed
Forgejo Release postit-deb / release (push) Has been cancelled
Some checks failed
Forgejo Release postit-deb / release (push) Has been cancelled
The 'dpkg-architecture -c' approach is meant for proper cross builds, but dpkg-architecture refuses to set up the env when the CC system type doesn't match the target. For arm64 cross builds that means CC=aarch64-linux-gnu-gcc is required. We don't have that — we cross-publish .NET binaries with `dotnet publish --runtime linux-arm64`, no C compilation. So skip dpkg-architecture entirely: - DPKG_HOST = 'arm64' or 'amd64' from a small case (no shell substitution issues, single line) - DEB_HOST_ARCH, DEB_BUILD_ARCH, DEB_HOST_GNU_TYPE, DEB_BUILD_GNU_TYPE set in env directly - -a$DPKG_HOST passed to dpkg-buildpackage, which now builds and names the .deb for the target arch dpkg-buildpackage doesn't actually need arm64 tools if the rules don't use them: dh_strip is disabled (cross-strip issues with ARM64 .so), and dh_shlibdeps works with the multi-arch arm64 libs we install in the runner.
commit
da8400dc4e
18
Makefile
18
Makefile
|
|
@ -54,12 +54,18 @@ deb:
|
||||||
# vars set by dpkg-architecture are visible to dpkg-buildpackage.
|
# vars set by dpkg-architecture are visible to dpkg-buildpackage.
|
||||||
# make runs each recipe line in its own shell, so we use
|
# make runs each recipe line in its own shell, so we use
|
||||||
# backslash continuation to glue everything together.
|
# backslash continuation to glue everything together.
|
||||||
# dpkg-architecture -c <cmd> sets up DEB_* vars and runs <cmd>
|
# Direct cross-build: tell dpkg-buildpackage -aarm64 to build
|
||||||
# in the same shell, so the env is visible to dpkg-buildpackage.
|
# for arm64, and set DEB_HOST_ARCH=arm64 (and friends) in the
|
||||||
# Use -a (host arch) for cross-builds — it tells dpkg-architecture
|
# env so debhelper rules see it. dpkg-architecture -aarm64 is
|
||||||
# to export DEB_HOST_ARCH=arm64 (and friends) even though we're
|
# NOT used because it refuses to set up the env when the CC
|
||||||
# running on amd64. -c avoids the need for a separate eval.
|
# system type doesn't match (we don't have an arm64 C
|
||||||
DPKG_ARCH_ARGS=$$(case "$(POSTIT_RUNTIME)" in linux-arm64) echo "-aarm64" ;; linux-x64) echo "-aamd64" ;; *) echo "unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; esac); dpkg-architecture $$DPKG_ARCH_ARGS -c "POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b"
|
# compiler — we cross-publish .NET binaries only).
|
||||||
|
case "$(POSTIT_RUNTIME)" in
|
||||||
|
linux-arm64) DPKG_HOST=arm64 ;;
|
||||||
|
linux-x64) DPKG_HOST=amd64 ;;
|
||||||
|
*) echo " ERROR: unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
DEB_HOST_ARCH=$$DPKG_HOST DEB_BUILD_ARCH=amd64 DEB_HOST_GNU_TYPE=aarch64-linux-gnu DEB_BUILD_GNU_TYPE=x86_64-linux-gnu POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b -a$$DPKG_HOST
|
||||||
# dpkg-buildpackage already writes the produced .deb to
|
# dpkg-buildpackage already writes the produced .deb to
|
||||||
# /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no
|
# /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no
|
||||||
# flag to change it). So no 'mv' is needed. The old 'mv'
|
# flag to change it). So no 'mv' is needed. The old 'mv'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue