DRI, or Direct Rendering Infrastructure, is a framework that gives direct access to hardware capable of generating graphics for X.org. While Wayland does not use userland DRI, Xwayland that is reponsible for giving X.org application support to Wayland does want the DRI interface. While Xorg-Server and Xwayland want the interface, it doesn't strictly need it if the code for both packages were slightly altered.
Nonetheless, installing the DRI interface is a good idea. DRI comes from Mesa, and there's a few ways to install the interface and necessary headers. You could download the headers, and skip downloading the Mesa tarball. If you already have the tarball downloaded, then installing the files from it may be a better idea.
If you have chosen to install the files from the Mesa tarball, extract it and go into the extracted directory as normal.
After that, install the headers for the interface, as well as some
other expected headers, as the root
user:
install -vDm644 include/GL/internal/dri_interface.h \
-t /usr/include/GL/internal/ &&
install -vDm644 include/EGL/eglmesaext.h \
-t /usr/include/EGL/ &&
install -vDm644 include/EGL/eglext_angle.h \
-t /usr/include/EGL/
Now that interface has been installed, you need the pkg-config file
showing that the interface is present. Create it now as the
root user:
cat > dri.pc << "EOF"
prefix=/usr
includedir=${prefix}/include
dridriverdir=${prefix}/lib/dri
Name: dri
Description: Direct Rendering Infrastructure
Version: MESA_VERSION
Requires.private: libdrm >= 2.4.109
Cflags: -I${includedir}
EOF
sed -i "s/MESA_VERSION/`cat VERSION`/" dri.pc &&
install -vDm644 dri.pc -t /usr/lib/pkgconfig/ &&
rm -vf dri.pc
All the files have now been installed.
If you opted to downloaded the DRI interface from the internet instead, then there is no setup needed before downloading the interface besides ensuring that you have an internet connection, installed make-ca-1.16.1, and ensured Wget-1.25.0 is operational. cURL-8.18.0 can be used instead of Wget if you wish.
The files that will be downloaded come directly from the GitLab/FreeDesktop repository for Mesa from a branch or tag that has the same major and minor version of Mesa that's currently in this book.
Now go ahead and download the interface and other necessary headers
as the root user:
install -vdm755 /usr/include/GL/internal /usr/include/EGL && wget https://gitlab.freedesktop.org/mesa/mesa/-/raw/25.3/include/GL/internal/dri_interface.h \ -O /usr/include/GL/internal/dri_interface.h && wget https://gitlab.freedesktop.org/mesa/mesa/-/raw/25.3/include/EGL/eglmesaext.h \ -O /usr/include/EGL/eglmesaext.h && wget https://gitlab.freedesktop.org/mesa/mesa/-/raw/25.3/include/EGL/eglext_angle.h \ -O /usr/include/EGL/eglext_angle.h
Now that the interface has been installed, you need the pkg-config
file saying that it's present on the system. Create it now as the
root user:
cat > /usr/lib/pkgconfig/dri.pc << "EOF"
prefix=/usr
includedir=${prefix}/include
dridriverdir=${prefix}/lib/dri
Name: dri
Description: Direct Rendering Infrastructure
Version: 25.3.5
Requires.private: libdrm >= 2.4.109
Cflags: -I${includedir}
EOF
Every file has now been downloaded and installed.