diff --git a/README.md b/README.md index c1d0edb..950a6d7 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | `nextcloud-native-bin` | [Obiente/native](https://github.com/Obiente/native) — prebuilt release of `nextcloud-native` | `.deb` | [nextcloud-native-bin](https://aur.archlinux.org/packages/nextcloud-native-bin) | | `nextcloud-native-git` | [Obiente/native](https://github.com/Obiente/native) — `main` branch of `nextcloud-native` | *built from source* | [nextcloud-native-git](https://aur.archlinux.org/packages/nextcloud-native-git) | | `plezy-bin` | [edde746/plezy](https://github.com/edde746/plezy) — Plex, Jellyfin and Emby client (Flutter); the source package [lives in `extra`](https://archlinux.org/packages/extra/x86_64/plezy/) | `.deb` | [plezy-bin](https://aur.archlinux.org/packages/plezy-bin) | +| `schist` | [Infrawrench/schist](https://github.com/Infrawrench/schist): layered image editor with PSD and Affinity support (Rust/gpui, alpha) | *built from source* | [schist](https://aur.archlinux.org/packages/schist) | +| `schist-bin` | [Infrawrench/schist](https://github.com/Infrawrench/schist): prebuilt release of `schist` | `.pkg.tar.zst` | [schist-bin](https://aur.archlinux.org/packages/schist-bin) | | `sharpemu-bin` | [sharpemu/sharpemu](https://github.com/sharpemu/sharpemu) — experimental PlayStation 5 emulator | tarball | [sharpemu-bin](https://aur.archlinux.org/packages/sharpemu-bin) | | `snapx-bin` | [SnapXL/SnapX](https://github.com/SnapXL/SnapX) — ShareX-fork screenshot/sharing tool | self-contained tarball | [snapx-bin](https://aur.archlinux.org/packages/snapx-bin) | | `untix` | [ostfriese4/untis](https://codeberg.org/ostfriese4/untis): "Timetable", a GTK4 + LibAdwaita client for WebUntis. Called `untis` and `timetable` on the AUR before | *built from source* | [untix](https://aur.archlinux.org/packages/untix) | diff --git a/schist-bin/.SRCINFO b/schist-bin/.SRCINFO new file mode 100644 index 0000000..8cb459b --- /dev/null +++ b/schist-bin/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = schist-bin + pkgdesc = Layered image editor with PSD and Affinity support (upstream binary) + pkgver = 0.15.0 + pkgrel = 1 + url = https://github.com/Infrawrench/schist + arch = x86_64 + arch = aarch64 + license = MIT + depends = fontconfig + depends = freetype2 + depends = hicolor-icon-theme + depends = libxcb + depends = libxkbcommon + depends = libxkbcommon-x11 + depends = vulkan-driver + depends = vulkan-icd-loader + depends = wayland + optdepends = libheif>=1.23.4: HEIC import + provides = schist=0.15.0 + conflicts = schist + options = !strip + options = !debug + source_x86_64 = https://github.com/Infrawrench/schist/releases/download/v0.15.0/schist-0.15.0-1-x86_64.pkg.tar.zst + sha256sums_x86_64 = ef4501ecc8109e21d1813fdfc8d618090a9be5bb238545527614a1ff60d983c1 + source_aarch64 = https://github.com/Infrawrench/schist/releases/download/v0.15.0/schist-0.15.0-1-aarch64.pkg.tar.zst + sha256sums_aarch64 = 11e12bd6bc0ee6fb6d27004809750c62a180d64c5eb274a2aac685fdabdeeff1 + +pkgname = schist-bin diff --git a/schist-bin/PKGBUILD b/schist-bin/PKGBUILD new file mode 100644 index 0000000..8432249 --- /dev/null +++ b/schist-bin/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Felitendo +# Contributor: Infrawrench LLC +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=schist-bin +pkgver=0.15.0 +pkgrel=1 +# Upstream's own package release in the asset name, synced by pkg.sh. It only +# moves when upstream repackages a version that has already shipped. +_relver=1 +pkgdesc="Layered image editor with PSD and Affinity support (upstream binary)" +arch=('x86_64' 'aarch64') +url="https://github.com/Infrawrench/schist" +license=('MIT') +# The same list as the source package, checked by pkg.sh against upstream's +# PKGBUILD. Upstream's own schist-bin makes vulkan-driver optional only to +# keep its build container from pulling in nvidia-utils. +depends=('fontconfig' 'freetype2' 'hicolor-icon-theme' 'libxcb' 'libxkbcommon' + 'libxkbcommon-x11' 'vulkan-driver' 'vulkan-icd-loader' 'wayland') +optdepends=('libheif>=1.23.4: HEIC import') +provides=("schist=${pkgver}") +conflicts=('schist') +# upstream strips the debug info itself and keeps the build id for its crash +# reports +options=('!strip' '!debug') +# The release asset is a pacman package built by upstream's CI +# (packaging/linux/packages.sh). makepkg extracts it, only its usr/ is taken. +source_x86_64=("${url}/releases/download/v${pkgver}/schist-${pkgver}-${_relver}-x86_64.pkg.tar.zst") +source_aarch64=("${url}/releases/download/v${pkgver}/schist-${pkgver}-${_relver}-aarch64.pkg.tar.zst") +sha256sums_x86_64=('ef4501ecc8109e21d1813fdfc8d618090a9be5bb238545527614a1ff60d983c1') +sha256sums_aarch64=('11e12bd6bc0ee6fb6d27004809750c62a180d64c5eb274a2aac685fdabdeeff1') + +package() { + cp -a "$srcdir/usr" "$pkgdir/" + mv "$pkgdir/usr/share/licenses/schist" "$pkgdir/usr/share/licenses/$pkgname" +} diff --git a/schist-bin/pkg.sh b/schist-bin/pkg.sh new file mode 100644 index 0000000..7e7fdb6 --- /dev/null +++ b/schist-bin/pkg.sh @@ -0,0 +1,61 @@ +# schist-bin - Schist (https://github.com/Infrawrench/schist), a layered image +# editor in Rust (gpui) with PSD and Affinity support. +# +# Upstream builds the Linux release itself and publishes a .pkg.tar.zst per +# architecture, which the PKGBUILD repackages, as upstream's own +# packaging/linux/aur/schist-bin does. GitHub lists each asset's sha256, so a +# new version needs no download. +# +# The asset name carries upstream's package release +# (schist---.pkg.tar.zst), which is synced into +# _relver. The binary needs the same libraries as the source package, so the +# dependencies are checked against upstream's source PKGBUILD of the same tag: +# a missing one would not break the test build, only the app. + +UPSTREAM_REPO="Infrawrench/schist" + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' +} + +# pkgbuild_array : the words of one array in a PKGBUILD on stdin, sorted +pkgbuild_array() { + awk -v n="$1" '$0 ~ "^" n "=\\(" { f = 1 } f { sub(/#.*/, ""); print } f && /\)/ { exit }' \ + | sed "s/^$1=(//; s/).*//" | tr -s " '\"" '\n' | sed '/^$/d' | sort +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local upstream assets relver arch sha sha_x86_64 sha_aarch64 + + upstream="$(gh api "repos/$UPSTREAM_REPO/contents/packaging/linux/aur/schist/PKGBUILD?ref=v$ver" \ + -H 'Accept: application/vnd.github.raw')" || return 1 + if [[ "$(pkgbuild_array depends <<< "$upstream")" != "$(pkgbuild_array depends < "$pkgbuild")" ]]; then + echo "upstream's depends changed in v$ver, update the PKGBUILD:" >&2 + pkgbuild_array depends <<< "$upstream" >&2 + return 1 + fi + + # " sha256:" per pacman package of the release + assets="$(gh api "repos/$UPSTREAM_REPO/releases/tags/v$ver" \ + --jq '.assets[] | select(.name | endswith(".pkg.tar.zst")) | "\(.name) \(.digest)"')" + relver="$(sed -n "s/^schist-$ver-\([0-9]*\)-x86_64\.pkg\.tar\.zst .*/\1/p" <<< "$assets" \ + | sort -n | tail -n1)" + + for arch in x86_64 aarch64; do + sha="$(awk -v f="schist-$ver-$relver-$arch.pkg.tar.zst" \ + '$1 == f { sub(/^sha256:/, "", $2); print $2 }' <<< "$assets")" + if [[ ! "$sha" =~ ^[0-9a-f]{64}$ ]]; then + echo "v$ver has no schist-$ver-$relver-$arch.pkg.tar.zst with a sha256" >&2 + return 1 + fi + printf -v "sha_$arch" '%s' "$sha" + done + + sed -i \ + -e "s|^_relver=.*|_relver=$relver|" \ + -e "s|^sha256sums_x86_64=.*|sha256sums_x86_64=('$sha_x86_64')|" \ + -e "s|^sha256sums_aarch64=.*|sha256sums_aarch64=('$sha_aarch64')|" \ + "$pkgbuild" +} diff --git a/schist/.SRCINFO b/schist/.SRCINFO new file mode 100644 index 0000000..a0786a4 --- /dev/null +++ b/schist/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = schist + pkgdesc = Layered image editor with PSD and Affinity support + pkgver = 0.15.0 + pkgrel = 1 + url = https://github.com/Infrawrench/schist + arch = x86_64 + arch = aarch64 + license = MIT + makedepends = cargo + makedepends = clang + makedepends = mold + depends = fontconfig + depends = freetype2 + depends = hicolor-icon-theme + depends = libxcb + depends = libxkbcommon + depends = libxkbcommon-x11 + depends = vulkan-driver + depends = vulkan-icd-loader + depends = wayland + optdepends = libheif>=1.23.4: HEIC import + options = !lto + source = schist-0.15.0.tar.gz::https://github.com/Infrawrench/schist/archive/v0.15.0.tar.gz + sha256sums = ff11e4d29c47d6a8fe8736cb7efa6293894211b4f96cf9fca5bca9a0e7bb2585 + +pkgname = schist diff --git a/schist/PKGBUILD b/schist/PKGBUILD new file mode 100644 index 0000000..06380c3 --- /dev/null +++ b/schist/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: Felitendo +# Contributor: Infrawrench LLC +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=schist +pkgver=0.15.0 +pkgrel=1 +pkgdesc="Layered image editor with PSD and Affinity support" +arch=('x86_64' 'aarch64') +url="https://github.com/Infrawrench/schist" +license=('MIT') +# Upstream's own list (packaging/linux/aur/schist), checked by pkg.sh on every +# new version. fontconfig, wayland and the Vulkan loader are dlopen'd. +# vulkan-driver: the loader alone draws nothing. +depends=('fontconfig' 'freetype2' 'hicolor-icon-theme' 'libxcb' 'libxkbcommon' + 'libxkbcommon-x11' 'vulkan-driver' 'vulkan-icd-loader' 'wayland') +# dlopen'd, the app starts without it +optdepends=('libheif>=1.23.4: HEIC import') +# clang + mold: upstream's .cargo/config.toml links with them on x86_64 +makedepends=('cargo' 'clang' 'mold') +# !lto: makepkg's -flto=auto turns ring's C objects into GCC bitcode that the +# clang link cannot read +options=('!lto') +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz") +sha256sums=('ff11e4d29c47d6a8fe8736cb7efa6293894211b4f96cf9fca5bca9a0e7bb2585') + +prepare() { + cd "$pkgname-$pkgver" + + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/^host: //p')" +} + +build() { + cd "$pkgname-$pkgver" + + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cargo build --frozen --release -p schist-app +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm755 target/release/schist "$pkgdir/usr/bin/schist" + install -Dm644 packaging/linux/schist.desktop \ + "$pkgdir/usr/share/applications/schist.desktop" + # named after the desktop entry's Icon= key + install -Dm644 packaging/linux/schist.png \ + "$pkgdir/usr/share/icons/hicolor/256x256/apps/com.infrawrench.schist.png" + install -Dm644 packaging/linux/com.infrawrench.schist.mime.xml \ + "$pkgdir/usr/share/mime/packages/com.infrawrench.schist.xml" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/schist/pkg.sh b/schist/pkg.sh new file mode 100644 index 0000000..1dfb811 --- /dev/null +++ b/schist/pkg.sh @@ -0,0 +1,50 @@ +# schist - Schist (https://github.com/Infrawrench/schist), a layered image +# editor in Rust (gpui) with PSD and Affinity support. +# +# Source package: the PKGBUILD builds the release tag, following upstream's own +# PKGBUILD in packaging/linux/aur/schist. That file names the dependencies of +# each tag, so refresh_checksums() fails when they no longer match ours. +# +# Releases are tagged v, and /releases/latest skips prereleases. + +UPSTREAM_REPO="Infrawrench/schist" + +# Installed in CI (pacman) before the makepkg test build: the makedepends plus +# the libraries the build links against. +BUILD_DEPS=(rust clang mold fontconfig freetype2 libxcb libxkbcommon + libxkbcommon-x11 vulkan-icd-loader wayland) + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' +} + +# pkgbuild_array : the words of one array in a PKGBUILD on stdin, sorted +pkgbuild_array() { + awk -v n="$1" '$0 ~ "^" n "=\\(" { f = 1 } f { sub(/#.*/, ""); print } f && /\)/ { exit }' \ + | sed "s/^$1=(//; s/).*//" | tr -s " '\"" '\n' | sed '/^$/d' | sort +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local upstream name sha + + upstream="$(gh api "repos/$UPSTREAM_REPO/contents/packaging/linux/aur/schist/PKGBUILD?ref=v$ver" \ + -H 'Accept: application/vnd.github.raw')" || return 1 + for name in depends makedepends; do + if [[ "$(pkgbuild_array "$name" <<< "$upstream")" != "$(pkgbuild_array "$name" < "$pkgbuild")" ]]; then + echo "upstream's $name changed in v$ver, update the PKGBUILD (and BUILD_DEPS):" >&2 + pkgbuild_array "$name" <<< "$upstream" >&2 + return 1 + fi + done + + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/v$ver.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + if [[ "$sha" == "$(printf '' | sha256sum | cut -d' ' -f1)" ]]; then + echo "could not download the v$ver source tarball" >&2 + return 1 + fi + + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" +}