Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ md5CheckGenericPackageDescription proxy = md5Check proxy

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
0x78979713e08179ab070d6ab10cd5ef6c
0x481d5ad67f456246ab2ac06b3aab554f
2 changes: 2 additions & 0 deletions Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ buildOptionsFromConfigFlags verbosity cfg comp = do
, exeCoverage = False
, libCoverage = False
, relocatable = fromFlagOrDefault False $ configRelocatable cfg
, programPrefix = flagToMaybe $ configProgPrefix cfg
, programSuffix = flagToMaybe $ configProgSuffix cfg
}

-- | Adjust 'LBC.BuildOptions' to be compatible with the given 'Compiler' and
Expand Down
6 changes: 6 additions & 0 deletions Cabal/src/Distribution/Types/LocalBuildConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ data BuildOptions = BuildOptions
-- ^ Whether to enable library program coverage
, relocatable :: Bool
-- ^ Whether to build a relocatable package
, programPrefix :: Maybe PathTemplate
-- ^ Installed executable prefix
, programSuffix :: Maybe PathTemplate
-- ^ Installed executable suffix
}
deriving (Eq, Generic, Read, Show)

Expand Down Expand Up @@ -229,4 +233,6 @@ buildOptionsConfigFlags (BuildOptions{..}) =
, configStripExes = toFlag stripExes
, configStripLibs = toFlag stripLibs
, configDebugInfo = toFlag withDebugInfo
, configProgPrefix = maybeToFlag programPrefix
, configProgSuffix = maybeToFlag programSuffix
}
8 changes: 8 additions & 0 deletions Cabal/src/Distribution/Types/LocalBuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ module Distribution.Types.LocalBuildInfo
, libCoverage
, extraCoverageFor
, relocatable
, programPrefix
, programSuffix
, ..
)

Expand Down Expand Up @@ -188,6 +190,8 @@ pattern LocalBuildInfo
-> Bool
-> [UnitId]
-> Bool
-> Maybe PathTemplate
-> Maybe PathTemplate
-> LocalBuildInfo
pattern LocalBuildInfo
{ configFlags
Expand Down Expand Up @@ -227,6 +231,8 @@ pattern LocalBuildInfo
, libCoverage
, extraCoverageFor
, relocatable
, programPrefix
, programSuffix
} =
NewLocalBuildInfo
{ localBuildDescr =
Expand Down Expand Up @@ -279,6 +285,8 @@ pattern LocalBuildInfo
, exeCoverage
, libCoverage
, relocatable
, programPrefix
, programSuffix
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,8 @@ elaborateInstallPlan
, relocatable = perPkgOptionFlag pkgid False packageConfigRelocatable
, withProfLibDetail = elabProfExeDetail
, withProfExeDetail = elabProfLibDetail
, programPrefix = elabProgPrefix
, programSuffix = elabProgSuffix
}
okProfDyn = profilingDynamicSupportedOrUnknown compiler
profExe = perPkgOptionFlag pkgid False packageConfigProf
Expand Down
10 changes: 10 additions & 0 deletions changelog.d/hooks-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
synopsis: Add program prefix and suffix to `BuildOptions`
packages: [Cabal, Cabal-hooks]
prs: 11787
issues: 11168
---

Two new fields of `BuildOptions`, `programPrefix` and `programSuffix`, have
been added. This allows the installed executable program prefix and suffix to
be set by `SetupHooks` for packages with `build-type: Hooks`.
Loading