321.6. uosc-5.13.0
Minimalist, proximity-based on-screen controls, menus and playlist for mpv
| Version | 5.13.0, release 1 |
| Shelf | video-players — Video players and media centres, and their front-end add-ons |
| Phase | 44_apps (Applications), 405 of 422 in build order |
| Licence | LGPL-2.1-or-later |
| Homepage | https://github.com/tomasklaen/uosc |
| Build time | 0.2 SBU |
| Installed size | 8.4 MiB in 34 files |
| Recipe | ports/core/video-players/uosc/kpkgbuild |
About
uosc is a replacement for mpv’s built-in on-screen controller: a proximity-based timeline and controls, menus, and a playlist, written in Lua as an mpv script. Installed in mpv’s system script directory, it replaces the built-in controller for every user of mpv; its main.lua sets osc=no itself.
Sources
uosc-5.13.0.tar.gz(2.5 MiB)
sha25618fb38bd7d3ff3ca03f394b4d57daaa5a3f68051dcc31fdbfff3fbc874468913
upstream: https://github.com/tomasklaen/uosc/archive/refs/tags/5.13.0.tar.gz
archive copy: sources-4/video-players--uosc-5.13.0.tar.gzuosc-vendor-5.13.0.tar.xz(177.2 KiB)
sha256177c3719236eb75b15c473687ff1a335ad1420952efb06d67563f0703f53ddf4
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/video-players--uosc-vendor-5.13.0.tar.xz
Dependencies
Depends on: go, mpv, wl-clipboard.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install uosc'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-players/uosc.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/video-players/uosc
echo '18fb38bd7d3ff3ca03f394b4d57daaa5a3f68051dcc31fdbfff3fbc874468913 uosc-5.13.0.tar.gz' | sha256sum -c -
echo '177c3719236eb75b15c473687ff1a335ad1420952efb06d67563f0703f53ddf4 uosc-vendor-5.13.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/uosc
SRC=$SRC_ROOT/uosc-5.13.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf uosc-5.13.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CGO_ENABLED=0
go build -mod=vendor -trimpath -ldflags "-s -w" -o ziggy-bin ./src/ziggy
install -d "$PKG/etc/mpv/scripts" "$PKG/etc/mpv/script-opts"
cp -r src/uosc "$PKG/etc/mpv/scripts/uosc"
rm -rf "$PKG/etc/mpv/scripts/uosc/intl"
install -Dm755 ziggy-bin "$PKG/usr/lib/uosc/ziggy"
install -d "$PKG/etc/mpv/scripts/uosc/bin"
ln -s /usr/lib/uosc/ziggy "$PKG/etc/mpv/scripts/uosc/bin/ziggy-linux"
install -Dm644 src/uosc.conf "$PKG/etc/mpv/script-opts/uosc.conf"
install -Dm644 -t "$PKG/usr/share/fonts/uosc" \
src/fonts/uosc_icons.otf src/fonts/uosc_textures.ttf
install -Dm644 LICENSE.LGPL "$PKG/usr/share/licenses/uosc/LICENSE.LGPL"
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/uosc, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf uosc-5.13.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/uosc, and runs the triggers its paths call for.
Contents
Installed directories: /etc/mpv/script-opts, /etc/mpv/scripts/uosc, /usr/lib/uosc, /usr/share/fonts/uosc, /usr/share/licenses/uosc.
Notes
- ziggy is built here. uosc’s helper binary,
ziggy, does this work for the script: the clipboard, the OpenSubtitles search and download, file downloads and other HTTP requests, and opening a path or address in its default program. Upstream’s release archive carries it prebuilt for three systems; this port builds it fromsrc/ziggyagainst the Go vendor bundle instead, and does not buildsrc/tools, upstream’s packaging helper. Its clipboard code runswl-copyandwl-pastewhenWAYLAND_DISPLAYis set, which is why wl-clipboard is independs. - Where the files go. The script tree goes to
/etc/mpv/scripts/uosc, mpv’s system script directory, and its options to/etc/mpv/script-opts/uosc.conf. The binary lives at/usr/lib/uosc/ziggy, andbin/ziggy-linuxinside the script directory, the pathmain.lualooks for, is a link to it. - The two faces are system fonts.
uosc_icons.otfanduosc_textures.ttfare found by family name through fontconfig, so they go to/usr/share/fonts/uoscrather than into a per-user mpv fonts directory. They ship as upstream built them; see What is built from source. - English only. The
intldirectory of translated strings is removed; the English strings are built into the script, and a missing locale file falls back to them.