cabal-read: make compatible with Cabal >=3.0.0

This commit is contained in:
tv 2020-12-01 23:11:59 +01:00
parent 08e9db31d6
commit 2982772052

View file

@ -5,6 +5,7 @@ writeHaskellPackage "cabal-read" {
executables.ghc-options = {
extra-depends = ["Cabal"];
text = /* haskell */ ''
{-# LANGUAGE CPP #-}
module Main (main) where
import Data.List
import Data.Maybe
@ -26,6 +27,9 @@ writeHaskellPackage "cabal-read" {
case lookup (mkUnqualComponentName name) (condExecutables desc) of
Just exe ->
putStrLn . intercalate " " . fromMaybe [] . lookup GHC
#if MIN_VERSION_Cabal(3,0,0)
. perCompilerFlavorToList
#endif
. options . buildInfo . condTreeData $ exe
Nothing ->