Open noughtmare opened 3 months ago
I think this is sadly not compatible with some newer versions of cabal, and perhaps also not with some older versions. Do we have a policy on which cabal versions we want to support?
Edit: Since this option is only meant for developers of UUAGC, perhaps it is reasonable to only support a single cabal version.
I am a bit hesitant here. I agree that in principle using Cabal functionality instead of CPP is much nicer, but unfortunately the Cabal API is not exactly stable. There is no explicit policy, but I suspect that most use of UUAGC is to build old code (with potentially old versions of the tooling), so I think backwards compatibility is more important than future compatibility.
Also, it is not entirely true that the build-from-source option is only intended for developers; it is (was?) also used for others that want to build from source, for example in the Debian package.
However, I am not a cabal user myself, so I don't have an active setup to test either.
As a reference, this is an uncommitted file from my computer which I used to build the release tar using stack
....
# Hack, not sure how the -D can be passed to setup
sed -i 's/#ifdef EXTERNAL_UUAGC/#ifndef FOOBAR/' Setup.hs
stack build --ghc-options="-DEXTERNAL_UUAGC"
sed -i 's/#ifndef FOOBAR/#ifdef EXTERNAL_UUAGC/' Setup.hs
Fixes #17