Installation
suit targets Scala Native and renders through SDL3, so there are three things to have in place: the Scala Native toolchain, the native SDL3 libraries, and the suit sources themselves.
suit targets Scala Native and renders through SDL3, so there are three things to have in place: the Scala Native toolchain, the native SDL3 libraries, and the suit sources themselves.
suit is in active development and is not yet published to Maven Central. You build and run it from the repository checkout. The sections below describe that workflow; published artifacts and a one-line dependency will come once the API stabilises.
Requirements
- Scala 3 with sbt
- The
sbt-scala-nativeandsbt-scala-native-crossprojectplugins - LLVM/Clang (the Scala Native toolchain)
- The SDL3, Cairo, and FreeType shared libraries on your system
Install the native libraries
suit’s runtime links against system libraries via @link: SDL3 (window, input, present,
through the sdl3 bindings), Cairo (the drawing engine), and
FreeType (font loading). On macOS with Homebrew:
brew install sdl3 cairo
Cairo depends on FreeType, so Homebrew pulls it in alongside. On Linux, install the SDL3, Cairo, and FreeType development packages from your distribution (or build them from source).
Get the sources
suit depends on two sibling repositories, both checked out next to it:
- riposte — supplies the
vdomcore. suit consumes its JVM and Native cross-targets as a source dependency (vdomJVM/vdomNative), because those targets are not published; onlyvdom.jsis on Central. - sdl3, libcairo, and freetype — the SDL3, Cairo, and FreeType bindings, pulled from Maven Central.
git clone https://github.com/edadma/riposte.git
git clone https://github.com/edadma/suit.git
The expected layout is the two repos side by side:
dev/
├── riposte/ # provides vdomJVM / vdomNative (source dependency)
└── suit/ # this repo
suit’s build.sbt references riposte by relative path:
.jvmConfigure(_.dependsOn(ProjectRef(file("../riposte"), "vdomJVM")))
.nativeConfigure(_.dependsOn(ProjectRef(file("../riposte"), "vdomNative")))
and pulls SDL3 from Central:
.nativeSettings(
libraryDependencies ++= Seq(
"io.github.edadma" %%% "sdl3" % "0.2.3",
"io.github.edadma" %%% "libcairo" % "0.0.4",
"io.github.edadma" %%% "freetype" % "0.0.4",
),
)
Verify the setup
Run the headless layout suite on the JVM — it needs no window, no device, and no native toolchain, because the layout engine is pure Scala:
sbt suitJVM/test
Then build the native demo and run it (see the quick start):
sbt suitNative/run
If a window opens showing the widget demo, the toolchain and SDL3 are wired correctly.