Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mpickering committed Sep 25, 2023
1 parent 6bd0f24 commit 6ee4530
Show file tree
Hide file tree
Showing 31 changed files with 584 additions and 96 deletions.
6 changes: 5 additions & 1 deletion Cabal-syntax/src/Distribution/Types/BuildType.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ data BuildType
Make
| -- | uses user-supplied @Setup.hs@ or @Setup.lhs@ (default)
Custom
| -- |
Hooks

deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)

instance Binary BuildType
instance Structured BuildType
instance NFData BuildType where rnf = genericRnf

knownBuildTypes :: [BuildType]
knownBuildTypes = [Simple, Configure, Make, Custom]
knownBuildTypes = [Simple, Configure, Make, Custom, Hooks]

instance Pretty BuildType where
pretty = Disp.text . show
Expand All @@ -49,6 +52,7 @@ instance Parsec BuildType where
"Configure" -> return Configure
"Custom" -> return Custom
"Make" -> return Make
"Hooks" -> return Hooks
"Default" -> do
v <- askCabalSpecVersion
if v <= CabalSpecV1_18 -- oldest version needing this, based on hackage-tests
Expand Down
1 change: 1 addition & 0 deletions Cabal-syntax/src/Distribution/Types/Library.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Distribution.Types.BuildInfo
import Distribution.Types.LibraryName
import Distribution.Types.LibraryVisibility
import Distribution.Types.ModuleReexport
import Distribution.Types.BuildInfo

import qualified Distribution.Types.BuildInfo.Lens as L

Expand Down
1 change: 1 addition & 0 deletions Cabal-syntax/src/Distribution/Types/PackageDescription.hs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ allBuildDepends = targetBuildDepends <=< allBuildInfo
enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency]
enabledBuildDepends spec pd = targetBuildDepends =<< enabledBuildInfos spec pd

-- Look at
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
updatePackageDescription (mb_lib_bi, exe_bi) p =
p
Expand Down
1 change: 1 addition & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ library
Distribution.Simple.Test.Log
Distribution.Simple.UHC
Distribution.Simple.UserHooks
Distribution.Simple.SetupHooks
Distribution.Simple.Utils
Distribution.TestSuite
Distribution.Types.AnnotatedId
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ checkFields pkg =
PackageDistInexcusable ZPrefix
, check (isNothing (buildTypeRaw pkg) && specVersion pkg < CabalSpecV2_2) $
PackageBuildWarning NoBuildType
, check (isJust (setupBuildInfo pkg) && buildType pkg /= Custom) $
, check (isJust (setupBuildInfo pkg) && buildType pkg `notElem` [Custom, Hooks]) $
PackageBuildWarning NoCustomSetup
, check (not (null unknownCompilers)) $
PackageBuildWarning (UnknownCompilers unknownCompilers)
Expand Down
Loading

0 comments on commit 6ee4530

Please sign in to comment.