Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

245.1. imagemagick-7.1.2.33

Converts, edits and composes raster images (provides `convert`)

Version 7.1.2.33, release 1
Shelf image-libs — Raster image formats, codecs, metadata, processing, barcodes, and terminal image output
Phase 43_toolkits (Toolkits), 7 of 344 in build order
Licence ImageMagick
Homepage https://imagemagick.org/
Build time 3.4 SBU
Installed size 19.9 MiB in 186 files
Recipe ports/core/image-libs/imagemagick/kpkgbuild

About

ImageMagick converts, edits and composes raster images from the command line (magick, with convert, mogrify, identify and the other classic names) and through its MagickCore and MagickWand libraries. Many ports depend on it, among them darktable, digikam, libvips and zbar.

Sources

Dependencies

Depends on: libpng, libjpeg-turbo, libtiff, libwebp, giflib, freetype2, fontconfig, libxml2, zlib, bzip2, xz, zstd, libzip, pango, lcms2, libheif, libjxl, libraw, librsvg, libraqm, fftw, openjpeg, openexr, ttf-dejavu, djvulibre, jbigkit.

Required by (22): aview, celestia, celestia-content, converseen, darktable, digikam, fastfetch, flamp, fldigi, flmsg, flrig, gpsman, libvips, lyx, netsurf, noto-emoji, qsstv, satdump, terminus-ttf, tuxpaint, yazi, zbar.

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.

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/43_toolkits/phase.env && kpkg install imagemagick'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/image-libs/imagemagick.

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/image-libs/imagemagick
echo 'd5de335af6ab3d8498912d6befadaf482d43913dbf8424028146590cc5ff9394  imagemagick-7.1.2.33.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/imagemagick
SRC=$SRC_ROOT/imagemagick-7.1.2.33
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf imagemagick-7.1.2.33.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 recipe’s helpers _imver and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure \
	ac_cv_path_PSDelegate=gs \
	--prefix=/usr \
	--sysconfdir=/etc \
	--mandir=/usr/share/man \
	--disable-docs \
	--without-gcc-arch \
	--without-modules \
	--with-threads \
	--with-png \
	--with-jpeg \
	--with-tiff \
	--with-webp \
	--with-zlib \
	--with-bzlib \
	--with-lzma \
	--with-zstd \
	--with-zip \
	--with-xml \
	--with-freetype \
	--with-fontconfig \
	--with-pango \
	--without-x \
	--without-perl \
	--with-fftw \
	--with-djvu \
	--without-dmr \
	--without-fpx \
	--without-gslib \
	--without-gvc \
	--with-heic \
	--with-jbig \
	--with-jxl \
	--with-lcms \
	--without-lqr \
	--with-openexr \
	--with-openjp2 \
	--with-raqm \
	--with-raw \
	--with-rsvg \
	--without-uhdr \
	--without-wmf
make
make DESTDIR=$PKG install
test -z "$(grep '<include' "$PKG/etc/ImageMagick-7/type.xml")"
rm "$PKG"/etc/ImageMagick-7/type-*.xml
test ! -e "$PKG/usr/share/doc/ImageMagick-7/www"

The switches, and why each is set:

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/imagemagick, 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 imagemagick-7.1.2.33-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/imagemagick, and runs the triggers its paths call for.

Contents

Installed programs: Magick++-config, MagickCore-config, MagickWand-config, animate, compare, composite, conjure, convert, display, identify, import, magick, magick-script, mogrify, montage, stream.

Installed libraries: libMagick++-7.Q16HDRI.a, libMagick++-7.Q16HDRI.so, libMagickCore-7.Q16HDRI.a, libMagickCore-7.Q16HDRI.so, libMagickWand-7.Q16HDRI.a, libMagickWand-7.Q16HDRI.so.

Installed directories: /etc/ImageMagick-7, /usr/include/ImageMagick-7, /usr/lib/ImageMagick-7.1.2, /usr/share/ImageMagick-7, /usr/share/licenses/imagemagick.

Short descriptions

ImageMagick.pc ImageMagick - convert, edit, and compose images (ABI Q16HDRI)
ImageMagick-7.Q16HDRI.pc ImageMagick - convert, edit, and compose images (ABI Q16HDRI)
Magick++.pc Magick++ - C++ API for ImageMagick (ABI Q16HDRI)
Magick++-7.Q16HDRI.pc Magick++ - C++ API for ImageMagick (ABI Q16HDRI)
MagickCore.pc MagickCore - C API for ImageMagick (ABI Q16HDRI)
MagickCore-7.Q16HDRI.pc MagickCore - C API for ImageMagick (ABI Q16HDRI)
MagickWand.pc MagickWand - C API for ImageMagick (ABI Q16HDRI)
MagickWand-7.Q16HDRI.pc MagickWand - C API for ImageMagick (ABI Q16HDRI)

Notes

Fonts. /etc/ImageMagick-7/type.xml is the one font table ImageMagick reads, and it includes no other, so every font ImageMagick names comes from fontconfig, which --with-fontconfig builds in. magick -list font lists every face the system has, and -font DejaVu-Sans or a file path selects one.

A PostScript base name is no font here: -font Helvetica stops with unable to read font. Liberation-Sans, Liberation-Serif and Liberation-Mono, metric-compatible with Helvetica, Times and Courier, are the names to use instead.

configure writes an include into type.xml for each upstream table whose font directory it finds or is given, and make install installs every table (type-apple.xml, type-dejavu.xml, type-ghostscript.xml, type-urw-base35.xml, type-urw-base35-type1.xml and type-windows.xml) whether type.xml includes it or not. build.sh deletes them: with no include they are read by nothing, and each names font files that no port installs, so a reader of /etc/ImageMagick-7 would take them for fonts the system has. It first checks that type.xml holds no <include, and the build fails if it does: configure finds a font directory by the files in it, and a tree that gained one would otherwise ship a type.xml naming a table the package no longer has.

type-dejavu.xml is not a table of DejaVu faces: it maps the PostScript base names (Helvetica, Times-Roman, AvantGarde-Book and the rest) to URW base-35 files such as NimbusSans-Regular.ttf, which no port installs. The recipe therefore passes no --with-dejavu-font-dir, and none of the directories configure searches for it exists here.

Upstream’s release numbers carry a hyphen before the last field, which a KDOS version may not (see kpkgbuild). The recipe’s version is the dotted form, and the _imver helper rebuilds the hyphenated one for the source URL.