Skip to content

Building from source

Shin Sterneck edited this page Nov 8, 2026 · 1 revision

Linux

Needs Rust 1.85+ (edition 2024) and Qt 6.8 or newer with Qt Quick, Quick Controls, Quick Dialogs, Qt Svg and the QtCore QML module.

# Debian / Ubuntu
sudo apt install qt6-base-dev qt6-declarative-dev qt6-svg-dev qml6-module-qtquick \
  qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtquick-dialogs \
  qml6-module-qtquick-templates qml6-module-qtquick-window qml6-module-qtqml-workerscript \
  qml6-module-qt-labs-folderlistmodel qml6-module-qtqml-models qml6-module-qtcore
# Fedora
sudo dnf install qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qtsvg-devel
# Arch
sudo pacman -S qt6-base qt6-declarative qt6-svg

git clone https://github.com/shinsterneck/stratagram.git && cd stratagram
cargo build --release
./target/release/stratagram [file.stratagram]

CXX-Qt finds Qt through qmake. If it picks up Qt 5 or nothing, point it at Qt 6: export QMAKE=/usr/lib/qt6/bin/qmake (the path varies by distribution, e.g. qmake6 on Fedora).

Passing a file name opens it; if it does not exist yet, Ctrl+S saves to that name.

Menu entry and file type

packaging/ has what a desktop needs, named after the app's ID app.stratagram.Stratagram: the .desktop entry (menu and launchers), the icon, the .stratagram file type and the AppStream metainfo (what GNOME Software and KDE Discover show). The entry runs stratagram from PATH, so install the binary first:

sudo install -Dm755 target/release/stratagram /usr/local/bin/stratagram
# for your user only:
id=app.stratagram.Stratagram
install -Dm644 packaging/$id.desktop ~/.local/share/applications/$id.desktop
install -Dm644 packaging/stratagram.svg ~/.local/share/icons/hicolor/scalable/apps/$id.svg
install -Dm644 packaging/$id.mime.xml ~/.local/share/mime/packages/$id.xml
update-mime-database ~/.local/share/mime
update-desktop-database ~/.local/share/applications
# or system wide: the same under /usr/local/share (with sudo), plus
# packaging/$id.metainfo.xml into share/metainfo/

The file manager then shows .stratagram files as Stratagram diagrams, with its icon, and opens them with Stratagram on a double-click. An older install used the name stratagram for these files; remove stratagram.desktop, stratagram.svg and stratagram.xml from the same places.

Windows

Install Rust (with the MSVC toolchain, through rustup and the Visual Studio Build Tools) and Qt 6.8 for MSVC 2022 64-bit with the Qt online installer, put Qt's bin folder on the PATH (so qmake is found), then:

cargo build --release
mkdir dist; copy target\release\stratagram.exe dist\
windeployqt --release --qmldir qml dist\stratagram.exe   # Qt's DLLs and QML modules next to it

The icon and version details are built into stratagram.exe (build.rs, from packaging/windows/stratagram.ico). For the installer, see Releases and packaging.

The browser editor

rustup target add wasm32-unknown-unknown
cargo binstall wasm-bindgen-cli@0.2.129   # same version as in web/Cargo.toml
web/build.sh                              # builds into web/www/pkg
python3 -m http.server -d web/www 8000    # then open http://localhost:8000

See Browser editor for hosting and embedding it.

The NetBox plugin

netbox-plugin/build.sh builds the plugin's package; see the plugin's README.

Tests

The core has no Qt dependency and is covered by unit tests: cargo test -p stratagram-core.

Clone this wiki locally