From 89ee59dbb25246e924a4f6e263ae4cbc8fc63292 Mon Sep 17 00:00:00 2001 From: Felitendo Date: Tue, 15 Sep 2026 19:53:29 +0200 Subject: [PATCH] modrinth-enhanced, modrinth-enhanced-bin: new packages --- README.md | 2 + modrinth-enhanced-bin/.SRCINFO | 33 +++++++++ modrinth-enhanced-bin/PKGBUILD | 32 ++++++++ modrinth-enhanced-bin/pkg.sh | 45 ++++++++++++ modrinth-enhanced/.SRCINFO | 40 ++++++++++ modrinth-enhanced/PKGBUILD | 129 +++++++++++++++++++++++++++++++++ modrinth-enhanced/pkg.sh | 67 +++++++++++++++++ 7 files changed, 348 insertions(+) create mode 100644 modrinth-enhanced-bin/.SRCINFO create mode 100644 modrinth-enhanced-bin/PKGBUILD create mode 100644 modrinth-enhanced-bin/pkg.sh create mode 100644 modrinth-enhanced/.SRCINFO create mode 100644 modrinth-enhanced/PKGBUILD create mode 100644 modrinth-enhanced/pkg.sh diff --git a/README.md b/README.md index f782700..9b29c8d 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ 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) | +| `modrinth-enhanced` | [Felitendo/Modrinth-Enhanced](https://github.com/Felitendo/Modrinth-Enhanced) — Modrinth App without ads or telemetry, with offline and Ely.by accounts (a patch series on top of each Modrinth App release) | *built from source* | [modrinth-enhanced](https://aur.archlinux.org/packages/modrinth-enhanced) | +| `modrinth-enhanced-bin` | [Felitendo/Modrinth-Enhanced](https://github.com/Felitendo/Modrinth-Enhanced) — prebuilt release of `modrinth-enhanced` | `.deb` | [modrinth-enhanced-bin](https://aur.archlinux.org/packages/modrinth-enhanced-bin) | | `moondeckbuddy` | [FrogTheFrog/moondeck-buddy](https://github.com/FrogTheFrog/moondeck-buddy) — host companion of the MoonDeck Steam Deck plugin (C++/Qt6) | *built from source* | [moondeckbuddy](https://aur.archlinux.org/packages/moondeckbuddy) | | `moondeckbuddy-bin` | [FrogTheFrog/moondeck-buddy](https://github.com/FrogTheFrog/moondeck-buddy) — prebuilt release of `moondeckbuddy` | AppImage | *not published yet* | | `nextcloud-native` | [Obiente/nc-native](https://github.com/Obiente/nc-native) — adaptive native Nextcloud client for files, media and installed server apps (Compose Multiplatform, unofficial) | *built from source* | [nextcloud-native](https://aur.archlinux.org/packages/nextcloud-native) | diff --git a/modrinth-enhanced-bin/.SRCINFO b/modrinth-enhanced-bin/.SRCINFO new file mode 100644 index 0000000..179dfea --- /dev/null +++ b/modrinth-enhanced-bin/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = modrinth-enhanced-bin + pkgdesc = Modrinth App without ads or telemetry, with offline and Ely.by accounts and Linux fixes (upstream binary) + pkgver = 0.21.2 + pkgrel = 1 + url = https://github.com/Felitendo/Modrinth-Enhanced + arch = x86_64 + license = GPL-3.0-only + depends = cairo + depends = dbus + depends = gdk-pixbuf2 + depends = glib2 + depends = glibc + depends = gtk3 + depends = hicolor-icon-theme + depends = libgcc + depends = libsoup3 + depends = webkit2gtk-4.1 + depends = libgl + depends = libpulse + depends = libx11 + depends = libxcursor + depends = libxext + depends = libxxf86vm + optdepends = xorg-xrandr: for older Minecraft versions + provides = modrinth-enhanced + conflicts = modrinth-enhanced + noextract = modrinth-enhanced-bin-0.21.2.deb + options = !strip + options = !debug + source = modrinth-enhanced-bin-0.21.2.deb::https://github.com/Felitendo/Modrinth-Enhanced/releases/download/v0.21.2/Modrinth.Enhanced_0.21.2_amd64.deb + sha256sums = 32ed32575050b4ac1a990b54a894e82c17860a48d5a228ce0d1ce7fc2c9d5d6f + +pkgname = modrinth-enhanced-bin diff --git a/modrinth-enhanced-bin/PKGBUILD b/modrinth-enhanced-bin/PKGBUILD new file mode 100644 index 0000000..946ca3c --- /dev/null +++ b/modrinth-enhanced-bin/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=modrinth-enhanced-bin +pkgver=0.21.2 +pkgrel=1 +pkgdesc="Modrinth App without ads or telemetry, with offline and Ely.by accounts and Linux fixes (upstream binary)" +arch=('x86_64') +url="https://github.com/Felitendo/Modrinth-Enhanced" +license=('GPL-3.0-only') +depends=('cairo' 'dbus' 'gdk-pixbuf2' 'glib2' 'glibc' 'gtk3' 'hicolor-icon-theme' + 'libgcc' 'libsoup3' 'webkit2gtk-4.1' + # loaded by Minecraft, not by the launcher + 'libgl' 'libpulse' 'libx11' 'libxcursor' 'libxext' 'libxxf86vm') +optdepends=('xorg-xrandr: for older Minecraft versions') +provides=('modrinth-enhanced') +conflicts=('modrinth-enhanced') +options=('!strip' '!debug') +# A new revision of the patches on the same Modrinth App release is tagged +# v0.21.2-2, which pkgver spells 0.21.2.r2; see pkg.sh. +_tag="v0.21.2" +_asset="Modrinth.Enhanced_0.21.2_amd64.deb" +source=("${pkgname}-${pkgver}.deb::https://github.com/Felitendo/Modrinth-Enhanced/releases/download/${_tag}/${_asset}") +noextract=("${pkgname}-${pkgver}.deb") +sha256sums=('32ed32575050b4ac1a990b54a894e82c17860a48d5a228ce0d1ce7fc2c9d5d6f') + +package() { + bsdtar -xOf "$srcdir/${pkgname}-${pkgver}.deb" 'data.tar.*' \ + | bsdtar -xpf - -C "$pkgdir" usr + ln -s ModrinthEnhanced "$pkgdir/usr/bin/modrinth-enhanced" +} diff --git a/modrinth-enhanced-bin/pkg.sh b/modrinth-enhanced-bin/pkg.sh new file mode 100644 index 0000000..73ce24a --- /dev/null +++ b/modrinth-enhanced-bin/pkg.sh @@ -0,0 +1,45 @@ +# modrinth-enhanced-bin - Modrinth Enhanced (https://github.com/Felitendo/Modrinth-Enhanced), +# the Modrinth App (Tauri) with a series of patches applied: no ads, no +# telemetry, offline and Ely.by accounts, Linux fixes. +# +# Upstream publishes a bundled .deb per release, so there is no build step +# here: on a new version only pkgver, the tag, the asset name and the checksum +# are refreshed and the PKGBUILD repackages the deb directly. +# +# Releases are tagged after the Modrinth App release they are built on +# (v0.21.2). When the patches change without a new Modrinth App release, the +# rebuild is tagged as a revision (v0.21.2-2) while the app and its .deb keep +# the plain version. pkgver turns the hyphen into ".r" (0.21.2.r2), which +# pacman sorts after 0.21.2 and before 0.21.3, so no epoch is needed. +# +# Upstream's release workflow creates the release together with its assets +# only after all three platforms built, so /releases/latest never points at a +# release whose .deb is still missing. + +UPSTREAM_REPO="Felitendo/Modrinth-Enhanced" + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//; s/-/.r/' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local tag="v${ver/.r/-}" asset sha + + asset="$(gh api "repos/$UPSTREAM_REPO/releases/tags/$tag" \ + --jq '.assets[].name | select(endswith("_amd64.deb"))')" + if [[ -z "$asset" || "$asset" == *$'\n'* ]]; then + echo "could not find exactly one amd64 .deb in release $tag" >&2 + return 1 + fi + + 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" +} diff --git a/modrinth-enhanced/.SRCINFO b/modrinth-enhanced/.SRCINFO new file mode 100644 index 0000000..efbf609 --- /dev/null +++ b/modrinth-enhanced/.SRCINFO @@ -0,0 +1,40 @@ +pkgbase = modrinth-enhanced + pkgdesc = Modrinth App without ads or telemetry, with offline and Ely.by accounts and Linux fixes + pkgver = 0.21.2 + pkgrel = 1 + url = https://github.com/Felitendo/Modrinth-Enhanced + arch = x86_64 + license = GPL-3.0-only + makedepends = cargo + makedepends = git + makedepends = jdk17-openjdk + makedepends = node-gyp + makedepends = nodejs>=24.15.0 + makedepends = npm + makedepends = pnpm + depends = cairo + depends = dbus + depends = gdk-pixbuf2 + depends = glib2 + depends = glibc + depends = gtk3 + depends = hicolor-icon-theme + depends = libgcc + depends = libsoup3 + depends = webkit2gtk-4.1 + depends = libgl + depends = libpulse + depends = libx11 + depends = libxcursor + depends = libxext + depends = libxxf86vm + optdepends = xorg-xrandr: for older Minecraft versions + noextract = modrinth-code-v0.21.2.tar.gz + options = !lto + options = !debug + source = modrinth-enhanced-v0.21.2.tar.gz::https://github.com/Felitendo/Modrinth-Enhanced/archive/refs/tags/v0.21.2.tar.gz + source = modrinth-code-v0.21.2.tar.gz::https://github.com/modrinth/code/archive/refs/tags/v0.21.2.tar.gz + sha256sums = a87ddcef0a39ab4a2c56ece806e381c6b398c755da00a9734b0162abc377e5a6 + sha256sums = 583e085cd7ae64a7020656af4ecc64ecfcc82fd97519f74cc3ab114d49574a5e + +pkgname = modrinth-enhanced diff --git a/modrinth-enhanced/PKGBUILD b/modrinth-enhanced/PKGBUILD new file mode 100644 index 0000000..9895682 --- /dev/null +++ b/modrinth-enhanced/PKGBUILD @@ -0,0 +1,129 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=modrinth-enhanced +pkgver=0.21.2 +pkgrel=1 +pkgdesc="Modrinth App without ads or telemetry, with offline and Ely.by accounts and Linux fixes" +arch=('x86_64') +url="https://github.com/Felitendo/Modrinth-Enhanced" +license=('GPL-3.0-only') +depends=('cairo' 'dbus' 'gdk-pixbuf2' 'glib2' 'glibc' 'gtk3' 'hicolor-icon-theme' + 'libgcc' 'libsoup3' 'webkit2gtk-4.1' + # loaded by Minecraft, not by the launcher + 'libgl' 'libpulse' 'libx11' 'libxcursor' 'libxext' 'libxxf86vm') +# git replays the patches the way upstream's scripts/prepare.sh does; the JDK +# builds the Java agent, whose Gradle toolchain asks for exactly 17 +makedepends=('cargo' 'git' 'jdk17-openjdk' 'node-gyp' 'nodejs>=24.15.0' 'npm' 'pnpm') +optdepends=('xorg-xrandr: for older Minecraft versions') +# the release profile carries no debug info, so a -debug package would be empty +options=('!lto' '!debug') +# Modrinth Enhanced holds no forked source, only patches. Its release tag +# records the Modrinth App release it was built on (upstream.txt) and the one +# the patches were exported against (patches/base.txt); pkg.sh reads both. +# A new revision of the patches on the same release is tagged v0.21.2-2, which +# pkgver spells 0.21.2.r2. +_tag="v0.21.2" +_upstream="v0.21.2" +_base="v0.21.2" +source=("${pkgname}-${_tag}.tar.gz::https://github.com/Felitendo/Modrinth-Enhanced/archive/refs/tags/${_tag}.tar.gz" + "modrinth-code-${_upstream}.tar.gz::https://github.com/modrinth/code/archive/refs/tags/${_upstream}.tar.gz") +noextract=("modrinth-code-${_upstream}.tar.gz") +if [[ "$_base" != "$_upstream" ]]; then + source+=("modrinth-code-${_base}.tar.gz::https://github.com/modrinth/code/archive/refs/tags/${_base}.tar.gz") + noextract+=("modrinth-code-${_base}.tar.gz") +fi +sha256sums=('a87ddcef0a39ab4a2c56ece806e381c6b398c755da00a9734b0162abc377e5a6' '583e085cd7ae64a7020656af4ecc64ecfcc82fd97519f74cc3ab114d49574a5e') + +prepare() { + # What upstream's scripts/prepare.sh does with two shallow tags: apply the + # patches to the release they were exported against, where they always fit, + # then rebase them onto the release this version was built on, so that a + # change upstream made near a patch is merged instead of failing to apply. + export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 + export GIT_AUTHOR_NAME="Modrinth Enhanced" GIT_AUTHOR_EMAIL="patches@modrinth-enhanced.invalid" + export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" + + rm -rf app + mkdir app + cd app + git init -q + # reset --hard checks the tree out again with upstream's .gitattributes + # applied, as a clone of the tag would have it + bsdtar -xf "$srcdir/modrinth-code-${_base}.tar.gz" --strip-components 1 + git add -Af + git commit -qm "Modrinth App ${_base}" + git reset -q --hard + git tag base + if [[ "$_base" != "$_upstream" ]]; then + git rm -rqf . + bsdtar -xf "$srcdir/modrinth-code-${_upstream}.tar.gz" --strip-components 1 + git add -Af + git commit -qm "Modrinth App ${_upstream}" + git reset -q --hard + git tag upstream + git checkout -q -b enhanced base + fi + git am -q --3way --whitespace=nowarn "$srcdir/Modrinth-Enhanced-${_tag#v}/patches/"*.patch + if [[ "$_base" != "$_upstream" ]]; then + git rebase -q --onto upstream base enhanced + fi + + # upstream's scripts/set-version.sh: the sources carry 1.0.0-local, the app + # reports the Modrinth App release it is built on + sed -i "s/1.0.0-local/${_upstream#v}/" \ + apps/app/Cargo.toml packages/app-lib/Cargo.toml apps/app-frontend/package.json Cargo.lock + + # the production API endpoints, as upstream's scripts/build.sh selects them + cp packages/app-lib/.env.prod packages/app-lib/.env + + # node-gyp for the native modules + export NODE_PATH=/usr/lib/node_modules + export TURBO_TELEMETRY_DISABLED=1 + pnpm install --frozen-lockfile + + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target host-tuple +} + +build() { + cd app + + export RUSTUP_TOOLCHAIN=stable + export NODE_PATH=/usr/lib/node_modules + export TURBO_TELEMETRY_DISABLED=1 + export JAVA_HOME=/usr/lib/jvm/java-17-openjdk + # keep Gradle's cache inside the build tree instead of ~/.gradle + export GRADLE_USER_HOME="$srcdir/gradle-home" + + # Without tauri-release.conf.json, as upstream builds it: that config only + # adds Modrinth's own updater. app-lib's build script runs Gradle, which + # downloads itself and the agent's dependencies, so build() needs network. + pnpm --filter=@modrinth/app run tauri build --no-bundle +} + +package() { + cd app + + # the same files, under the same names, as upstream's .deb + install -Dm755 target/release/ModrinthEnhanced -t "$pkgdir/usr/bin/" + ln -s ModrinthEnhanced "$pkgdir/usr/bin/modrinth-enhanced" + + install -Dm644 apps/app/icons/128x128.png \ + "$pkgdir/usr/share/icons/hicolor/128x128/apps/ModrinthEnhanced.png" + install -Dm644 apps/app/icons/128x128@2x.png \ + "$pkgdir/usr/share/icons/hicolor/256x256@2/apps/ModrinthEnhanced.png" + + install -d "$pkgdir/usr/share/applications" + cat > "$pkgdir/usr/share/applications/Modrinth Enhanced.desktop" << EOF +[Desktop Entry] +Categories=Game; +Exec=ModrinthEnhanced +Icon=ModrinthEnhanced +Name=Modrinth Enhanced +Terminal=false +Type=Application +MimeType=application/x-modrinth-modpack+zip;x-scheme-handler/modrinth +EOF +} diff --git a/modrinth-enhanced/pkg.sh b/modrinth-enhanced/pkg.sh new file mode 100644 index 0000000..11f9093 --- /dev/null +++ b/modrinth-enhanced/pkg.sh @@ -0,0 +1,67 @@ +# modrinth-enhanced - Modrinth Enhanced (https://github.com/Felitendo/Modrinth-Enhanced), +# the Modrinth App (Tauri) with a series of patches applied: no ads, no +# telemetry, offline and Ely.by accounts, Linux fixes. +# +# Source package: upstream is not a fork but a patch series on top of a +# modrinth/code release tag. The PKGBUILD takes the patches from the Modrinth +# Enhanced release tag, applies them to the modrinth/code tarballs the same way +# upstream's scripts/prepare.sh does and builds the result like +# scripts/build.sh - the binary upstream wraps into the .deb that +# modrinth-enhanced-bin repackages. +# +# Two modrinth/code releases are pinned per version, both read from the +# release tag: upstream.txt is the release it was built on, patches/base.txt +# the one the patches were last exported against. They differ until the +# patches are exported again after Modrinth ships a release; the PKGBUILD then +# downloads both and rebases the patches from one onto the other. +# +# Release/version handling is identical to modrinth-enhanced-bin: a revision +# of the patches is tagged v0.21.2-2 and becomes pkgver 0.21.2.r2. See +# modrinth-enhanced-bin/pkg.sh. + +UPSTREAM_REPO="Felitendo/Modrinth-Enhanced" + +# Installed in CI (pacman) before the makepkg test build. makepkg runs with +# -d there, so the libraries the binary links against are listed too. +BUILD_DEPS=(rust git jdk17-openjdk node-gyp nodejs npm pnpm webkit2gtk-4.1 gtk3 libsoup3) + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//; s/-/.r/' +} + +# read_tag_file - a file of the release tag, whitespace stripped +read_tag_file() { + gh api "repos/$UPSTREAM_REPO/contents/$2?ref=$1" -H 'Accept: application/vnd.github.raw' \ + | tr -d '[:space:]' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local tag="v${ver/.r/-}" upstream base sha_patches sha_upstream sums + + upstream="$(read_tag_file "$tag" upstream.txt)" + # like upstream's patch_base(): without base.txt the patches fit upstream.txt + base="$(read_tag_file "$tag" patches/base.txt)" || base="$upstream" + if [[ ! "$upstream" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ || ! "$base" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "could not resolve the Modrinth App releases of $tag (upstream: $upstream, base: $base)" >&2 + return 1 + fi + + sha_patches="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$tag.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + sha_upstream="$(curl -sfL "https://github.com/modrinth/code/archive/refs/tags/$upstream.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + sums="'$sha_patches' '$sha_upstream'" + if [[ "$base" != "$upstream" ]]; then + sums+=" '$(curl -sfL "https://github.com/modrinth/code/archive/refs/tags/$base.tar.gz" \ + | sha256sum | cut -d' ' -f1)'" + fi + + sed -i \ + -e "s|^_tag=.*|_tag=\"$tag\"|" \ + -e "s|^_upstream=.*|_upstream=\"$upstream\"|" \ + -e "s|^_base=.*|_base=\"$base\"|" \ + -e "s|^sha256sums=.*|sha256sums=($sums)|" \ + "$pkgbuild" +}