Skip to content

Commit e8e6934

Browse files
committed
Make cabal-install build-type: Simple
1 parent 6cd7bb5 commit e8e6934

File tree

3 files changed

+3
-84
lines changed

3 files changed

+3
-84
lines changed

cabal-install/Setup.hs

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,3 @@
1-
import Distribution.PackageDescription ( PackageDescription )
2-
import Distribution.Simple ( defaultMainWithHooks
3-
, simpleUserHooks
4-
, postBuild
5-
, postCopy
6-
, postInst
7-
)
8-
import Distribution.Simple.InstallDirs ( mandir
9-
, CopyDest (NoCopyDest)
10-
)
11-
import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..)
12-
, absoluteInstallDirs
13-
)
14-
import Distribution.Simple.Utils ( installOrdinaryFiles
15-
, notice )
16-
import Distribution.Simple.Setup ( buildVerbosity
17-
, copyDest
18-
, copyVerbosity
19-
, fromFlag
20-
, installVerbosity
21-
)
22-
import Distribution.Verbosity ( Verbosity )
23-
24-
import System.IO ( openFile
25-
, IOMode (WriteMode)
26-
)
27-
import System.Process ( runProcess )
28-
import System.FilePath ( (</>) )
29-
30-
-- WARNING to editors of this file:
31-
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
-- At this moment (Cabal 1.23), whatever you write here must be
33-
-- compatible with ALL Cabal libraries which we support bootstrapping
34-
-- with. This is because pre-setup-depends versions of cabal-install will
35-
-- build Setup.hs against the version of Cabal which MATCHES the library
36-
-- that cabal-install was built against. There is no way of overriding
37-
-- this behavior without bumping the required 'cabal-version' in our
38-
-- Cabal file. Travis will let you know if we fail to install from
39-
-- tarball!
40-
1+
import Distribution.Simple
412
main :: IO ()
42-
main = defaultMainWithHooks $ simpleUserHooks
43-
{ postBuild = \ _ flags _ lbi ->
44-
buildManpage lbi (fromFlag $ buildVerbosity flags)
45-
, postCopy = \ _ flags pkg lbi ->
46-
installManpage pkg lbi (fromFlag $ copyVerbosity flags) (fromFlag $ copyDest flags)
47-
, postInst = \ _ flags pkg lbi ->
48-
installManpage pkg lbi (fromFlag $ installVerbosity flags) NoCopyDest
49-
}
50-
51-
buildManpage :: LocalBuildInfo -> Verbosity -> IO ()
52-
buildManpage lbi verbosity = do
53-
let cabal = buildDir lbi </> "cabal/cabal"
54-
manpage = buildDir lbi </> "cabal/cabal.1"
55-
manpageHandle <- openFile manpage WriteMode
56-
notice verbosity ("Generating manual page " ++ manpage ++ " ...")
57-
_ <- runProcess cabal ["man","--raw"] Nothing Nothing Nothing (Just manpageHandle) Nothing
58-
return ()
59-
60-
installManpage :: PackageDescription -> LocalBuildInfo -> Verbosity -> CopyDest -> IO ()
61-
installManpage pkg lbi verbosity copy = do
62-
let destDir = mandir (absoluteInstallDirs pkg lbi copy) </> "man1"
63-
installOrdinaryFiles verbosity destDir [(buildDir lbi </> "cabal", "cabal.1")]
3+
main = defaultMain

cabal-install/cabal-install.cabal

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Author: Cabal Development Team (see AUTHORS file)
1818
Maintainer: Cabal Development Team <cabal-devel@haskell.org>
1919
Copyright: 2003-2019, Cabal Development Team
2020
Category: Distribution
21-
Build-type: Custom
21+
Build-type: Simple
2222
Extra-Source-Files:
2323
README.md bash-completion/cabal bootstrap.sh changelog
2424

@@ -126,13 +126,6 @@ Flag lukko
126126
default: True
127127
manual: True
128128

129-
custom-setup
130-
setup-depends:
131-
Cabal >= 2.2,
132-
base,
133-
process >= 1.1.0.1 && < 1.7,
134-
filepath >= 1.3 && < 1.5
135-
136129
executable cabal
137130
main-is: Main.hs
138131
hs-source-dirs: main

cabal-install/cabal-install.cabal.pp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,7 @@
279279
Maintainer: Cabal Development Team <cabal-devel@haskell.org>
280280
Copyright: 2003-2019, Cabal Development Team
281281
Category: Distribution
282-
%if CABAL_FLAG_LIB
283282
Build-type: Simple
284-
%else
285-
Build-type: Custom
286-
%endif
287283
Extra-Source-Files:
288284
README.md bash-completion/cabal bootstrap.sh changelog
289285
@@ -391,16 +387,6 @@
391387
default: True
392388
manual: True
393389
394-
%if CABAL_FLAG_LIB
395-
%else
396-
custom-setup
397-
setup-depends:
398-
Cabal >= 2.2,
399-
base,
400-
process >= 1.1.0.1 && < 1.7,
401-
filepath >= 1.3 && < 1.5
402-
403-
%endif
404390
#
405391
# Libraries, if CABAL_FLAG_LIB
406392
#

0 commit comments

Comments
 (0)