file-utils #1

Merged
marti merged 3 commits from file-utils into main 2026-09-20 23:16:46 +02:00
Owner
No description provided.
pdfsplit did one thing and carried two hand-written UIs to do it: GTK 3 on
Linux and raw Win32 GDI painting on Windows. A sidebar of categories with a
toolbar of tools each cannot be owner-drawn twice for any sensible effort, so
the UI is rebuilt once, in GTK 4 and libadwaita, and both platforms run it.

Tools: split and join PDFs; convert between JPEG, PNG, WebP and HEIC in any
direction; compress images at three strengths. Audio is a sidebar entry with
an empty state, to prove the shell extends.

A tool is now data. One registry entry declares its title, the files it
accepts, its options and a Run function; the window renders a page from that
and the CLI grows a matching subcommand. Adding a tool touches neither.

The Windows half needed the most work. nixpkgs cannot cross-compile GTK 4 to
mingw - the chain breaks on a broken python3-mingw - so the runtime comes from
MSYS2's mingw-w64 packages, pinned by SHA256 in windows/msys2.lock.json and
regenerated by windows/update-lock.sh from the repository database. The build
cross-compiles with pkgsCross.mingwW64, walks the exe's import table for the
DLLs it actually needs, and wraps the result with NSIS: 25 MB installed.

Things found by measuring rather than assuming:

- GStreamer cannot be pruned from the Windows runtime. MSYS2 links the GTK
  media backend into libgtk-4-1.dll rather than shipping it as a module, so
  GTK will not load without it.
- Dithering a quantized PNG makes it six to eight times larger, because PNG
  predicts each pixel from its neighbours and dithering is noise. Nearest
  colour shrinks it instead, so compression now actually compresses.
- Two runs starting in the same second shared an output folder and overwrote
  each other; the timestamp alone is not unique.
- wrapGAppsHook4 does not put the icon theme on XDG_DATA_DIRS, so every
  symbolic icon rendered as a placeholder.
- gen2brain/webp dlopens a system libwebp when it finds one, so the build now
  passes -tags nodynamic to pin it to the embedded codec on both platforms.

Verified on both: the Linux package on Wayland, and the Windows exe under
wine, showing the same window.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rename left .gitignore guarding pdfsplit and pdfsplit.exe, so a local
build at the repo root would have shown up as untracked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
marti merged commit 12084ff463 into main 2026-09-20 23:16:46 +02:00
marti deleted branch file-utils 2026-09-20 23:17:02 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marti/file-utils!1
No description provided.