This post is more about direction (draft) on how to and less about solution (perhaps). At the same it is based on the fact that I wasn’t sure (relatively) on why we are getting to this destination:
And I forgot to add sudo -H up front of the related command (please correct me any time when I’m lost), which is also irrelevant from now on and here:
Kind of self-explanation of above is here:
sudo apt install mesa-utils
glxinfo | grep "Mesa" −− will show us OpenGL version of 2.1.
But anyway and although I wasn’t getting such error output(s) we will rather follow this guide: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux and install packages that might be currently missing on Librem 5, while purposely related:
sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo apt install aptitude −− while my PureOS installation needed so.
sudo aptitude install g++ −− for C++. Accept …? First answer is no, second one is Yes.
NOTE: install gcc (instead of g++) if you are going to use C (see link to the related video below).
Those packages below we will need to install soon (please continue reading):
apt list libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev libglu1-mesa-dev libgles2-mesa-dev libgbm-dev
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev libglu1-mesa-dev libgles2-mesa-dev libgbm-dev
apt list libgl1-mesa-dev libwayland-dev libxkbcommon-dev libglfw3-wayland wayland-protocols
sudo apt install libgl1-mesa-dev libwayland-dev libxkbcommon-dev libglfw3-wayland wayland-protocols
sudo apt update
apt list xorg-dev −− probably installed already.
Before we start to implement above PureOS packages:
python3 -m pip uninstall raylib −− would be needed if raylib-2.6.0 successfully installed - but it wasn’t.
sudo python3 -m pip uninstall raylib
pip3 show raylib −− should not be found.
mkdir myraylib
cd myraylib
git clone https://github.com/raysan5/raylib.git raylib
−− please use WiFi connection= 368.43MiB download+.
Let us now install above selected packages with sudo apt ... and afterwards continue from here:
cd raylib
mkdir build && cd build
apt list cmake
sudo -H cmake -DSHARED=ON -DSTATIC=ON ..
sudo -H make PLATFORM=PLATFORM_DRM
sudo -H make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_21 -B
sudo -H make install RAYLIB_LIBTYPE=SHARED
cd ..
cd examples
sudo -H make core/core_basic_window PLATFORM=PLATFORM_DRM -B
sudo -H make core/core_basic_window PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_21 -B
cd core
./core_basic_window
Hope that this post here helps (as have few other things to do on my list today)! Also and only if commands under
~/myraylib/raylib/build did not help (not sure any more) you should switch to
~/myraylib/raylib/src and repeat (
as I’m requesting your feedback kindly):
sudo -H make PLATFORM=PLATFORM_DRM
sudo -H make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_21 -B
sudo -H make install RAYLIB_LIBTYPE=SHARED
Inspiration for this post and some sources:
https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi#user-content-compiling-raylib-source-code
https://github.com/raysan5/raylib/issues/706
https://www.youtube.com/watch?v=R0jsXG4xahM
https://mesamatrix.net/
In addition I executed (but probably not relevant):
sudo apt purge python2.7-minimal