Commit 38795a96 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix the register --gen-pkg-config flag

When specified without any file name it is supposed to use
a default file name rather than be ignored completely.
parent 44e72e86
......@@ -58,8 +58,9 @@ import Distribution.Simple.Compiler
import Distribution.Simple.Program (ConfiguredProgram, programPath,
programArgs, rawSystemProgram,
lookupProgram, ghcPkgProgram)
import Distribution.Simple.Setup (RegisterFlags(..), CopyDest(..),
fromFlag, fromFlagOrDefault)
import Distribution.Simple.Setup
( RegisterFlags(..), CopyDest(..)
, fromFlag, fromFlagOrDefault, flagToMaybe )
import Distribution.PackageDescription (PackageDescription(..),
BuildInfo(..), Library(..))
import Distribution.Package
......@@ -111,7 +112,7 @@ register pkg_descr lbi regFlags
let distPref = fromFlag $ regDistPref regFlags
isWindows = case buildOS of Windows -> True; _ -> False
genScript = fromFlag (regGenScript regFlags)
genPkgConf = isJust (fromFlag (regGenPkgConf regFlags))
genPkgConf = isJust (flagToMaybe (regGenPkgConf regFlags))
genPkgConfigDefault = display (packageId pkg_descr) <.> "conf"
genPkgConfigFile = fromMaybe genPkgConfigDefault
(fromFlag (regGenPkgConf regFlags))
......
......@@ -750,7 +750,7 @@ defaultRegisterFlags :: RegisterFlags
defaultRegisterFlags = RegisterFlags {
regPackageDB = NoFlag,
regGenScript = Flag False,
regGenPkgConf = Flag Nothing,
regGenPkgConf = NoFlag,
regInPlace = Flag False,
regDistPref = Flag defaultDistPref,
regVerbosity = Flag normal
......
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