From e02f5244a21225ba3993c57bec73eeb6224e50eb Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 26 Nov 2026 12:24:36 -0600 Subject: [PATCH] S045: GUI libraries in depends, uninstall removes empty folders and mimeapps line Co-Authored-By: Claude Sonnet 5.5 --- docs/tests/S045-installer-arch.md | 2 +- installer.sh | 10 +++++++++- packaging/arch/.SRCINFO | 13 ++++++++++--- packaging/arch/PKGBUILD | 9 ++++----- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/tests/S045-installer-arch.md b/docs/tests/S045-installer-arch.md index f3270b7..154c868 100644 --- a/docs/tests/S045-installer-arch.md +++ b/docs/tests/S045-installer-arch.md @@ -27,7 +27,7 @@ Run by the S045 worker with throwaway roots. Dist files: `dist/Medlar-0.1.0-*`. Throwaway HOME and DESTDIR only. Never the real ~/.local, /usr or pacman db. ## Doubts -- `--system` with real sudo was not run. Uninstall leaves empty folders and the `medlar:` default in mimeapps.list. +- `--system` with real sudo was not run. Uninstall now removes empty folders and its mimeapps.list line (checked with AppImage in a temp HOME). Depends include the dlopened libs (libxkbcommon, libglvnd, wayland, X11 libs, fontconfig) found in the binary strings. - `makepkg --nodeps` was used (glibc>=2.44 is met here). Package has no real LICENSE file: a short MIT notice is generated (project has none). - PKGBUILD pins the sha256 of the released tar.gz; package.sh uses a skip-free build with `-C` and the same tarball, so a rebuilt tar.gz needs the sum updated. - Package is `medlar-bin` but the file is named `Medlar-0.1.0-arch-x86_64.pkg.tar.zst` per release naming; pacman accepts it. diff --git a/installer.sh b/installer.sh index 8d7c5cd..a7b88a4 100755 --- a/installer.sh +++ b/installer.sh @@ -46,7 +46,15 @@ refresh() { if [ "$mode" = uninstall ]; then $sudo rm -f "$bin" "$desktop" "$icon" "$meta" "$lic" - $sudo rmdir "$root/share/licenses/medlar" 2>/dev/null || true + for d in "$root/share/licenses/medlar" "$root/share/licenses" "$root/share/icons/hicolor/scalable/apps" \ + "$root/share/icons/hicolor/scalable" "$root/share/icons/hicolor" "$root/share/icons" "$root/share/metainfo" \ + "$root/share/applications" "$root/share" "$root/bin"; do + $sudo rmdir "$d" 2>/dev/null || true + done + mp=${XDG_CONFIG_HOME:-$HOME/.config}/mimeapps.list + if [ "$scope" = user ] && [ -z "$destdir" ] && [ -f "$mp" ]; then + sed -i '/^x-scheme-handler\/medlar=medlar\.desktop;\{0,1\}$/d' "$mp" + fi refresh if [ "$purge" = 1 ]; then rm -rf "${XDG_CONFIG_HOME:-$HOME/.config}/medlar" "${XDG_DATA_HOME:-$HOME/.local/share}/medlar" \ diff --git a/packaging/arch/.SRCINFO b/packaging/arch/.SRCINFO index 8d93153..75daef2 100644 --- a/packaging/arch/.SRCINFO +++ b/packaging/arch/.SRCINFO @@ -7,11 +7,18 @@ pkgbase = medlar-bin license = MIT optdepends = yt-dlp: video sites optdepends = ffmpeg: video sites, merging streams - optdepends = libxkbcommon: keyboard input on X11 and Wayland - optdepends = wayland: Wayland sessions - optdepends = libglvnd: OpenGL rendering depends = glibc>=2.44 depends = gcc-libs + depends = libxkbcommon + depends = libxkbcommon-x11 + depends = libglvnd + depends = wayland + depends = libx11 + depends = libxcb + depends = libxcursor + depends = libxi + depends = libxrender + depends = fontconfig provides = medlar conflicts = medlar options = !strip diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index eec93f8..4a5691e 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -6,11 +6,10 @@ pkgdesc='Download manager with dynamic parts, queues, video sites and a Material arch=('x86_64') url='https://archlinux.tail7c4f5e.ts.net/git/astar76/Medlar' license=('MIT') -# The binary links only libc, libm, libgcc_s. It needs glibc 2.44 or newer (libm symbols). -depends=('glibc>=2.44' 'gcc-libs') -optdepends=('yt-dlp: video sites' 'ffmpeg: video sites, merging streams' - 'libxkbcommon: keyboard input on X11 and Wayland' - 'wayland: Wayland sessions' 'libglvnd: OpenGL rendering') +# Linked: libc, libm, libgcc_s. dlopened (seen in the binary's strings): libxkbcommon(-x11), libEGL/libGL (libglvnd), +# libwayland-client/-egl, libX11, libxcb, libXcursor, libXi, libXrender, fontconfig. The GUI cannot start without them. +depends=('glibc>=2.44' 'gcc-libs' 'libxkbcommon' 'libxkbcommon-x11' 'libglvnd' 'wayland' 'libx11' 'libxcb' 'libxcursor' 'libxi' 'libxrender' 'fontconfig') +optdepends=('yt-dlp: video sites' 'ffmpeg: video sites, merging streams') provides=('medlar') conflicts=('medlar') options=('!strip' '!debug')