334.7. glabels-3.4.1
Labels, business cards and envelopes, with barcodes and mail merge
| Version | 3.4.1, release 1 |
| Shelf | printing — Printing, printer drivers, labels, scanning and OCR |
| Phase | 44_apps (Applications), 349 of 422 in build order |
| Licence | GPL-3.0-or-later AND LGPL-3.0-or-later AND MIT AND CC-BY-SA-3.0 |
| Homepage | https://github.com/j-evins/glabels-gtk |
| Build time | 0.8 SBU |
| Installed size | 3.9 MiB in 237 files |
| Recipe | ports/core/printing/glabels/kpkgbuild |
About
gLabels is a GTK 3 program for designing and printing labels, business cards and envelopes on standard label sheets, with text, images, barcodes and mail merge from a CSV file. Its program is glabels-3.
Sources
glabels-3.4.1.tar.xz(3.3 MiB)
sha25618e457298abb1c617187361109eeae769317686303fc07726af31e11519c5938
upstream: https://download.gnome.org/sources/glabels/3.4/glabels-3.4.1.tar.xz
archive copy: sources-3/printing--glabels-3.4.1.tar.xz
Dependencies
Depends on: pkgconf, gettext, intltool, perl-xml-parser, itstool, libxml2, glib, gtk3, cairo, pango, librsvg, qrencode, shared-mime-info, 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.
--without-libzint, line 22: zint (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
xml-unzip.patch— Unzip XML when opening fileWithout this, the recent versions of libxml does not try to unzip the file content, causes a read failure.
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 glabels'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/printing/glabels.
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/printing/glabels
echo '18e457298abb1c617187361109eeae769317686303fc07726af31e11519c5938 glabels-3.4.1.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/glabels
SRC=$SRC_ROOT/glabels-3.4.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf glabels-3.4.1.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/xml-unzip.patch"
export CFLAGS="$CFLAGS -fcommon -Wno-error=incompatible-pointer-types"
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
--disable-static \
--disable-nls \
--disable-gtk-doc \
--disable-schemas-compile \
--without-libebook \
--without-libbarcode \
--without-libzint \
--with-libqrencode \
--without-libiec16022
make
make DESTDIR=$PKG install
find "$PKG/usr/share/help" -mindepth 1 -maxdepth 1 ! -name C -exec rm -rf {} +
rm -f "$PKG"/usr/share/applications/*.desktop
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/glabels-3.desktop" <<'EOF2'
[Desktop Entry]
Type=Application
Name=gLabels
GenericName=Label Designer
Comment=Design and print labels, business cards and envelopes
Exec=glabels-3 %F
Icon=glabels-3.0
Terminal=false
StartupWMClass=glabels-3
Categories=Office;GTK;
MimeType=application/x-glabels;
Keywords=label;card;envelope;barcode;print;mail merge;glabels;
EOF2
chmod 644 "$PKG/usr/share/applications/glabels-3.desktop"
The switches, and why each is set:
CFLAGS="$CFLAGS -fcommon -Wno-error=incompatible-pointer-types"—-fcommonbecause two of gLabels’ headers define a global variable instead of declaring it, so every object that includes one carries its own definition; GCC’s default,-fno-common, makes the link fail on the duplicates, and-fcommonmerges them.-Wno-error=incompatible-pointer-typesturns the pointer conversions between incompatible types, which GCC rejects as errors, back into warnings.--disable-gtk-doc— Build no gtk-doc API reference for libglabels, the library gLabels installs with the program.--disable-schemas-compile— Do not runglib-compile-schemasat install time; kpkg rebuilds the shared GSettings schema cache after an install as one of its shared indexes.--without-libzint— No Zint barcode backend. gLabels’ backend callsZBarcode_Render, which the library of zint does not have, so configure would not find it and the backend could not build against the port.--without-libbarcode,--without-libiec16022,--without-libebook— No GNU Barcode, no libiec16022 DataMatrix backend and no Evolution address book for mail merge. None of the three is a port.--with-libqrencode— QR codes through qrencode. The other barcode types come from gLabels’ built-in encoders.
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/glabels, 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 glabels-3.4.1-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/glabels, and runs the triggers its paths call for.
Contents
Installed programs: glabels-3, glabels-3-batch.
Installed libraries: libglabels-3.0.so, libglbarcode-3.0.so.
Installed directories: /usr/include/libglabels-3.0, /usr/include/libglbarcode-3.0, /usr/share/glabels-3.0, /usr/share/gtk-doc/html/libglabels-3.0, /usr/share/gtk-doc/html/libglbarcode-3.0, /usr/share/help/C/glabels-3.0, /usr/share/libglabels-3.0, /usr/share/licenses/glabels.
Short descriptions
glabels-3 |
Label and business card creation program for GNOME |
libglabels-3.0.pc |
GLabels Template Library |
libglbarcode-3.0.pc |
GLabels Built-In Barcode Library |
Notes
A .glabels file is gzipped XML, and libxml2 decompresses a file only when the parser is asked to; without xml-unzip.patch every saved label fails to open.
Only the English help under /usr/share/help/C is kept.
The program has no GtkApplication and calls no set_prgname, so its Wayland app id is the program name, glabels-3. build.sh replaces upstream’s desktop entry, glabels-3.0.desktop, named “gLabels Label Designer 3” and with no StartupWMClass, with glabels-3.desktop, which names that id in StartupWMClass.