// Building a custom Mesa on Ubuntu 20.04 Pinebookpro !! EXPERIMENTAL !! If something breaks don't blame me :) Make backups before making any major changes =========================================================== // Used the following latest image // https://github.com/ayufan-rock64/linux-build/releases // On Ubuntu 20.04 // Install mesa-utils and mesa-utils-extra apt-get install mesa-utils mesa-utils-extra // Following Mesa related packages are installed on Pinebookpro libegl-mesa0 libegl1-mesa-dev libgl1-mesa-dev libgl1-mesa-dri libglapi-mesa libgles2-mesa-dev libglu1-mesa libglu1-mesa-dev libglx-mesa0 mesa-utils mesa-utils-extra // apt-mark hold the above packages so we don't overwrite them next time // apt-get updates packages apt-mark hold libegl-mesa0 libegl1-mesa-dev libgl1-mesa-dev libgl1-mesa-dri libglapi-mesa libgles2-mesa-dev libglu1-mesa libglu1-mesa-dev libglx-mesa0 mesa-utils mesa-utils-extra // We also need to install some dependencies - not all are needed but I included most that I have used so far on Ubuntu 20.04 apt-get install build-essential apt-get install cmake apt-get install libaio-dev libbluetooth-dev libbrlapi-dev libbz2-dev apt-get install libcap-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev apt-get install libsasl2-dev libsdl1.2-dev libseccomp-dev libsnappy-dev libssh2-1-dev libvde-dev libvdeplug-dev libxen-dev liblzo2-dev valgrind xfslibs-dev libnfs-dev libiscsi-dev apt-get install meson python3-mako libdrm-dev libzstd-dev bison flex libwayland-egl-backend-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-0-dev libxcb-dri3-de libxcb-present-dev libxshmfence-dev llvm llvm-10-dev // Lets move onto building Mesa mkdir $HOME/mesa cd $HOME/mesa git clone https://gitlab.freedesktop.org/mesa/mesa -b master cd mesa mkdir build cd build meson .. . -Dri-drivers= -Dvulkan-drivers= -Dgallium-drivers=panfrost,kmsro sudo ninja install // Now comes the dirty hack sudo su cd /usr/lib/aarch64-linux-gnu/ mkdir OLD mv dri/ OLD/ mv libEGL* OLD/ mv libGL.so* OLD/ mv libGLESv* OLD/ mv libgbm.so.1* OLD/ mv libglapi.so.0* OLD/ cp -rv /usr/local/lib/aarch64-linux-gnu/dri/ /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/libEGL* /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/libGL.so* /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/libGLESv* /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/libgbm.so* /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/libglapi.so* /usr/lib/aarch64-linux-gnu/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/dri.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/egl.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/gbm.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/gl.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/glesv1_cm.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ cp /usr/local/lib/aarch64-linux-gnu/pkgconfig/glesv2.pc /usr/lib/aarch64-linux-gnu/pkgconfig/ // Reboot reboot // Verify that we are using new libs glxinfo | grep OpenGL OpenGL vendor string: Panfrost OpenGL renderer string: Mali T860 (Panfrost) OpenGL version string: 2.1 Mesa 20.2.0-devel (git-31392f8371) OpenGL shading language version string: 1.20 OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.2.0-devel (git-31392f8371) OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 OpenGL ES profile extensions: // We should be done now // Check with minetest sudo apt-get install minetest minetest ----------------------------------------------------------------------------------- // -- This breaks the already installed MESA-DEV headers -- // make sure you make backups // For future builds of other software please copy over the // corresponding includes // headers from /usr/local/include/ relevant to MESA should proably be also copied // EGL GL GLES GLES2 GLES3 KHR sudo su cd /usr/include mkdir OLD mv EGL OLD mv GL OLD mv GLES2 OLD mv GLES3 OLD mv KHR OLD cp -rv /usr/local/include/EGL . cp -rf /usr/local/include/GL . cp -rf /usr/local/include/GLES2 . cp -rf /usr/local/include/GLES3 . cp -rf /usr/local/include/KHR . References: https://panfrost.freedesktop.org/building-panfrost-mesa.html