Long story, short: build against Qt4 ! Else you'll run into the Open GL ES include issue.
The basic instructions are available at https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Linux/UNIX. This includes getting the dependencies for the project, using:
$ ./scripts/uni-get-dependencies.sh
But, checking the dependencies with:
$ ./scripts/check-dependencies.sh
shows errors. I had to manually install a few more packages. Basic method:
$ sudo apt-get install *name_of_missing_package*
will give you every packet with a name containing what you are looking for, just pick the right one (usually lib_something-dev). Go on until no error are given by the check-dependencies script as well as:
$ qmake-qt4 openscad.pro
Last step: I removed multimedia from the required package in openscad.pro. For this, open openscad.pro in your favorite text editor, look for "multimedia" and remove it.
Working with a 4GB version of the Pi 4, I disabled swap (sudo swapoff -a) and allowed up-to 3 parallel compile.
$ make -j 3 2>&1 | tee make.log
If everything went OK, you can run openscad directly from here (aka the build directory), or, better, install it machine-wide with:
$ sudo make install
And that's it. Please be aware that this will install things in /usr/local/.
That's it ! Faster said than done !