Installation
To develop a gtk-kn
application, you’ll need:
- The Kotlin/Native toolchain
- The GTK 4 library
Installation steps differ by operating system, so we’ll provide OS-specific installation guidelines in the sections below.
Requirements¶
Linux¶
The gtk-kn
project supports the development of GTK 4 applications using Kotlin/Native on popular Linux distributions.
Continuous integration tests validate bindings for the latest stable versions of Arch Linux, Fedora, openSUSE
Tumbleweed, and Ubuntu LTS. Below, we provide OS-specific guidelines and installation scripts to help you set up the
required dependencies seamlessly.
For each distribution, you can find the relevant installation script embedded here. These scripts automate the installation of all necessary development dependencies:
Arch Linux¶
To set up your environment on Arch Linux, the following script outlines the required packages:
set -e -v
# Update the system and package lists
pacman -Syu --noconfirm
# Install packages without prompts
pacman -S --noconfirm \
libxcrypt-compat \
pkgconf \
jdk17-openjdk \
python-pip \
gcc-multilib \
glib2 \
gobject-introspection \
libadwaita \
gtksourceview5 \
webkitgtk-6.0
# Clean up package cache to reduce image size
pacman -Scc --noconfirm
Fedora¶
For Fedora users, ensure your system is equipped with the following dependencies:
set -e -v
# Update package lists
dnf check-update || true
# Install packages without prompts
dnf install -y \
libxcrypt-compat \
java-17-openjdk-devel \
python3-pip \
gcc \
glib2-devel \
gobject-introspection-devel \
libadwaita-devel \
gtksourceview5-devel \
webkitgtk6.0-devel
# Clean up package lists to reduce image size
dnf clean all
openSUSE Tumbleweed¶
If you are using openSUSE Tumbleweed, refer to the script below for the installation steps:
set -e -v
# Update package lists
zypper refresh
# Install packages without prompts
zypper install -y \
java-17-openjdk-devel \
python3-pip \
gcc \
glib2-devel \
gobject-introspection-devel \
libadwaita-devel \
gtksourceview5-devel \
webkit2gtk4-devel
# Clean up package lists to reduce image size
zypper clean --all
Ubuntu LTS¶
Ubuntu LTS users can install the necessary dependencies using the following script:
set -e -v
# Update package lists
apt-get update
# Install packages without prompts
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-utils \
openjdk-17-jdk-headless \
python3-pip \
gcc-multilib \
libgirepository1.0-dev \
libadwaita-1-dev \
libgtksourceview-5-dev \
libwebkitgtk-6.0-dev
# Clean up package lists
apt-get clean
macOS¶
Support Coming Soon
Currently, bindings are only available for Linux. macOS support is planned, enabling developers to create cross-platform GUI applications that run on both Linux and macOS.
Windows¶
Support Coming Soon
Currently, bindings are only available for Linux. Windows support is planned, allowing for cross-platform GUI applications that run on Linux and Windows.
Editor or Integrated Development Environment (IDE)¶
Any editor or IDE that supports Kotlin can be used. This guide references IntelliJ IDEA for examples.