91.5. starship-1.26.0
Configurable shell prompt
| Version | 1.26.0, release 1 |
| Shelf | shells — Interactive shells and their add-ons, terminal multiplexers, and terminal emulators |
| Phase | 41_system (System), 950 of 1047 in build order |
| Licence | ISC |
| Homepage | https://starship.rs/ |
| Build time | 9.3 SBU |
| Installed size | 11.7 MiB in 2 files |
| Recipe | ports/core/shells/starship/kpkgbuild |
About
Starship draws the shell prompt. The system bash.bashrc runs starship init bash whenever starship is installed and falls back to a plain prompt otherwise; the prompt reads ~/.config/starship.toml, whose palette block kdos theme rewrites with the active colour scheme (see Theming). The copy a new account gets from /etc/skel gives starship’s container module a format, so a shell inside a box shows the container’s name in the prompt.
Sources
starship-1.26.0.tar.gz(10.5 MiB)
sha2568c95e8a6c596b29ac192104eae00dd991e8c8fd66083fd2b34d6b223a5803a59
upstream: https://github.com/starship/starship/archive/refs/tags/v1.26.0.tar.gz
archive copy: sources-4/shells--starship-1.26.0.tar.gzstarship-vendor-1.26.0.tar.xz(32.1 MiB)
sha2567e1f4b363b60379ba13286d32cf380bd7bc83dc5fb780bcc04b784e34b9726d6
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-4/shells--starship-vendor-1.26.0.tar.xz
Dependencies
Depends on: rust.
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/41_system/phase.env && kpkg install starship'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/shells/starship.
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/shells/starship
echo '8c95e8a6c596b29ac192104eae00dd991e8c8fd66083fd2b34d6b223a5803a59 starship-1.26.0.tar.gz' | sha256sum -c -
echo '7e1f4b363b60379ba13286d32cf380bd7bc83dc5fb780bcc04b784e34b9726d6 starship-vendor-1.26.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/starship
SRC=$SRC_ROOT/starship-1.26.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf starship-1.26.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 RUSTFLAGS="-C target-feature=-crt-static"
cargo build --release --frozen --offline
install -Dm755 target/release/starship $PKG/usr/bin/starship
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/starship, 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 starship-1.26.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/starship, and runs the triggers its paths call for.
Contents
Installed programs: starship.
Installed directories: /usr/share/licenses/starship.
Notes
The crates come from the vendor bundle, starship-vendor-<version>.tar.xz, which ports/fetch makes with cargo vendor and which carries the vendor/ directory, the .cargo/config.toml that points cargo at it, and the Cargo.lock it was resolved against (see Vendoring). build.sh unpacks it into the top of the source tree, where cargo runs and finds the configuration, and builds with --frozen --offline, so a crate missing from the bundle stops the build instead of being fetched. The RUSTFLAGS line is the tree’s rule for every Rust port: -crt-static links the program against the system’s shared musl rather than statically (see rust).