294.3. impression-3.8.0
Write a disk image to a USB drive or memory card
| Version | 3.8.0, release 2 |
| Shelf | disk — Block devices: partitioning, RAID, LVM, block encryption, SMART, NVMe, recovery, image writing and async I/O |
| Phase | 44_apps (Applications), 58 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://gitlab.com/adhami3310/Impression |
| Build time | 5.4 SBU |
| Installed size | 8.7 MiB in 12 files |
| Recipe | ports/core/disk/impression/kpkgbuild |
About
Impression writes a disk image to a USB drive or a memory card, to make a bootable drive: it lists the removable drives it finds through udisks2, and can also download an image of a distribution to write. A Windows installation ISO is not copied byte for byte, since it has no hybrid boot record and its install.wim can exceed FAT32’s 4 GiB file limit: Impression builds a bootable FAT32 drive instead, reading the ISO’s UDF filesystem through libcdio’s libudf and splitting an oversized install.wim with wimlib’s libwim, both linked from the system, which is why libcdio and wimlib are in depends. It is a GTK 4 and libadwaita application written in Rust, whose meson build runs cargo itself, from the vendor bundle that is the second sha256 = line (see Vendoring).
Sources
impression-3.8.0.tar.gz(237.8 KiB)
sha256afce96e3acefb521a8b3d6fbcc1279d1133775c99439a97e2178bafcd9e0658d
upstream: https://gitlab.com/adhami3310/Impression/-/archive/v3.8.0/Impression-v3.8.0.tar.gz
archive copy: sources-1/disk--impression-3.8.0.tar.gzimpression-vendor-3.8.0.tar.xz(30.4 MiB)
sha256c4c5aa1b590c3771a58ee80ea433db050938071538e307325b51f190a9635022
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-1/disk--impression-vendor-3.8.0.tar.xz
Dependencies
Depends on: meson, ninja, pkgconf, rust, gettext, glib, gtk4, libadwaita, openssl, dbus, blueprint-compiler, librsvg, udisks2, libcdio, wimlib.
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 impression'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/disk/impression.
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/disk/impression
echo 'afce96e3acefb521a8b3d6fbcc1279d1133775c99439a97e2178bafcd9e0658d impression-3.8.0.tar.gz' | sha256sum -c -
echo 'c4c5aa1b590c3771a58ee80ea433db050938071538e307325b51f190a9635022 impression-vendor-3.8.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/impression
SRC=$SRC_ROOT/impression-3.8.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf impression-3.8.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 CARGO_NET_OFFLINE=true
export OPENSSL_NO_VENDOR=1
export RUSTFLAGS="-C target-feature=-crt-static"
meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
--buildtype=release \
-Dprofile=default
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
for s in 48 64 128; do
install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
rsvg-convert -w $s -h $s \
data/resources/icons/hicolor/scalable/apps/io.gitlab.adhami3310.Impression.svg \
-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/io.gitlab.adhami3310.Impression.png"
done
cat > "$PKG/usr/share/applications/io.gitlab.adhami3310.Impression.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Impression
GenericName=Media Writer
Comment=Create bootable drives
TryExec=impression
Exec=impression %u
Icon=io.gitlab.adhami3310.Impression
Terminal=false
StartupNotify=true
StartupWMClass=io.gitlab.adhami3310.Impression
Categories=GTK;GNOME;Utility;System;DiscBurning;
Keywords=usb;flash;writer;bootable;drive;iso;img;disk;image;media;creator;live;
DESKTOP
chmod 644 "$PKG/usr/share/applications/io.gitlab.adhami3310.Impression.desktop"
The switches, and why each is set:
OPENSSL_NO_VENDOR=1— Tell theopenssl-syscrate to link the system openssl and never compile a copy of its own, even where a crate asks for itsvendoredfeature. The HTTPS downloads go throughreqwestwith itsnative-tlsfeature, which is OpenSSL.-Dprofile=default— The release profile: meson passes--releaseto cargo, and the application id carries noDevelsuffix. The other choice,development, builds cargo’s debug profile. It is 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/impression, 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 impression-3.8.0-2.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/impression, and runs the triggers its paths call for.
Contents
Installed programs: impression.
Installed directories: /usr/share/impression, /usr/share/licenses/impression.
Notes
The vendor bundle is unpacked at the top of the source tree, beside Cargo.toml, not under build/. Meson runs cargo from inside its build directory and sets CARGO_HOME to build/cargo-home itself (src/meson.build), so a CARGO_HOME exported by the recipe would be overridden, and this recipe, unlike a plain cargo build, sets none. Cargo finds the bundle’s .cargo/config.toml, the file that points every crate at vendor/, by searching upward from the directory it runs in.
The recipe has no readelf check that the program needs libssl.so, so a build that compiled OpenSSL in would not stop.
build.sh renders the scalable icon to PNGs at 48, 64 and 128 pixels with rsvg-convert (see Desktop entries belong to the port for how the session resolves an Icon=), and writes its own io.gitlab.adhami3310.Impression.desktop over the one meson installs. The replacement keeps upstream’s name, comment, Exec, categories and keywords, adds TryExec and StartupWMClass, and leaves out three of upstream’s keys: DBusActivatable=true, so the launcher runs the program named in Exec; X-GNOME-UsesNotifications; and the MimeType= list, which claims ISO, CD and raw disk images and xz files.