From 04d7f951d0b3ed758584ccb66919521b86ba2119 Mon Sep 17 00:00:00 2001 From: Felitendo Date: Tue, 18 Aug 2026 10:30:43 +0200 Subject: [PATCH] nextcloud-native-bin: new package Nextcloud Native (https://github.com/Obiente/nc-native), an adaptive native Nextcloud client built with Kotlin/Compose Multiplatform. Upstream publishes a jpackage .deb per release, which the PKGBUILD repackages unchanged. Every upstream release is a prerelease and the release list is dominated by per-build nightly-* releases plus rolling channel-* pointers, so pkg.sh tracks only the versioned v* tags and syncs the build-numbered asset name along with the checksum. --- README.md | 1 + nextcloud-native-bin/.SRCINFO | 43 +++++++++++++++++++++++++ nextcloud-native-bin/PKGBUILD | 51 ++++++++++++++++++++++++++++++ nextcloud-native-bin/pkg.sh | 59 +++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 nextcloud-native-bin/.SRCINFO create mode 100644 nextcloud-native-bin/PKGBUILD create mode 100644 nextcloud-native-bin/pkg.sh diff --git a/README.md b/README.md index 9a1118c..d4db349 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | `lunar-client-bin` | [lunarclient.com](https://lunarclient.com) — Minecraft PvP modpack launcher | AppImage | [lunar-client-bin](https://aur.archlinux.org/packages/lunar-client-bin) | | `middleclick-autoscroll` | [Felitendo/middleclick-autoscroll](https://github.com/Felitendo/middleclick-autoscroll) — enables middle-click autoscroll in every application that supports it | *built from source* | [middleclick-autoscroll](https://aur.archlinux.org/packages/middleclick-autoscroll) | | `modrinth-app-bin` | [modrinth/code](https://github.com/modrinth/code) — Minecraft mod manager/launcher | `.deb` | [modrinth-app-bin](https://aur.archlinux.org/packages/modrinth-app-bin) | +| `nextcloud-native-bin` | [Obiente/nc-native](https://github.com/Obiente/nc-native) — adaptive native Nextcloud client for files, media and installed server apps (Compose Multiplatform, unofficial) | `.deb` | [nextcloud-native-bin](https://aur.archlinux.org/packages/nextcloud-native-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) | | `timetable` | [ostfriese4/untis](https://codeberg.org/ostfriese4/untis) — "Timetable", a GTK4 + LibAdwaita client for WebUntis | *built from source* | [timetable](https://aur.archlinux.org/packages/timetable) | diff --git a/nextcloud-native-bin/.SRCINFO b/nextcloud-native-bin/.SRCINFO new file mode 100644 index 0000000..62251af --- /dev/null +++ b/nextcloud-native-bin/.SRCINFO @@ -0,0 +1,43 @@ +pkgbase = nextcloud-native-bin + pkgdesc = Adaptive native client for Nextcloud files, media and apps (upstream binary) + pkgver = 0.1.0alpha.2 + pkgrel = 1 + url = https://nc-native.obiente.dev + arch = x86_64 + license = AGPL-3.0-or-later + depends = alsa-lib + depends = brotli + depends = bzip2 + depends = expat + depends = fontconfig + depends = freetype2 + depends = gcc-libs + depends = glibc + depends = hicolor-icon-theme + depends = libbsd + depends = libglvnd + depends = libmd + depends = libpng + depends = libsecret + depends = libx11 + depends = libxau + depends = libxcb + depends = libxdmcp + depends = libxext + depends = libxi + depends = libxrender + depends = libxtst + depends = xdg-utils + depends = zlib + optdepends = gnome-keyring: Secret Service provider for stored accounts + optdepends = kwallet: Secret Service provider for stored accounts on Plasma + optdepends = fuse2: mount an account as a virtual file system + provides = nextcloud-native + conflicts = nextcloud-native + noextract = nextcloud-native-bin-0.1.0alpha.2.deb + options = !strip + options = !debug + source = nextcloud-native-bin-0.1.0alpha.2.deb::https://github.com/Obiente/nc-native/releases/download/v0.1.0-alpha.2/nextcloudnative_1.0.3822_amd64.deb + sha256sums = df8e3e616c79c4ce3f7597fa9b88c188a956475f2af4128bc7a70692ebf39325 + +pkgname = nextcloud-native-bin diff --git a/nextcloud-native-bin/PKGBUILD b/nextcloud-native-bin/PKGBUILD new file mode 100644 index 0000000..0cf99b7 --- /dev/null +++ b/nextcloud-native-bin/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=nextcloud-native-bin +pkgver=0.1.0alpha.2 +pkgrel=1 +pkgdesc="Adaptive native client for Nextcloud files, media and apps (upstream binary)" +arch=('x86_64') +url="https://nc-native.obiente.dev" +license=('AGPL-3.0-or-later') +# jpackage bundles its own Java runtime, so these are the shared libraries the +# upstream .deb declares plus libsecret, whose secret-tool the client calls to +# store account credentials in the Secret Service. +depends=('alsa-lib' 'brotli' 'bzip2' 'expat' 'fontconfig' 'freetype2' + 'gcc-libs' 'glibc' 'hicolor-icon-theme' 'libbsd' 'libglvnd' 'libmd' + 'libpng' 'libsecret' 'libx11' 'libxau' 'libxcb' 'libxdmcp' 'libxext' + 'libxi' 'libxrender' 'libxtst' 'xdg-utils' 'zlib') +optdepends=('gnome-keyring: Secret Service provider for stored accounts' + 'kwallet: Secret Service provider for stored accounts on Plasma' + 'fuse2: mount an account as a virtual file system') +provides=('nextcloud-native') +conflicts=('nextcloud-native') +options=('!strip' '!debug') +# Upstream has no stable release yet: every release is a prerelease, and the +# repository also carries per-build nightly-* and rolling channel-* releases. +# Only the versioned tags are packaged, and their asset names embed a build +# number that cannot be derived from pkgver - both are refreshed automatically. +_tag="v0.1.0-alpha.2" +_asset="nextcloudnative_1.0.3822_amd64.deb" +source=("${pkgname}-${pkgver}.deb::https://github.com/Obiente/nc-native/releases/download/${_tag}/${_asset}") +noextract=("${pkgname}-${pkgver}.deb") +sha256sums=('df8e3e616c79c4ce3f7597fa9b88c188a956475f2af4128bc7a70692ebf39325') + +package() { + # jpackage app image (bundled JRE) in /opt plus the desktop entry, icon and + # AppStream metadata upstream adds to the .deb + bsdtar -xOf "$srcdir/${pkgname}-${pkgver}.deb" 'data.tar.*' \ + | bsdtar -xpf - -C "$pkgdir" --exclude './usr/share/doc' ./opt ./usr + + # the launcher resolves its own directory through /proc/self/exe, so a + # symlink into /usr/bin keeps the app image self-contained + install -d "$pkgdir/usr/bin" + ln -s /opt/nextcloudnative/bin/NextcloudNative "$pkgdir/usr/bin/nextcloud-native" + + install -Dm644 "$pkgdir/opt/nextcloudnative/share/doc/copyright" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + # The in-app updater only engages where dpkg or rpm reports the package as + # installed; on Arch it stays inert and updates come through pacman. +} diff --git a/nextcloud-native-bin/pkg.sh b/nextcloud-native-bin/pkg.sh new file mode 100644 index 0000000..1bbe288 --- /dev/null +++ b/nextcloud-native-bin/pkg.sh @@ -0,0 +1,59 @@ +# nextcloud-native-bin - Nextcloud Native (https://github.com/Obiente/nc-native), +# an adaptive native Nextcloud client built with Kotlin/Compose Multiplatform. +# +# Upstream publishes a jpackage .deb (and .rpm) per release, so there is no +# build_artifact() here: on a new version only pkgver, the asset name and the +# checksum are refreshed and the PKGBUILD repackages the .deb directly. +# +# The project has no stable release yet. Every GitHub release is marked +# prerelease, so /latest is empty, and the release list is dominated by +# per-build "nightly-*" releases plus the rolling "channel-nightly" / +# "channel-prerelease" pointers, whose assets change under a fixed name. Only +# the versioned "v*" tags are packaged; nightlies would push several AUR +# updates a day and cannot be checksummed reliably. +# +# pkgver drops the hyphen from the tag (v0.1.0-alpha.2 -> 0.1.0alpha.2). That +# sorts newer than a later plain 0.1.0, so the first stable release of a +# version that was packaged as a prerelease needs an epoch bump. + +UPSTREAM_REPO="Obiente/nc-native" + +# newest release whose tag looks like a version (skips nightly-*/channel-*) +latest_tag() { + gh api "repos/$UPSTREAM_REPO/releases?per_page=100" \ + --jq '[.[] | select(.tag_name | test("^v[0-9]"))] | .[0].tag_name' +} + +tag_to_pkgver() { + sed 's/^v//; s/-//g' +} + +latest_version() { + latest_tag | tag_to_pkgver +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local tag asset sha + + tag="$(latest_tag)" + if [[ "$(tag_to_pkgver <<< "$tag")" != "$ver" ]]; then + echo "newest versioned release is $tag, not the requested $ver - try again" >&2 + return 1 + fi + + # e.g. nextcloudnative_1.0.3822_amd64.deb - the number is a build counter + asset="$(gh api "repos/$UPSTREAM_REPO/releases/tags/$tag" --jq '.assets[].name' \ + | grep -E '^nextcloudnative_.*_amd64\.deb$')" + [[ "$(wc -l <<< "$asset")" -eq 1 ]] || { echo "expected exactly one amd64 .deb, got: $asset" >&2; return 1; } + + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/releases/download/$tag/$asset" \ + | sha256sum | cut -d' ' -f1)" + + sed -i \ + -e "s|^_tag=.*|_tag=\"$tag\"|" \ + -e "s|^_asset=.*|_asset=\"$asset\"|" \ + -e "s|^sha256sums=.*|sha256sums=('$sha')|" \ + "$pkgbuild" +}