Development Guide

Overview

To run locally you should install Zig 0.13.0 locally along with SDL2, SDL2_ttf, SDL2_image, SDL2_gfx, libcurl. Then, to build & run locally run:

  • export PATH="$PATH:$(realpath $(pwd))/scripts"
  • zig build run

Note, the above command altering path puts the scripts in scripts/ in $PATH which mepo's default configuration assumes.


Setup on Alpine Linux

Alpine Linux build dependencies:

apk add curl-dev sdl2-dev sdl2_image-dev sdl2_ttf-dev sdl2_gfx-dev

Alpine Linux runtime dependencies (X):

apk add zenity jq xwininfo curl ncurses

Code Style

Run all files through zig fmt:

scriptsdev/mepo_dev_zigfmt.sh

Packaging Information

Package maintainers should take note of the following dependencies:

Build Dependencies:

  • Zig: Used to compile core application logic
  • Zig Standard Library: Used to build out core application logic
  • SDL2: Used for rendering graphics
  • SDL2_image: Used for loading PNG data
  • SDL2_gfx: Used for drawing (diagonal) antialiased lines
  • SDL2_ttf: Used for displaying TrueType fonts
  • Libcurl: Used for parallel downloading of tiles

Runtime Dependencies:

  • Busybox (or coreutils): Used for base shell & provide tools for scripts
  • Curl: Used to fetch data from webservers
  • Jq: Used for parsing JSON data structures from external sources
  • Ncurses: Use for tput/colorizing scripts
  • Zenity: Used for menuing system & user input
  • Xwininfo: Used for determining zenity dimensions sizing on X

Optional Runtime Dependencies:

  • Mobroute: Used for Mobroute (offline GTFS routing) script

The Alpine Linux package is the canonical example package maintained by Miles Alan, the application developer and can be seen here. The flatpak may also be used as a reference for understanding packaging in a generic way.