Files
FlatLaf/flatlaf-natives/flatlaf-natives-linux
Karl Tauber 9e8b8697d1
Some checks failed
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled
Error Prone / error-prone (push) Has been cancelled
Native Libraries / Natives (macos-latest) (push) Has been cancelled
Native Libraries / Natives (ubuntu-24.04-arm) (push) Has been cancelled
Native Libraries / Natives (ubuntu-latest) (push) Has been cancelled
Native Libraries / Natives (windows-latest) (push) Has been cancelled
System File Chooser: Linux: show file dialog in dark if current FlatLaf theme is dark (PR #988)
2025-12-02 14:11:10 +01:00
..
2025-06-13 14:33:54 +02:00

FlatLaf Linux Native Library

This sub-project contains the source code for the FlatLaf Linux native library.

The native library can be built only on Linux and requires a C++ compiler.

The native library is available for following CPU architectures: x86_64 (or amd64) and arm64 (or aarch64).

To be able to build FlatLaf on any platform, and without C++ compiler, the pre-built native libraries are checked into Git at flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/.

The native libraries were built on a GitHub server with the help of GitHub Actions. See: Native Libraries workflow. Then the produced Artifacts ZIP was downloaded and the native library checked into Git.

Development

To build the library on Linux, some packages needs to be installed:

  • build-essential - GCC and development tools
  • libxt-dev - X11 toolkit development headers
  • libgtk-3-dev - GTK 3 toolkit development headers
  • g++-aarch64-linux-gnu - GNU C++ compiler for the arm64 architecture (only on x86_64 Linux for cross-compiling for arm64 architecture)

Ubuntu

sudo apt-get update
sudo apt-get install build-essential libxt-dev libgtk-3-dev

Cross-compile for arm64 architecture on x86_64 Linux

Only needed on x86_64 Linux if you want cross-compile for arm64 architecture:

sudo apt-get install g++-aarch64-linux-gnu

Download libgtk-3.so for arm64 architecture:

cd flatlaf-natives/flatlaf-natives-linux/lib/aarch64
wget --no-verbose https://ports.ubuntu.com/pool/main/g/gtk%2b3.0/libgtk-3-0_3.24.18-1ubuntu1_arm64.deb
ar -x libgtk-3-0_3.24.18-1ubuntu1_arm64.deb data.tar.xz
tar -xvf data.tar.xz --wildcards --to-stdout "./usr/lib/aarch64-linux-gnu/libgtk-3.so.0.*" > libgtk-3.so
rm libgtk-3-0_3.24.18-1ubuntu1_arm64.deb data.tar.xz

Fedora

sudo dnf group install c-development
sudo dnf install libXt-devel gtk3-devel

CentOS

sudo yum install libXt-devel gtk3-devel