# Note: depends on autoconf
# Note: depends on automake
# Note: depends on pkg-config
# Note: depends on makedepend
# Note: depends on libX11
# Note: depends on glproto
# Note: depends on libdrm
# Note: depends on dri2proto
# Note: depends on libXext
# Note: depends on libXdamage
# Note: depends on libXfixes
# Note: depends on expat
# Note: depends on llvm for building Gallium R300-driver on x86/x86_64
# Note: depends on libtool
# Note: depends on dri3proto
# Note: depends on libxshmfence
# Note: depends on presentproto
# Note: depends on systemd
# Note: depends on bison
# Note: depends on libtool
# Note: depends on autoconf
# Note: depends on libelf
wget -c ftp://ftp.freedesktop.org/pub/mesa/mesa-18.0.1.tar.xz
tar -xJf mesa-18.0.1.tar.xz
cd mesa-18.0.1
sed -i -e '1i#include <nouveau/nouveau.h>' src/mesa/drivers/dri/nouveau/nouveau_screen.c
mkdir -p build
cd build
../configure --prefix="/usr" --sysconfdir="/etc" --enable-gles2 --enable-gbm --with-platforms="x11,wayland,drm"  ||  ../configure --prefix="/usr" --sysconfdir="/etc" --enable-gles2 --enable-gbm  ||  ../configure --prefix="/usr" --sysconfdir="/etc" --enable-gles2
make # Doesn't mind -j#
make install