Thanks for the report!
I can reproduce the problem and the proposed fix is, I think, correct.
Indeed it fails for all supported compiler versions when I pass -fcurl
to cabal build.
Please note that building with -fcurl is no longer necessary and we
recommend to build without this flag nowadays.
+ msg22444 title: darcs-2.16.1 fails to build on ghc-8.8:: PACKAGE_VERSION is not defined -> building with -fcurl fails: PACKAGE_VERSION is not defined