aboutsummaryrefslogtreecommitdiff
path: root/cabal-helper.cabal
blob: 2e7edc11c17b447059d9cf31bfb5fcb89b039146 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name:                cabal-helper
version:             0.7.3.0
synopsis:            Simple interface to some of Cabal's configuration state used by ghc-mod
description:
    @cabal-helper@ provides a library which wraps the internal use of an
    executable to lift the restrictions imposed by linking against versions of
    GHC before @7.10@. This has the pleasant side effect of isolating the user
    from having to deal with Cabal version changes manually as @cabal-helper@
    can simply recompile it's helper program automatically as needed.
    .
    @cabal-helper@ uses a wrapper executable to compile the actual cabal-helper
    executable at runtime while linking against an arbitrary version of
    Cabal. This runtime-compiled helper executable is then used to extract
    various bits and peices from Cabal\'s on disk state (dist/setup-config)
    written by it's configure command.
    .
    In addition to this the wrapper executable also supports installing any
    version of Cabal from hackage in case it cannot be found in any available
    package database. The wrapper installs these instances of the Cabal library
    into a private package database so as to not interfere with the user's
    packages.
    .
    Furthermore the wrapper supports one special case namely reading a state
    file for Cabal itself. This is needed as Cabal compiles it's Setup.hs using
    itself and not using any version of Cabal installed in any package database.
    .
    @cabal-helper@ can compile with @Cabal >= 1.14@ but requires @Cabal >= 1.16@
    at runtime.

license:             AGPL-3
license-file:        LICENSE
author:              Daniel Gröber <dxld@darkboxed.org>
maintainer:          dxld@darkboxed.org
category:            Distribution
build-type:          Custom
cabal-version:       >=1.10
extra-source-files:  README.md
                     CabalHelper/Main.hs
                     CabalHelper/Licenses.hs

source-repository head
  type:     git
  location: https://github.com/DanielG/cabal-helper.git

Custom-Setup
  Setup-Depends:         base
                       , Cabal >= 1.14 && < 1.25
                       , containers
                       , filepath
                       , directory
                       , process
                       , template-haskell
                       , transformers

library
  exposed-modules:     Distribution.Helper
  other-modules:       Paths_cabal_helper
                     , CabalHelper.Types
                     , CabalHelper.Sandbox
  default-language:    Haskell2010
  ghc-options:         -Wall
  build-depends:       base          < 5    && >= 4.5
                     , Cabal         < 1.25 && >= 1.14
                     , directory     < 1.4  && >= 1.1.0.2
                     , filepath      < 1.5  && >= 1.3.0.0
                     , transformers  < 0.6  && >= 0.3.0.0
                     , mtl           < 2.3  && >= 2.0
                     , process       < 1.5  && >= 1.1.0.1
                     , ghc-prim

executable cabal-helper-wrapper
  default-language:    Haskell2010
  other-extensions:    TemplateHaskell
  main-is:             CabalHelper/Wrapper.hs
  other-modules:       Paths_cabal_helper
                       CabalHelper.Types
                       CabalHelper.Common
                       CabalHelper.GuessGhc
                       CabalHelper.Data
                       CabalHelper.Compile
                       CabalHelper.Log
                       CabalHelper.Sandbox
  ghc-options:         -Wall
  x-internal:          True
  build-depends:       base             < 5    && >= 4.5
                     , Cabal            < 1.25 && >= 1.14
                     , bytestring       < 0.11 && >= 0.9.2.1
                     , directory        < 1.4  && >= 1.1.0.2
                     , filepath         < 1.5  && >= 1.3.0.0
                     , transformers     < 0.6  && >= 0.3.0.0
                     , mtl              < 2.3  && >= 2.0
                     , process          < 1.5  && >= 1.1.0.1
                     , temporary        < 1.3  && >= 1.2.0.4
                     , utf8-string      < 1.1  && >= 1.0.1.1

                     , template-haskell
                     , ghc-prim

test-suite spec
  default-language:    Haskell2010
  type:                exitcode-stdio-1.0
  main-is:             Spec.hs
  other-modules:       CabalHelper.Common
                       CabalHelper.Compile
                       CabalHelper.Data
                       CabalHelper.Log
                       CabalHelper.Sandbox
                       CabalHelper.Types
                       Distribution.Helper
                       Paths_cabal_helper
  hs-source-dirs:      tests, .
  ghc-options:         -Wall
  build-tools:         cabal
  build-depends:       base             < 5    && >= 4.5
                     , Cabal            < 1.26 && >= 1.14
                     , bytestring       < 0.11 && >= 0.9.2.1
                     , directory        < 1.4  && >= 1.1.0.2
                     , filepath         < 1.5  && >= 1.3.0.0
                     , transformers     < 0.6  && >= 0.3.0.0
                     , mtl              < 2.3  && >= 2.0
                     , process          < 1.5  && >= 1.1.0.1
                     , temporary        < 1.3  && >= 1.2.0.4
                     , utf8-string      < 1.1  && >= 1.0.1.1

                     -- additional test deps
                     , extra            < 1.6  && >= 1.4.10
                     , unix             < 2.8  && >= 2.5.1.0

                     , template-haskell
                     , ghc-prim
                     , cabal-helper

-- TODO: Use cabal_macros.h to replace -D flags by including it in
-- CabalHelper.Data
--
-- executable cabal-helper-main
--   if flag(dev)
--     buildable:         True
--   else
--     buildable:         False
--   default-language:    Haskell2010
--   default-extensions:  NondecreasingIndentation
--   main-is:             CabalHelper/Main.hs
--   other-modules:
--   ghc-options:         -Wall -fno-warn-unused-imports -optP-DCABAL_MAJOR=1 -optP-DCABAL_MINOR=25 -optP-DCABAL_HELPER=1 -optP-DCABAL_HELPER_DEV=1
--   build-depends:       base
--                      , Cabal
--                      , containers
--                      , bytestring
--                      , filepath
--                      , directory
--
-- flag dev
--   description: Build development components
--   default:     False
--   manual:      True