306.3. aview-1.3.0rc1
ASCII art image browser and FLI/FLC player for the terminal
| Version | 1.3.0rc1, release 1 |
| Shelf | graphics — Graphics applications: painting, vector, photo development and management, image viewers, screenshot and image optimisers |
| Phase | 44_apps (Applications), 223 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://aa-project.sourceforge.net/aview/ |
| Build time | 0.1 SBU |
| Installed size | 85.0 KiB in 6 files |
| Recipe | ports/core/graphics/aview/kpkgbuild |
About
aview draws a picture as ASCII art in the terminal through aalib, with keys for zoom, contrast, brightness and gamma; aaflip beside it plays FLI and FLC animations the same way. aview reads only PNM images, and asciiview, the shell front end installed with the two programs, converts any other format to a grey PGM before handing it over.
Why it is in KDOS
The comment above it in script/phases/44_apps/packages.d/graphics.txt:
The aa-project's image/FLI browser. Its asciiview front end shells out to ImageMagick's
magick, since IM7 does not build the legacyconvertname.
Sources
aview-1.3.0rc1.tar.gz(53.0 KiB)
sha25642d61c4194e8b9b69a881fdde698c83cb27d7eda59e08b300e73aaa34474ec99
upstream: https://downloads.sourceforge.net/project/aa-project/aview/1.3.0rc1/aview-1.3.0rc1.tar.gz
archive copy: sources-2/graphics--aview-1.3.0rc1.tar.gz
Dependencies
Depends on: aalib, bash, imagemagick.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
imagemagick7.patch— Makesasciiviewtrymagick "<file>" -colorspace gray pgm:-first, before upstream’sanytopnmandconvert, and names all three in the failure message.magickis imagemagick 7’s own command and is independs; theconvertit installs is a compatibility link tomagick, andanytopnmis netpbm’s, which is not independs.
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 aview'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/graphics/aview.
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/graphics/aview
echo '42d61c4194e8b9b69a881fdde698c83cb27d7eda59e08b300e73aaa34474ec99 aview-1.3.0rc1.tar.gz' | 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/aview
SRC=$SRC_ROOT/aview-1.3.0rc1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf aview-1.3.0rc1.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:
patch -p1 -i $PORT_SRC/imagemagick7.patch
export CFLAGS="$CFLAGS -Wno-implicit-function-declaration -Wno-implicit-int \
-Wno-int-conversion -Wno-incompatible-pointer-types \
-Wno-return-mismatch -Wno-declaration-missing-parameter-type"
./configure --prefix=/usr \
--mandir=/usr/share/man
make
make DESTDIR=$PKG install
The switches, and why each is set:
-Wno-implicit-function-declaration,-Wno-implicit-int,-Wno-int-conversion,-Wno-incompatible-pointer-types,-Wno-return-mismatch,-Wno-declaration-missing-parameter-type— Turn back into warnings the old-style C that GCC 14 and later reject. Theconfigurescript is generated by autoconf 2.13, and its compiler test,main(){return(0);}, is such C: without these switches configure decides the compiler cannot create executables (seeC compiler cannot create executables). The exportedCFLAGSreach the compile of aview’s own sources as well.
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/aview, 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 aview-1.3.0rc1-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/aview, and runs the triggers its paths call for.
Contents
Installed programs: aaflip, asciiview, aview.
Installed directories: /usr/share/licenses/aview.
Short descriptions
asciiview |
An high quality ascii-art image(pgm) browser |
aview |
An high quality ascii-art image(pgm) browser |
Notes
asciiview converts with whatever is on PATH. anytopnm comes from netpbm, which is a port but not in depends; with it installed, magick is still tried first.