Either downgrade libxml2, or patch the dt source code like this: Fix to ensure build with libxml2 2.11 where xmlParseEntity is deprecated by victoryforce · Pull Request #14781 · darktable-org/darktable · GitHub
(…or temporarily do export CFLAGS+=" -Wno-error=deprecated-declarations" before running all the cmake commands; clean the build folder first of course)