Cabal 2.0 support

This commit is contained in:
Michael Snoyman 2017-07-31 09:54:56 +03:00
parent e027652494
commit a4eee30930
No known key found for this signature in database
GPG Key ID: A048E8C057E86876
3 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,7 @@
## 1.5.2.4
* Cabal 2.0 support
## 1.5.2.3
* Fix race condition which leads dev server to stay in compilation mode. [#1380](https://github.com/yesodweb/yesod/issues/1380)

View File

@ -255,7 +255,11 @@ getAvailableFlags :: D.GenericPackageDescription -> Set.Set String
getAvailableFlags =
Set.fromList . map (unFlagName . D.flagName) . D.genPackageFlags
where
#if MIN_VERSION_Cabal(2, 0, 0)
unFlagName = D.unFlagName
#else
unFlagName (D.FlagName fn) = fn
#endif
-- | This is the main entry point. Run the devel server.
devel :: DevelOpts -- ^ command line options
@ -276,9 +280,20 @@ devel opts passThroughArgs = do
#else
cabal <- D.findPackageDesc "."
#endif
#if MIN_VERSION_Cabal(1, 20, 0)
gpd <- D.readGenericPackageDescription D.normal cabal
#else
gpd <- D.readPackageDescription D.normal cabal
#endif
let pd = D.packageDescription gpd
D.PackageIdentifier (D.PackageName packageName) _version = D.package pd
D.PackageIdentifier packageNameWrapped _version = D.package pd
#if MIN_VERSION_Cabal(2, 0, 0)
packageName = D.unPackageName packageNameWrapped
#else
D.PackageName packageName = packageNameWrapped
#endif
-- Which file contains the code to run
develHsPath <- checkDevelFile

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.5.2.3
version: 1.5.2.4
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>