Qt6 is a whole new library. There's no way I'm going to try to build a Qt5 app with it. There's a 0% chance it would build. So I went through the trouble of figuring out how to apply those patches.
The link above is to a confusing web tool, but I eventually figured out that you can download the patches. Both of them are identical, so only one is needed. But the patch can't be applied to Qt5 automatically, so you'll have to manually edit the file.
If you downloaded the "qt-everywhere-src-5.15.2" archive, the file to patch is:
qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
Somewhere before the line that says QT_BEGIN_NAMESPACE, insert this line:
#include <CoreGraphics/CGColorSpace.h>
Then configure without qtwebengine:
./configure -opensource -confirm-license -skip qtwebengine && make -j 8