Skip to content
Tautvydas edited this page Dec 1, 2025 · 16 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 libgbm-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

extra note: if you have some dependencies too old such as xorgproto, you need install manually

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-....

Building and installing input drivers

If you install bare XLibre server it does not contain any input drivers. If you start without it - you keyboard will be ignored and you will be required to use ssh session from other system (the usual crtl-alt-f are ignored!*).

There are two solutions for this problem:

Using input drivers from already installed Xlibre

if you have already installed XLibre server you can copy driver manually (yes it is risk for incompatibilities, but during this document preparation you can use 25.0.0.16 for git master):

You need to copy /usr/lib/xorg/modules/xlibre-25.0/input/libinput_drv.so to <prefix>/lib/xorg/modules/xlibre-25.0/input/) (the path can be slightly different - there can be arch component, for example /usr/lib/x86_64-linux-gnu/xorg/modules/xlibre-25.0/input/libinput_drv.so and similar )

And then you wire configuration, copy /usr/share/X11/xorg.conf.d/*-libinput.conf to <prefix>/share/X11/xorg.conf.d

building xf86-input-libinput

Firstly you need libinput dev headers, for debian/devuan like:

apt install libinput-dev

Then get source:

git clone --depth 2 https://github.com/X11Libre/xf86-input-libinput

Configure source code:

cd xf86-input-libinput
PKG_CONFIG_PATH=<xserver_prefix>/lib64/pkgconfig meson setup build --prefix <xserver_prefix>
cd build
ninja install

for example, configuration can look: PKG_CONFIG_PATH=/usr/local/xlibre/lib/x86_64-linux-gnu/pkgconfig meson setup build --prefix /usr/local/xlibre, if using /usr/local/xlibre as prefix

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".

Installing xorgproto

(WIP)

Depends on your distribution (for example using linux mint mate 22.1), it could be necessary to install xorgproto:

$ git clone --depth 2 https://github.com/X11Libre/xorgproto.git
$ cd xorgproto
$ meson setup build --prefix <xorgproto_prefix>
$ cd build
$ ninja install

The software won't be available automatically, for use you need include installed *.pc files in PKG_CONFIG_PATH envirionment variable, for example PKG_CONFIG_PATH=<xorgproto_prefix>/share/pkgconfig

(WIP) example, if you set xorgproto_prefix to /usr/local/xlibre, your X server configuration will be:

PKG_CONFIG_PATH=/usr/local/xlibre/share/pkgconfig meson setup build --buildtype debugoptimized --prefix /usr/local/xlibre

References

Clone this wiki locally