@kooper there is now a well tested and widely used solution called xlibe. https://discuss.haiku-os.org/t/xlibe-an-xlib-x11-compatibility-layer-for-haiku/
https://depot.haiku-os.org/#!/pkg/xlibe/haikuports/haikuports_x86_64/0/3/3/-/1/x86_64
You can just install it from depot or use it as a dependency in an hpkg recipe or whatever you need.