OK so I had a day spare and a laptop spare which I've just installed GhostBSD 25 onto so thought I'd try and build Code::Blocks 25.03. Specifically I have GhostBSD 25.02-R14.3p2 and while it does have Code::Blocks 20 available in its package repository I wanted something newer.
I didn't do a full build log but half-way through I thought I'd write some notes in case anyone else wanted to do this too.
Set up the build environment
Need to install the autotools and development tools (I wasn't sure exactly which packages so I just installed all the dev tools which is probably excessive). Note that installing "gcc" will bring in GCC version 13 which will fail to compile because it complains about precompiled headers so I had to remove that and use "gcc15". I think these are all the packages you will need from a fresh install (as root/sudo):
pkg install autotools
pkg install -g 'GhostBSD*-dev'
pkg remove gcc13
pkg install gcc15
Now its necessary to build wx32-gtk from the Ports tree (I don't think the one available as a package has the config tool but maybe it does and this step is not necessary?)
pkg install ports
cd /usr/ports/x11-toolkits/wxgtk32
sudo make
sudo make install
Finally add a symlink in /usr/local/bin so wx-config points to the right place:
sudo ln -s /usr/local/bin/wxgtk3u-3.2-config /usr/local/bin/wx-config
That should be enough to get the build environment set up and now you can follow the build instructions (i.e., ./bootstrap then ./configure, etc.,) in the CB README, however, the build will fail because of an issue around fontconfig.h not being found and also because the linker can't find the correct location of the kvm libraries. As far as I can tell this is because GhostBSD (perhaps also other BSDs) keep these in a slightly different location (i.e., /lib instead of /usr/lib for kvm). I managed to get around these issues in a slightly kludgy way but it did work.
fontconfig.h
I found out after I'd done this that there is a post about this on the forum which is probably a better solution and it would probably be better to modify the Makefile include path, however, I was impatient to carry on building so I simply changed the source file in:
src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffontmanager.cpp
so that the included file was the full path: "/usr/local/include/fontconfig/fontconfig.h"
kvm
I get an error from the linker when building clangd_client so I changed the Makefile in:
src/plugins/contrib/clangd_client so that WX_LIBS has the flags "-L/lib -lkvm":
WX_LIBS = -L/lib -lkvm -L/usr/local/lib ....etc...
And doing all that got me a mostly working build of Code::Blocks...at least as far as I can tell it works, I haven't done any in-depth testing yet but will do that soon. I say "mostly" working because a couple of the toolbars appear to have missing icons (also in GhostBSD which is using MATE changing the toolbar icon size doesn't actually change the size of the buttons, just the size of the graphics within the buttons).
I'll attach a screenshot if anyone has any suggestions as to where the icons have gone?