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

337.6. opencpn-5.14.0

Chart plotter and navigation for S-57/S-63 ENC and raster charts, AIS and GPS (wxWidgets)

Version 5.14.0, release 2
Shelf gis — GIS, maps, projections, GPS, navigation and location
Phase 44_apps (Applications), 216 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://opencpn.org/
Build time 25.6 SBU
Installed size 77.5 MiB in 631 files
Recipe ports/core/gis/opencpn/kpkgbuild

About

OpenCPN is a chart plotter and navigation program for boats: it draws S-57 and S-63 vector charts and raster charts, takes positions from a GPS and targets from AIS over serial, USB or the network, and plans and follows routes. The port builds it on wxwidgets with its GTK 3 backend and OpenGL, and ships the minimal GSHHS world coastline, the tide and current harmonics and the manual in the package, so it opens a usable chart of the world with no download.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, gettext, git, wxwidgets, gtk3, glib, mesa, libglvnd, glu, glew, libX11, libXrandr, curl, libarchive, libexif, libusb, lz4, openssl, xz, bzip2, zlib, portaudio, libsndfile, rapidjson, shapelib, sqlite, tinyxml, elfutils, eudev, gpsd.

Required by: no port names it.

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

What kpkg does

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

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/gis/opencpn
echo '581d5d1ca80ccb654e3995f0031fdc10ad32d43197ddb250106260e134e4a924  opencpn-5.14.0.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/opencpn
SRC=$SRC_ROOT/opencpn-5.14.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf opencpn-5.14.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:

patch -p1 -i "$PORT_SRC/mdns.patch"
patch -p1 -i "$PORT_SRC/system-shapelib.patch"
patch -p1 -i "$PORT_SRC/openssl4.patch"
patch -p1 -i "$PORT_SRC/udev-rule-destdir.patch"

export LDFLAGS="$LDFLAGS -Wl,--strip-debug"

cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DOCPN_USE_BUNDLED_LIBS=OFF \
	-DOCPN_BUNDLE_GSHHS=ON \
	-DOCPN_BUNDLE_TCDATA=ON \
	-DOCPN_BUNDLE_DOCS=ON \
	-DOCPN_USE_GL=ON \
	-DOCPN_USE_CURL=ON \
	-DOCPN_USE_WEBVIEW=OFF \
	-DOCPN_ENABLE_PORTAUDIO=ON \
	-DOCPN_ENABLE_SNDFILE=ON \
	-DOCPN_USE_UDEV_PORTS=ON \
	-DOCPN_BUILD_TEST=OFF \
	-DOCPN_CI_BUILD=OFF \
	-DCMAKE_IGNORE_PATH='/usr/lib/cmake/glew;/usr/lib64/cmake/glew;/lib/cmake/glew;/lib64/cmake/glew' \
	"-DOCPN_TARGET_TUPLE=kdos;1;$(uname -m)"
cmake --build build
DESTDIR=$PKG cmake --install build

cat > "$PKG/usr/share/applications/opencpn.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=OpenCPN
GenericName=Chart Plotter
Comment=Navigate with electronic charts, GPS and AIS
Exec=opencpn
Icon=opencpn
Terminal=false
StartupWMClass=opencpn
Categories=Education;Science;Geography;Maps;
Keywords=gps;navigation;chart;nautical;marine;boat;ais;enc;
DESKTOP
chmod 644 "$PKG/usr/share/applications/opencpn.desktop"

test -f "$PKG/usr/lib/udev/rules.d/98-sglock-ocpn.rules"

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/opencpn, 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 opencpn-5.14.0-2.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/opencpn, and runs the triggers its paths call for.

Contents

Installed programs: opencpn, opencpn-cmd.

Installed directories: /usr/lib/opencpn, /usr/share/doc/opencpn, /usr/share/licenses/opencpn, /usr/share/opencpn.

Short descriptions

opencpn Chartplotter and GPS Navigation Software
opencpn-cmd Chartplotter and GPS Navigation Software CLI interface

Notes

At start OpenCPN sets GDK_BACKEND=x11 for itself whenever WAYLAND_DISPLAY is set, unless OCPN_DISABLE_X11_GDK_BACKEND is, so on the session it is an X11 window under Xwayland, whose class is the program’s name. The desktop entry is written in build.sh with StartupWMClass=opencpn to match it.