Skip to content
Sesank Mallikarjuna edited this page Sep 13, 2025 · 14 revisions

This page will describe how to obtain the XLibre Xserver from your distribution and how to build it from source. If you are unsure whether to add something or make a change to this page, just talk about it.

Please bear with us that the content here is a work in progress (WIP). If you already built the XLibre Xserver from source then please feel free to add the missing parts.

Getting the Source

You can either download a release from Releases · X11Libre/xserver or use Git to clone the project sources like so:

git clone https://github.com/X11Libre/xserver.git

Getting the Build Time Dependencies

There are quite a few dependencies that must be available before building the XLibre Xserver. These vary by the distribution you use as shown below. Right now, only the Debian/Devuan dependencies are explicitly known.

Dependencies for XLibre Xserver on Debian/Devuan

apt-get install x11proto-dev xtrans-dev libpixman-1-dev libxkbcommon-x11-dev \
libxfont-dev libxcvt-dev libdrm-dev libepoxy-dev \
x11proto-present-dev x11proto-dev libxkbfile-dev libudev-dev libxshmfence-dev \
libbsd-dev x11proto-xf86dri-dev libgl1-mesa-dev libglu1-mesa-dev \
libglu1-mesa-dev libgl-dev libdrm-dev xutils-dev mesa-common-dev \
libxcb-shape0-dev libxcb-util-dev libxcb-icccm4-dev

Some need to build xorgproto from source as well.

Building from Source

After cloning the Xserver repository or unpacking the sources, change into the source directory and run the Meson build tool:

cd "<source dir of xserver>"
meson setup <prefix> build --buildtype debugoptimized <meson_options>
ninja -C build

You may specify the install <prefix> with for example --prefix="$(pwd)/image" and add build time <meson_options> like so: -Dxnest=false.

note: by default meson build will not be optimized (default it debug build) and in GPU demanding applications could result stutters. It is suggested to use debugoptimized build version instead release for ability to have stack trace during crash

Installing the Built Artifacts

After compiling the sources you can install the compiled binaries by running:

sudo ninja -C build install

After the successful installation you can find the XLibre Xserver at <prefix>/usr/local/bin/X.

WIP To run the Xserver you need some drivers in the <prefix>/usr/local/lib/xorg/modules/xlibre-....

Running the X Server

Shutdown other Xservers, change into the <prefix> directory and create a simple testx.sh file with the following contents:

#!/bin/sh
./bin/X :1 vt8 &
\_pid=$!
sleep 10 && kill $\_pid

You can adjust the :1 vt8 and other options in the testx.sh file as detailed in man Xorg. Make the testx.sh executable and run it:

chmod 0770 testx.sh
./testx.sh

This should give you glorious 10 seconds of a black and beautyful and empty screen. Afterwards the Xserver complains about being killed but there should be no other critical errors for a "test passed".

References

Clone this wiki locally