Linux: build an Arch package (.pkg.tar.zst)

package.sh now also builds designcraft-<ver>-linux-<arch>.pkg.tar.zst with nfpm's archlinux packager,
from the same nfpm.yaml. It is named by the bundle id (ai.storyteller.designcraft), provides designcraft and
conflicts with designcraft, designcraft-bin and designcraft-git, so an AUR helper doesn't take it over and ArtCraft
Launcher can tell it from an AUR build. The README lists it with the other Linux downloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ujo4eva
2026-10-14 13:54:12 +01:00
co-authored by Claude Opus 5.5
parent 43a46c04bf
commit 6cacf4e8b7
3 changed files with 35 additions and 7 deletions
+1
View File
@@ -222,6 +222,7 @@ Installers and executables are code-signed.
| Flatpak | `designcraft-<ver>-linux-x86_64.flatpak` | `designcraft-<ver>-linux-aarch64.flatpak` | Sandboxed; `flatpak install --user <file>` |
| Debian/Ubuntu | `designcraft-<ver>-linux-x86_64.deb` | `designcraft-<ver>-linux-aarch64.deb` | |
| Fedora/RHEL/openSUSE | `designcraft-<ver>-linux-x86_64.rpm` | `designcraft-<ver>-linux-aarch64.rpm` | |
| Arch Linux/Manjaro | `designcraft-<ver>-linux-x86_64.pkg.tar.zst` | `designcraft-<ver>-linux-aarch64.pkg.tar.zst` | `sudo pacman -U <file>`; installs as `ai.storyteller.designcraft`, replacing an AUR package |
| Tarball | `designcraft-<ver>-linux-x86_64.tar.gz` | `designcraft-<ver>-linux-aarch64.tar.gz` | Unpack anywhere |
RISC-V (riscv64): `designcraft-<ver>-linux-riscv64.tar.gz` only, cross-compiled; needs glibc 2.39+ (Ubuntu 24.04 or newer).
+19 -1
View File
@@ -1,4 +1,4 @@
# .deb and .rpm packages (nfpm: https://nfpm.goreleaser.com). Run by package.sh, which stages
# .deb/.rpm/Arch packages (nfpm: https://nfpm.goreleaser.com). Run by package.sh, which stages
# the file tree, substitutes its path for ${STAGE} (nfpm doesn't expand env vars in `src`) and
# exports VERSION and NFPM_ARCH.
#
@@ -53,6 +53,24 @@ overrides:
- libXrandr
- mesa-vulkan-drivers
- xdg-desktop-portal
# Named ai.storyteller.designcraft, not designcraft: the AUR already has designcraft, designcraft-bin and
# designcraft-git, and an AUR helper treats any installed package with an AUR name as its own and
# rebuilds it on the next update. ArtCraft Launcher also uses the bundle id to tell this package
# (which it updates with `pacman -U`) from an AUR build (which it leaves to the AUR helper).
# nfpm has no optdepends for Arch, so the recommends above have no equivalent here.
archlinux:
depends:
- glibc
- gcc-libs
- hicolor-icon-theme
- libxkbcommon
- vulkan-icd-loader
provides:
- designcraft
conflicts:
- designcraft
- designcraft-bin
- designcraft-git
contents:
- src: ${STAGE}/usr/bin/designcraft
+15 -6
View File
@@ -5,11 +5,12 @@
# $DIST/designcraft-<version>-linux-<arch>.AppImage.zsync delta updates (needs zsyncmake)
# $DIST/designcraft-<version>-linux-<arch>.deb Debian, Ubuntu, Mint, Pop!_OS, ...
# $DIST/designcraft-<version>-linux-<arch>.rpm Fedora, openSUSE, RHEL, ...
# $DIST/designcraft-<version>-linux-<arch>.pkg.tar.zst Arch, Manjaro, EndeavourOS, ...
# $DIST/designcraft-<version>-linux-<arch>.tar.gz plain FHS-style tree (bin/, share/)
#
# Usage: packaging/linux/package.sh [--skip-build] [--formats "appimage deb rpm tar"]
# Usage: packaging/linux/package.sh [--skip-build] [--formats "appimage deb rpm arch tar"]
#
# Needs: cargo; nfpm for deb/rpm (https://nfpm.goreleaser.com); appimagetool for the AppImage
# Needs: cargo; nfpm for deb/rpm/arch (https://nfpm.goreleaser.com); appimagetool for the AppImage
# (downloaded into $CARGO_TARGET_DIR if missing). Build on an old distro (CI: Ubuntu 22.04,
# glibc 2.35) so the binaries run on newer ones. Optional: desktop-file-validate, appstreamcli,
# zsyncmake (the zsync package) for the AppImage's .zsync.
@@ -20,12 +21,12 @@ HERE="$ROOT/packaging/linux"
APP_ID=ai.storyteller.designcraft
SKIP_BUILD=0
FORMATS="appimage deb rpm tar"
FORMATS="appimage deb rpm arch tar"
while [ $# -gt 0 ]; do
case "$1" in
--skip-build) SKIP_BUILD=1; shift ;;
--formats) FORMATS="$2"; shift 2 ;;
-h | --help) sed -n '2,15p' "$0"; exit 0 ;;
-h | --help) sed -n '2,16p' "$0"; exit 0 ;;
*) echo "unknown argument: $1" >&2; exit 2 ;;
esac
done
@@ -85,8 +86,8 @@ if has tar; then
echo "wrote $DIST/$BASENAME.tar.gz"
fi
# ---- .deb / .rpm --------------------------------------------------------------------------------
if has deb || has rpm; then
# ---- .deb / .rpm / .pkg.tar.zst -----------------------------------------------------------------
if has deb || has rpm || has arch; then
command -v nfpm >/dev/null || { echo "error: nfpm not found (https://nfpm.goreleaser.com/install/)" >&2; exit 1; }
export VERSION
export NFPM_ARCH="$DEB_ARCH"
@@ -95,6 +96,14 @@ if has deb || has rpm; then
for fmt in deb rpm; do
if has "$fmt"; then (cd "$ROOT" && nfpm package -f "$WORK/nfpm.yaml" -p "$fmt" -t "$DIST/$BASENAME.$fmt"); fi
done
# The Arch package is named by the bundle id (see `archlinux` in nfpm.yaml), which nfpm can't
# override per format, and `archlinux.packager` isn't env-expanded, so both are written here.
if has arch; then
sed "s|^name: designcraft\$|name: $APP_ID|" "$WORK/nfpm.yaml" >"$WORK/nfpm-arch.yaml"
grep -qx "name: $APP_ID" "$WORK/nfpm-arch.yaml" || { echo "error: couldn't rename the Arch package" >&2; exit 1; }
printf 'archlinux:\n packager: "%s"\n' "$DESIGNCRAFT_MAINTAINER" >>"$WORK/nfpm-arch.yaml"
(cd "$ROOT" && nfpm package -f "$WORK/nfpm-arch.yaml" -p archlinux -t "$DIST/$BASENAME.pkg.tar.zst")
fi
fi
# ---- AppImage -----------------------------------------------------------------------------------