minigui

minigui is an experimental library for creating graphical user interfaces from Gleam (Erlang target) using a native external C port.

Status / scope

Note: on Linux the minigui binary links against GTK3, so the system must have GTK3 available at runtime (common on desktops; on minimal servers you may need to install packages).

The goal is to keep a small, stable API in Gleam, while enabling native per-platform backends.

Releases / publishing

See the checklist: RELEASING.md

Installation (Gleam Packages)

gleam add minigui

“Build-dependency-free” (precompiled binary)

To avoid requiring your users to install a C compiler or headers (libx11-dev, etc.), minigui is designed to use a precompiled executable as a bridge (a port) and download it automatically into priv/ on first use.

By default it builds the URL like this:

https://github.com/Aztekode/minigui/releases/download/v<version>/<asset>

Where <version> comes from the package vsn (e.g. 0.1.0) and <asset> depends on the OS/architecture, for example:

You can override the download base with:

MINIGUI_RELEASE_BASE_URL="https://github.com/Aztekode/minigui/releases/download/v0.1.1"

If you prefer an exact link like .../minigui.exe, you can set the full URL:

MINIGUI_PORT_URL="https://github.com/Aztekode/minigui/releases/download/v0.1.1/minigui.exe"

Security/cache options:

Runtime requirement: a “full” Erlang/OTP installation that includes the standard inets + ssl applications (they usually ship with OTP; on some Linux distros they may be split into separate packages).

Protocolo (v1)

The port is opened with open_port(..., [{packet, 2}, binary, ...]).

Build (Linux)

Requirements: gcc, make, pkg-config, libgtk-3-dev, Erlang/OTP, gleam.

Tested with Gleam v1.17.0.

make port
gleam build
make demo

If you’re in an environment without an X server (CI/headless), force simulated mode:

MINIGUI_HEADLESS=1 make demo

Build (Windows)

  1. Compile the port:
make port
  1. Run the demo:
gleam build
gleam run -m demo

Note: the Win32 code is inside #ifdef _WIN32.

Search Document