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

335.3. octave-11.3.0

MATLAB-compatible numerical computing, with its Qt 6 desktop

Version 11.3.0, release 1
Shelf math — Mathematics applications and libraries: computer algebra, arbitrary precision, solvers, calculators, statistics and plotting apps
Phase 44_apps (Applications), 286 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://octave.org/
Build time 24.3 SBU
Installed size 82.4 MiB in 1975 files
Recipe ports/core/math/octave/kpkgbuild

About

GNU Octave is a numerical computing language largely compatible with MATLAB, with an interpreter for the terminal and a Qt 6 desktop (octave --gui) that has a QScintilla editor, a variable browser and plot windows. Figures are drawn by its qt graphics toolkit, an OpenGL widget, and printed to PDF, EPS and SVG through gl2ps; gnuplot is the second graphics toolkit, run as a separate program.

Sources

Dependencies

Depends on: gcc, openblas, suitesparse, arpack-ng, qrupdate, sundials, fftw, glpk, qhull, hdf5, curl, openssl, pcre2, readline, ncurses, zlib, bzip2, rapidjson, graphicsmagick, libsndfile, portaudio, freetype2, fontconfig, libglvnd, mesa, glu, gl2ps, qt6-qtbase, qt6-qttools, qt6-qt5compat, qscintilla, wayland, texinfo, gnuplot, ghostscript, perl, bison, flex, gperf.

Required by: no port names it.

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.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 octave'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/math/octave.

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/math/octave
echo '2b80f3149b2de6d1f4f2fcb4fe6515a17eb363b52111bf57b90f37bf6f5e12e1  octave-11.3.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/octave
SRC=$SRC_ROOT/octave-11.3.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf octave-11.3.0.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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/abs.patch"
patch -p1 -i "$PORT_SRC/app-id.patch"

./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
	--infodir=/usr/share/info --mandir=/usr/share/man \
	--localstatedir=/var \
	--enable-shared \
	--disable-static \
	--disable-rpath \
	--disable-java \
	--enable-openmp \
	--enable-fftw-threads \
	--enable-rapidjson \
	--enable-readline \
	--with-qt=6 \
	--with-blas=-lopenblas \
	--with-lapack=-lopenblas \
	--with-magick=GraphicsMagick++ \
	--with-openssl \
	--without-fltk \
	--without-x \
	--with-wayland-client
for m in HAVE_UMFPACK HAVE_CHOLMOD HAVE_CXSPARSE HAVE_KLU HAVE_SPQR \
	HAVE_ARPACK HAVE_QRUPDATE HAVE_FFTW3 HAVE_FFTW3F HAVE_GLPK HAVE_QHULL \
	HAVE_SUNDIALS HAVE_SUNDIALS_SUNLINSOL_KLU HAVE_HDF5 HAVE_MAGICK \
	HAVE_SNDFILE HAVE_PORTAUDIO HAVE_CURL HAVE_RAPIDJSON HAVE_RAPIDJSON_PRETTYWRITER HAVE_QSCINTILLA \
	HAVE_GL2PS_H HAVE_QT6 HAVE_OPENGL HAVE_FREETYPE HAVE_FONTCONFIG \
	HAVE_READLINE; do
	grep -q "^#define $m 1" config.h || { echo "octave: configure left out $m" >&2; exit 1; }
done
make
make DESTDIR=$PKG install

ls "$PKG"/usr/libexec/octave/$version/exec/*/octave-gui >/dev/null
test -e "$PKG"/usr/share/info/octave.info
rm -rf "$PKG"/usr/share/octave/$version/etc/tests

cat > "$PKG/usr/share/applications/org.octave.Octave.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=GNU Octave
GenericName=Numerical Computing
Comment=Interactive programming environment for numerical computations
TryExec=octave
Exec=octave --gui %f
Icon=octave
Terminal=false
StartupNotify=false
StartupWMClass=org.octave.Octave
Categories=Education;Science;Math;
MimeType=text/x-octave;text/x-matlab;
Keywords=science;math;matrix;numerical;computation;plotting;matlab;octave;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.octave.Octave.desktop"
test -e "$PKG"/usr/share/icons/hicolor/48x48/apps/octave.png

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

Contents

Installed programs: mkoctfile, mkoctfile-11.3.0, octave, octave-11.3.0, octave-cli, octave-cli-11.3.0, octave-config, octave-config-11.3.0.

Installed directories: /usr/include/octave-11.3.0, /usr/lib/octave, /usr/libexec/octave, /usr/share/licenses/octave, /usr/share/octave.

Short descriptions

mkoctfile Compile dynamic-load modules for GNU Octave
octave A high-level interactive programming language for numerical computations
octave-cli A high-level interactive programming language for numerical computations
octave-config GNU Octave component and library information retrieval
octave.pc C++ interface to GNU Octave underlying library.
octinterp.pc C++ interface to GNU Octave interpreter.
octmex.pc C interface (MEX) to GNU Octave interpreter.

Notes

Octave’s configure answers a missing optional library with a warning and builds without the functions it backs, so after the configure build.sh checks config.h for the HAVE_ macro of each library in its loop and stops on the first that is missing. The loop covers suitesparse (UMFPACK, CHOLMOD, CXSparse, KLU, SPQR, for sparse algebra), arpack-ng (eigs), qrupdate, fftw in both precisions, glpk, qhull (convhulln, delaunayn), sundials with KLU (ode15s, ode15i), hdf5 (save -hdf5), GraphicsMagick, libsndfile and portaudio (audioread, audioplayer), curl (urlread, webread), RapidJSON, QScintilla, gl2ps, Qt 6, OpenGL, FreeType, Fontconfig and readline. A dependency added to depends without a line in that loop can be dropped by the configure unnoticed.

The tarball carries the manual already built, as Info, HTML, PDF and a Qt help collection, and it is installed as it is; build.sh checks that octave.info and the octave-gui program were installed. It removes the test files under /usr/share/octave/<version>/etc/tests.

The desktop entry is KDOS’s own, written over upstream’s for StartupWMClass=org.octave.Octave, and the file is named after it, which is the only name KWin looks a window’s icon up by. That desktop file name is also every Octave window’s Wayland app id. Upstream sets it in the main window’s constructor, after the first-run welcome wizard has already opened under the executable’s name, octave-gui, so the wizard’s window would match no entry and show no icon; app-id.patch sets it when the application object is made, before any window exists.