92.7. eza-0.23.5
Replacement for ls, with colours and Git status
| Version | 0.23.5, release 1 |
| Shelf | cli — Command-line productivity utilities: search, view, navigation and text wrangling in the terminal |
| Phase | 41_system (System), 288 of 1047 in build order |
| Licence | EUPL-1.2 AND MIT |
| Homepage | https://github.com/eza-community/eza |
| Build time | 3.0 SBU |
| Installed size | 1.9 MiB in 11 files |
| Recipe | ports/core/cli/eza/kpkgbuild |
About
eza lists files, as ls does, with colours by file type, a long view with headers, a tree view, icons, extended attributes, and each file’s Git status in the long view. The port installs eza, its manual pages and completions for bash, zsh and fish.
Sources
eza-0.23.5.tar.gz(1.4 MiB)
sha256bbf179f2611c904014431740b559e8055276c12fcf978a7e31c271663548337f
upstream: https://github.com/eza-community/eza/archive/v0.23.5.tar.gz
archive copy: sources-1/cli--eza-0.23.5.tar.gzeza-vendor-0.23.5.tar.xz(22.0 MiB)
sha25607b3d891742eb97086b1b98a60d482735da9d44ce4c97aebf8745b170331362f
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-1/cli--eza-vendor-0.23.5.tar.xz
Dependencies
Depends on: rust, lowdown, zlib, libgit2.
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 eza'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/cli/eza.
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/cli/eza
echo 'bbf179f2611c904014431740b559e8055276c12fcf978a7e31c271663548337f eza-0.23.5.tar.gz' | sha256sum -c -
echo '07b3d891742eb97086b1b98a60d482735da9d44ce4c97aebf8745b170331362f eza-vendor-0.23.5.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/eza
SRC=$SRC_ROOT/eza-0.23.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf eza-0.23.5.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
readelf -d target/release/eza | grep -q 'NEEDED.*\[libgit2\.so\.1\.9\]'
install -Dm755 target/release/eza $PKG/usr/bin/eza
for page in eza.1 eza_colors.5 eza_colors-explanation.5; do
lowdown -s -Tman -M source=v$version -o target/$page man/$page.md
install -Dm644 target/$page $PKG/usr/share/man/man${page##*.}/$page
done
install -Dm644 completions/bash/eza $PKG/usr/share/bash-completion/completions/eza
install -Dm644 completions/fish/eza.fish $PKG/usr/share/fish/vendor_completions.d/eza.fish
install -Dm644 completions/zsh/_eza $PKG/usr/share/zsh/site-functions/_eza
The switches, and why each is set:
-M source=v$version— Set thesourcefield of each manual page’s header, wheremanshows the version. The Markdown pages carry the placeholder$versionin their title line, which upstream’sjustfilereplaces withsedbefore converting with pandoc; the recipe converts with lowdown (-s -Tman) and gives it the version as metadata instead.
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/eza, 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 eza-0.23.5-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/eza, and runs the triggers its paths call for.
Contents
Installed programs: eza.
Installed directories: /usr/share/licenses/eza.
Short descriptions
eza |
a modern replacement for ls |
Notes
eza is built from a vendor bundle, eza-vendor-<version>.tar.xz, made by ports/fetch with cargo vendor; see Vendoring. The Git status comes from upstream’s default git feature through the git2 crate, which the tree’s environment links against the system libgit2. build.sh checks the binary NEEDs libgit2, so a crate that compiles its bundled copy instead stops the build.