Development Guide

Overview

To run locally you should install Zig 0.11.1 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. If you are debugging mepo without runtime dependencies (e.g. mepo -ndc) you may omit this piece.


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 findutils 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:

Base application (Build-dependencies) (mepo):

  • 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

Scripts (Runtime-dependencies) (mepo_scripts):

  • 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
  • Findutils: Used for xargs (-d argument required)
  • Zenity: Used for menuing system & user input
  • Xwininfo: Used for determining zenity dimensions sizing on X

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.