310.2. font-manager-0.9.4
Font Manager and Font Viewer: browse, compare, preview and enable fonts, for GTK 4
| Version | 0.9.4, release 1 |
| Shelf | fonts — Font packages, and font libraries and tooling |
| Phase | 44_apps (Applications), 135 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://fontmanager.github.io/ |
| Build time | 2.6 SBU |
| Installed size | 9.5 MiB in 25 files |
| Recipe | ports/core/fonts/font-manager/kpkgbuild |
About
Font Manager is a GTK 4 program, written in Vala, for browsing, comparing and previewing the installed fonts and enabling or disabling them for the user through fontconfig. The package carries two programs: Font Manager itself, and Font Viewer, which previews one font file and installs it for the current user.
Sources
font-manager-0.9.4.tar.xz(2.5 MiB)
sha2566a0899ac753f50d0779751828c62fa6220024213ebd2179b6f64a3a9bff51f96
upstream: https://github.com/FontManager/font-manager/releases/download/0.9.4/font-manager-0.9.4.tar.xz
archive copy: sources-2/fonts--font-manager-0.9.4.tar.xz
Dependencies
Depends on: meson, ninja, pkgconf, vala, gettext, python3, glib, gobject-introspection, gtk4, pango, json-glib, libxml2, sqlite, fontconfig, freetype2, harfbuzz, libarchive, librsvg, hicolor-icon-theme.
Required by: no port names it.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-Dadwaita=false, line 19: libadwaita (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
vala-0.56.19.patch— Fix compilation error with newer Vala versionsFixes #467
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 font-manager'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/fonts/font-manager.
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/fonts/font-manager
echo '6a0899ac753f50d0779751828c62fa6220024213ebd2179b6f64a3a9bff51f96 font-manager-0.9.4.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/font-manager
SRC=$SRC_ROOT/font-manager-0.9.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf font-manager-0.9.4.tar.xz -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:
patch -p1 -i "$PORT_SRC/vala-0.56.19.patch"
meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
--buildtype=release \
-Dmanager=true \
-Dviewer=true \
-Dsearch-provider=false \
-Dadwaita=false \
-Dwebkit=false \
-Dlibarchive=true \
-Dyelp-doc=false \
-Denable-nls=false \
-Dunihan=true \
-Dnautilus=false \
-Dnemo=false \
-Dthunar=false \
-Dgtk-doc=false \
-Dreproducible=true \
-Dapp-armor=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
for id in com.github.FontManager.FontManager com.github.FontManager.FontViewer; do
for s in 48 64 128 256; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s -o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/$id.png" \
data/com.github.FontManager.FontManager.svg
done
done
cat > "$PKG/usr/share/applications/com.github.FontManager.FontManager.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Font Manager
GenericName=Font Manager
Comment=Browse, compare, enable and disable installed fonts
Exec=font-manager %u
Icon=com.github.FontManager.FontManager
Terminal=false
StartupNotify=true
StartupWMClass=com.github.FontManager.FontManager
Categories=GTK;Utility;Graphics;
Keywords=font;typeface;glyph;character;preview;compare;
EOF
cat > "$PKG/usr/share/applications/com.github.FontManager.FontViewer.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Font Viewer
GenericName=Font Viewer
Comment=Preview a font file and install it for this user
Exec=/usr/libexec/font-manager/font-viewer %u
Icon=com.github.FontManager.FontViewer
Terminal=false
StartupNotify=true
StartupWMClass=com.github.FontManager.FontViewer
MimeType=font/ttf;font/otf;font/collection;
Categories=GTK;Utility;Graphics;
Keywords=font;typeface;glyph;preview;install;
EOF
chmod 644 "$PKG/usr/share/applications/com.github.FontManager.FontManager.desktop" \
"$PKG/usr/share/applications/com.github.FontManager.FontViewer.desktop"
The switches, and why each is set:
-Dmanager=true— With-Dviewer=true: both programs. Upstream’s defaults, named.-Dsearch-provider=false— No GNOME Shell search provider, a.iniregistration file undershare/gnome-shell/search-providersthat only GNOME Shell reads; there is no GNOME Shell here.-Dadwaita=false— Upstream’s own stylesheet rather than libadwaita’s Adwaita one. Upstream’s default, named.-Dwebkit=false— No Google Fonts integration, the one part of the program that works over the network: it browses the Google Fonts catalogue in a WebKitGTK 6 view, and with it off the program links neither WebKitGTK nor libsoup.-Dlibarchive=true— Fonts can be installed from archive files, through libarchive. Upstream’s default, named.-Dyelp-doc=false— No help documents, which need yelp-tools to build and a help viewer to read; neither is a port.-Dunihan=true— Compiles in the Unicode Han unification data for the character map. Upstream’s default, named.-Dnautilus=false— With-Dnemo=falseand-Dthunar=false: no extensions for those file managers, none of which is a port. Upstream’s defaults, named.-Dgtk-doc=false— No API documentation. Upstream’s default, named.-Dreproducible=true— Compiles the C sources with-DREPRODUCIBLEinstead of-DNOT_REPRODUCIBLE. With the latter, the build directory’sdata/is compiled into the library as a further place to look for the GSettings schemas, so the binary would carry the path it was built in.-Dapp-armor=false— No AppArmor profile. Upstream’s default, named.
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/font-manager, 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 font-manager-0.9.4-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/font-manager, and runs the triggers its paths call for.
Contents
Installed programs: font-manager.
Installed directories: /usr/lib/font-manager, /usr/libexec/font-manager, /usr/share/licenses/font-manager.
Short descriptions
font-manager |
Simple font management for GTK+ desktop environments |
Notes
Upstream installs one SVG icon for the two programs. build.sh renders it with rsvg-convert from librsvg into hicolor PNGs, in four sizes, under both application ids.
Upstream’s two desktop entries are replaced. Each new entry carries its program’s GApplication id, com.github.FontManager.FontManager or com.github.FontManager.FontViewer, as its StartupWMClass, since that id is the window’s Wayland app_id; upstream’s entries name font-manager and font-viewer. Only the viewer claims the font types, so a font file has one handler rather than a choice between two windows of the same package, and the types it claims are the MIME database’s canonical names (font/ttf, font/otf, font/collection): the desktop resolves a file to one of those from its name, so an alias or an unknown type never matches.