Remove X-Depends-Like from cabal file
..to relax Cabal dependency back to 1.18 (for ghc-7.8)
This commit is contained in:
parent
9804b29aaa
commit
4a6aeadfc1
51
Setup.hs
51
Setup.hs
@ -30,12 +30,8 @@ main :: IO ()
|
||||
main = defaultMainWithHooks $ simpleUserHooks {
|
||||
instHook = inst,
|
||||
copyHook = copy,
|
||||
|
||||
confHook = \(gpd, hbi) cf ->
|
||||
xBuildDependsLike <$> (confHook simpleUserHooks) (gpd, hbi) cf
|
||||
|
||||
, buildHook = \pd lbi hooks flags -> (buildHook simpleUserHooks) pd (patchLibexecdir lbi) hooks flags
|
||||
, hookedPrograms = [ simpleProgram "shelltest" ]
|
||||
buildHook = \pd lbi hooks flags -> (buildHook simpleUserHooks) pd (patchLibexecdir lbi) hooks flags,
|
||||
hookedPrograms = [ simpleProgram "shelltest" ]
|
||||
}
|
||||
|
||||
patchLibexecdir :: LocalBuildInfo -> LocalBuildInfo
|
||||
@ -46,49 +42,6 @@ patchLibexecdir lbi = let
|
||||
in
|
||||
lbi'
|
||||
|
||||
|
||||
xBuildDependsLike :: LocalBuildInfo -> LocalBuildInfo
|
||||
xBuildDependsLike lbi =
|
||||
let
|
||||
cc = componentsConfigs lbi
|
||||
pd = localPkgDescr lbi
|
||||
deps = dependsMap lbi
|
||||
in lbi {
|
||||
componentsConfigs =
|
||||
[ (cn, updateClbi deps comp clbi, cdeps)
|
||||
| (cn, clbi, cdeps) <- cc
|
||||
, let comp = getComponent pd cn
|
||||
]
|
||||
}
|
||||
where
|
||||
updateClbi deps comp clbi = setUnionDeps (otherDeps deps comp) clbi
|
||||
|
||||
-- dependsMap ::
|
||||
-- LocalBuildInfo -> [(ComponentName, ([(UnitId, PackageId)], Map PackageName ModuleRenaming))]
|
||||
dependsMap lbi =
|
||||
second (componentPackageDeps &&& componentPackageRenaming)
|
||||
<$> allComponentsInBuildOrder lbi
|
||||
|
||||
-- otherDeps :: [(ComponentName, ([(UnitId, PackageId)], Map PackageName ModuleRenaming))] -> Component -> ([(UnitId, PackageId)], Map PackageName ModuleRenaming)
|
||||
otherDeps deps comp = fromMaybe ([], M.empty) $
|
||||
flip lookup deps =<< read <$> lookup "x-build-depends-like" fields
|
||||
where
|
||||
fields = customFieldsBI (componentBuildInfo comp)
|
||||
|
||||
setComponentPackageRenaming clbi cprn =
|
||||
clbi { componentPackageRenaming =
|
||||
componentPackageRenaming clbi `M.union` cprn }
|
||||
|
||||
-- setUnionDeps :: ([(UnitId, PackageId)], Map PackageName ModuleRenaming) -> ComponentLocalBuildInfo -> ComponentLocalBuildInfo
|
||||
setUnionDeps (deps, rns) clbi = let
|
||||
clbi' = setComponentPackageRenaming clbi rns
|
||||
cpdeps = componentPackageDeps clbi
|
||||
in
|
||||
clbi' {
|
||||
componentPackageDeps = cpdeps `union` deps
|
||||
}
|
||||
|
||||
|
||||
-- mostly copypasta from 'defaultInstallHook'
|
||||
inst ::
|
||||
PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()
|
||||
|
@ -25,7 +25,7 @@ Description:
|
||||
For more information, please see its home page.
|
||||
|
||||
Category: GHC, Development
|
||||
Cabal-Version: >= 1.24
|
||||
Cabal-Version: >= 1.18
|
||||
Build-Type: Custom
|
||||
Data-Files: elisp/Makefile
|
||||
elisp/*.el
|
||||
@ -95,7 +95,7 @@ Extra-Source-Files: ChangeLog
|
||||
|
||||
Custom-Setup
|
||||
Setup-Depends: base
|
||||
, Cabal >= 1.24 && < 1.25
|
||||
, Cabal >= 1.18 && < 1.25
|
||||
, containers
|
||||
, filepath
|
||||
, directory
|
||||
@ -302,7 +302,49 @@ Test-Suite spec
|
||||
TargetSpec
|
||||
|
||||
Build-Depends: hspec < 2.4 && >= 2.0.0
|
||||
X-Build-Depends-Like: CLibName
|
||||
Build-Depends:
|
||||
base < 5 && >= 4.0
|
||||
, bytestring < 0.11
|
||||
, binary < 0.9 && >= 0.5.1.0
|
||||
, containers < 0.6
|
||||
, cabal-helper < 0.8 && >= 0.7.1.0
|
||||
, deepseq < 1.5
|
||||
, directory < 1.4
|
||||
, filepath < 1.5
|
||||
, ghc < 8.2 && >= 7.6
|
||||
, ghc-paths < 0.2 && >= 0.1.0.9
|
||||
, ghc-syb-utils < 0.3 && >= 0.2.3
|
||||
, hlint < 1.10 && >= 1.9.27
|
||||
, monad-journal < 0.8 && >= 0.4
|
||||
, old-time < 1.2
|
||||
, process < 1.5
|
||||
, syb < 0.7 && >= 0.5.1
|
||||
, temporary < 1.3 && >= 1.2.0.3
|
||||
, transformers < 0.6
|
||||
, time < 1.7
|
||||
, transformers-base < 0.5 && >= 0.4.4
|
||||
, mtl < 2.3 && >= 2.0
|
||||
, monad-control < 1.1 && >= 1
|
||||
, split < 0.3 && >= 0.2.2
|
||||
, haskell-src-exts < 1.20 && >= 1.18
|
||||
, text < 1.3 && >= 1.2.1.3
|
||||
, djinn-ghc < 0.1 && >= 0.0.2.2
|
||||
, fclabels < 2.1 && >= 2.0
|
||||
, extra < 1.6 && >= 1.4
|
||||
, pipes < 4.4 && >= 4.1
|
||||
, safe < 0.4 && >= 0.3.9
|
||||
, optparse-applicative <0.14.0 && >=0.13.0
|
||||
, template-haskell
|
||||
|
||||
if impl(ghc < 7.8)
|
||||
Build-Depends: convertible < 1.2 && >= 1.1.0.0
|
||||
if impl(ghc >= 8.0)
|
||||
Build-Depends: ghc-boot
|
||||
|
||||
Build-Depends:
|
||||
cabal-helper < 0.8 && >= 0.7.1.0
|
||||
, ghc < 8.2 && >= 7.6
|
||||
, ghc-mod
|
||||
|
||||
|
||||
Test-Suite shelltest
|
||||
|
Loading…
Reference in New Issue
Block a user