Updates to support Cabal 2.2 in custom setup; also update stack.yaml.

parent d453ffbf
......@@ -91,6 +91,9 @@ import Distribution.Simple.Utils (
installOrdinaryFile,
notice,
)
#if MIN_VERSION_Cabal(2,2,0)
import Distribution.Types.GenericPackageDescription (lookupFlagAssignment)
#endif
import Distribution.Verbosity (Verbosity, normal)
import System.Directory (
createDirectoryIfMissing,
......@@ -311,8 +314,13 @@ exportQtVersion configFlags localBuildInfo = do
_ -> do
-- Inspect the 'qt4' and 'qt5' package flags.
let flags = configConfigurationsFlags configFlags
qt4Flag = fromMaybe False $ lookup (mkFlagName "qt4") flags
qt5Flag = fromMaybe False $ lookup (mkFlagName "qt5") flags
#if MIN_VERSION_Cabal(2,2,0)
lookupFlag = lookupFlagAssignment
#else
lookupFlag = lookup
#endif
qt4Flag = fromMaybe False $ lookupFlag (mkFlagName "qt4") flags
qt5Flag = fromMaybe False $ lookupFlag (mkFlagName "qt5") flags
qtFlag = if qt4Flag then Just 4 else if qt5Flag then Just 5 else Nothing
when (qt4Flag && qt5Flag) $
dieFn $ concat
......
......@@ -97,6 +97,9 @@ import Distribution.Simple.Utils (die')
import Distribution.Simple.Utils (die)
#endif
import Distribution.Simple.Utils (info, installOrdinaryFile, notice)
#if MIN_VERSION_Cabal(2,2,0)
import Distribution.Types.GenericPackageDescription (lookupFlagAssignment)
#endif
import Distribution.Verbosity (Verbosity, normal)
import System.Directory (
createDirectoryIfMissing,
......@@ -332,8 +335,13 @@ exportQtVersion configFlags localBuildInfo = do
_ -> do
-- Inspect the 'qt4' and 'qt5' package flags.
let flags = configConfigurationsFlags configFlags
qt4Flag = fromMaybe False $ lookup (mkFlagName "qt4") flags
qt5Flag = fromMaybe False $ lookup (mkFlagName "qt5") flags
#if MIN_VERSION_Cabal(2,2,0)
lookupFlag = lookupFlagAssignment
#else
lookupFlag = lookup
#endif
qt4Flag = fromMaybe False $ lookupFlag (mkFlagName "qt4") flags
qt5Flag = fromMaybe False $ lookupFlag (mkFlagName "qt5") flags
qtFlag = if qt4Flag then Just 4 else if qt5Flag then Just 5 else Nothing
when (qt4Flag && qt5Flag) $
dieFn $ concat
......
# This file is part of Qtah.
#
# Copyright 2015-2018 The Qtah Authors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
resolver: lts-10.3
......@@ -9,6 +24,6 @@ packages:
- qtah-generator
extra-deps:
- hoppy-generator-0.5.0
- hoppy-runtime-0.5.0
- hoppy-std-0.5.0
- hoppy-generator
- hoppy-runtime
- hoppy-std
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment