337.7. viking-1.11
GPS track, waypoint and route manager on maps, with MBTiles and gpsd (GTK 3)
| Version | 1.11, release 2 |
| Shelf | gis — GIS, maps, projections, GPS, navigation and location |
| Phase | 44_apps (Applications), 217 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://sourceforge.net/projects/viking/ |
| Build time | 1.0 SBU |
| Installed size | 5.6 MiB in 74 files |
| Recipe | ports/core/gis/viking/kpkgbuild |
About
Viking manages GPS data on maps: it reads, edits and writes tracks, waypoints and routes in GPX and KML itself, draws them over OpenStreetMap and other tile layers, and follows a live position from gpsd. GeoJSON and the formats GPSBabel converts go through external programs it runs from the path, togeojson, togpx and gpsbabel, and none of the three is a port. The port builds its GTK 3 interface. Maps work offline from MBTiles files and from the tile cache it keeps of what it has downloaded.
Sources
viking-1.11.tar.bz2(5.6 MiB)
sha256fe21d5c111ef20877d1cd95b1a4bc34faae9dd3a17bac923f418e1271a3cfc91
upstream: https://downloads.sourceforge.net/viking/viking-1.11.tar.bz2
archive copy: sources-2/gis--viking-1.11.tar.bz2
Dependencies
Depends on: pkgconf, intltool, itstool, gettext, libintl, gtk3, glib, gdk-pixbuf, json-glib, curl, expat, zlib, bzip2, xz, libzip, sqlite, nettle, file, gexiv2, geoclue, gpsd, libnova, libX11, libxslt, docbook-xsl.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
nettle4.patch— Moves Viking’s MD5 from nettle’smd5-compat.hto nettle’s own interface,nettle/md5.h:struct md5_ctxwithmd5_init(),md5_update()andmd5_digest()insrc/md5_hash.c, and the same header in the check in the generatedconfigure. The tree’s nettle installs nomd5-compat.h, and configure stops at that check without the patch.
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 viking'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/gis/viking.
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/viking
echo 'fe21d5c111ef20877d1cd95b1a4bc34faae9dd3a17bac923f418e1271a3cfc91 viking-1.11.tar.bz2' | 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/viking
SRC=$SRC_ROOT/viking-1.11
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf viking-1.11.tar.bz2 -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/nettle4.patch"
export CFLAGS="$CFLAGS -g0"
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib \
--disable-gtk2 \
--disable-deprecations \
--disable-bing \
--disable-google \
--disable-terraserver \
--disable-expedia \
--enable-openstreetmap \
--disable-osm-auth \
--disable-oauth \
--disable-bluemarble \
--disable-geonames \
--disable-geocaches \
--disable-dem24k \
--enable-geoclue \
--enable-geotag \
--enable-realtime-gps-tracking \
--enable-bzip2 \
--enable-magic \
--enable-mbtiles \
--enable-zip \
--enable-xz \
--enable-nettle \
--disable-mapnik \
--enable-nova
make
make DESTDIR=$PKG install
install -Dm644 viking-128.png "$PKG/usr/share/icons/hicolor/128x128/apps/viking.png"
install -Dm644 org.viking.Viking.appdata.xml "$PKG/usr/share/metainfo/org.viking.Viking.appdata.xml"
cat > "$PKG/usr/share/applications/viking.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Viking
GenericName=GPS Data Manager
Comment=Manage GPS tracks, waypoints and routes on maps
Exec=viking %F
Icon=viking
Terminal=false
StartupWMClass=viking
Categories=GTK;Science;Geography;Maps;Education;
Keywords=gps;gpx;kml;track;waypoint;route;map;mbtiles;
DESKTOP
chmod 644 "$PKG/usr/share/applications/viking.desktop"
The switches, and why each is set:
--disable-gtk2— Builds the GTK 3 interface; upstream’s default, named.--disable-deprecations— Upstream’s default, named: no extra-D…_DISABLE_DEPRECATEDdefinitions that make the build warn about deprecated GLib and GTK calls.--disable-bing,--disable-google,--disable-terraserver,--disable-expedia,--disable-bluemarble,--disable-geonames,--disable-geocaches,--disable-dem24k— Leave out map, search and download sources that are online services or need an account: Bing and Google maps, Terraserver and Expedia imagery, NASA’s Blue Marble, GeoNames search, the geocache acquire tool, and the USGS 24k DEM download, which also needs adem24k.plscript on the path. Bing, Google, Blue Marble and GeoNames are on by default upstream.--enable-openstreetmap— The OpenStreetMap tile layers and search, upstream’s default.--disable-osm-auth,--disable-oauth— No authenticated OpenStreetMap access for uploading traces, and no OAuth 1.0a support, which needs liboauth, not a port. Both are off by default upstream.--enable-geoclue— Asks geoclue for the machine’s position.--enable-geotag— Geotags photographs and reads their positions, through gexiv2.--enable-realtime-gps-tracking— Follows a live position from gpsd; configure stops ifgps.hor libgps is missing.--enable-bzip2,--enable-magic,--enable-mbtiles,--enable-zip,--enable-xz— Opening bzip2-, zip- and xz-compressed files, file-type detection through libmagic from file, and MBTiles map files through SQLite.--enable-nettle— MD5 through nettle, which Viking uses only to name the thumbnail files of geotagged images;nettle4.patchis what lets it build.--enable-nova— Sunrise, sunset and moon-phase data through libnova.--disable-mapnik— No Mapnik rendering layer, which is on by default; Mapnik is not a port.-g0— Viking’ssrc/Makefile.amandsrc/icons/Makefile.amput-ginAM_CFLAGS, which automake places beforeCFLAGS;-g0at the end ofCFLAGScancels it (see What kpkg does around build.sh).
Each --enable- above is also upstream’s default, named. Each that needs a library stops configure with an error when the library is missing, except zip support, which configure turns off with only a warning when pkg-config finds no libzip of the version it asks for.
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/viking, 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 viking-1.11-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/viking, and runs the triggers its paths call for.
Contents
Installed programs: viking.
Installed directories: /usr/share/help/C/viking, /usr/share/licenses/viking, /usr/share/viking.
Short descriptions
viking |
program to manage GPS data |
Notes
The manual page, viking.1, is generated from the DocBook help with xsltproc --nonet and the DocBook stylesheets’ http://docbook.sourceforge.net/… URL, which resolves offline through the XML catalog of docbook-xsl. Both that and libxslt are in depends for the page.
Upstream’s install does not put viking-128.png or org.viking.Viking.appdata.xml in place; they are only in its distribution archive, and build.sh installs them. The desktop entry is written in build.sh with StartupWMClass=viking, the Wayland app_id GTK 3 takes from the program’s name.