Cabal 2.0 & 2.2 compatibility
Cabal 2.0 & 2.2 compatibility

Cabal 2.0 (included in GHC 8.2) made various internal changes mandating
components to be passed in various places, Macros.generate being one of
them. In our case, it is okay to use the main library component for
dependency generation.

Additionally, in Cabal 2.2 Distribution.PackageDescription.Parse was
removed, so we switch to using .Parsec instead for 2.2.

Since Cabal 2.0 was introduced with GHC 8.2, we still need to support
Cabal 1.2x, so do some CPP magic for it.

This commit fixes the rest of #1287 and part of #1312.

Signed-off-by: Apollon Oikonomopoulos <ed81ed0a45ccd5c8869bda52e38353a6299ee39e@debian.org>

mbakke/ganeti,ganeti/ganeti,ganeti/ganeti,mbakke/ganeti,ganeti/ganeti,mbakke/ganeti