Skip to content

Commit a64b9ae

Browse files
committed
Create Cabal-syntax for .cabal parsing and types
1 parent 0986d13 commit a64b9ae

File tree

187 files changed

+1008
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+1008
-711
lines changed

Cabal-QuickCheck/Cabal-QuickCheck.cabal

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ library
1313
build-depends:
1414
, base
1515
, bytestring
16-
, Cabal ^>=3.7.0.0
17-
, QuickCheck ^>=2.13.2 || ^>=2.14
16+
, Cabal ^>=3.7.0.0
17+
, Cabal-syntax ^>=3.7.0.0
18+
, QuickCheck ^>=2.13.2 || ^>=2.14
1819

1920
if !impl(ghc >= 8.0)
2021
build-depends: semigroups

Cabal-described/Cabal-described.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ library
1212
build-depends:
1313
, base
1414
, Cabal ^>=3.7.0.0
15+
, Cabal-syntax ^>=3.7.0.0
1516
, containers
1617
, pretty
1718
, QuickCheck

Cabal-syntax/Cabal-syntax.cabal

+251
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
cabal-version: >=1.10
2+
name: Cabal-syntax
3+
version: 3.7.0.0
4+
copyright: 2003-2021, Cabal Development Team (see AUTHORS file)
5+
license: BSD3
6+
license-file: LICENSE
7+
author: Cabal Development Team <[email protected]>
8+
maintainer: [email protected]
9+
homepage: http://www.haskell.org/cabal/
10+
bug-reports: https://github.com/haskell/cabal/issues
11+
synopsis: A library for working with .cabal files
12+
description:
13+
This library provides tools for reading and manipulating the .cabal file
14+
format.
15+
category: Distribution
16+
build-type: Simple
17+
18+
extra-source-files:
19+
README.md ChangeLog.md
20+
21+
source-repository head
22+
type: git
23+
location: https://github.com/haskell/cabal/
24+
subdir: Cabal-syntax
25+
26+
flag bundled-binary-generic
27+
default: False
28+
29+
library
30+
default-language: Haskell2010
31+
hs-source-dirs: src
32+
33+
build-depends:
34+
array >= 0.4.0.1 && < 0.6,
35+
base >= 4.6 && < 5,
36+
bytestring >= 0.10.0.0 && < 0.12,
37+
containers >= 0.5.0.0 && < 0.7,
38+
deepseq >= 1.3.0.1 && < 1.5,
39+
directory >= 1.2 && < 1.4,
40+
filepath >= 1.3.0.1 && < 1.5,
41+
mtl >= 2.1 && < 2.3,
42+
parsec >= 3.1.13.0 && < 3.2,
43+
pretty >= 1.1.1 && < 1.2,
44+
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1),
45+
time >= 1.4.0.1 && < 1.13,
46+
-- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity
47+
-- See also https://github.com/ekmett/transformers-compat/issues/35
48+
transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6)
49+
50+
if flag(bundled-binary-generic)
51+
build-depends: binary >= 0.5.1.1 && < 0.7
52+
else
53+
build-depends: binary >= 0.7 && < 0.9
54+
55+
if os(windows)
56+
build-depends: Win32 >= 2.3.0.0 && < 2.13
57+
else
58+
build-depends: unix >= 2.6.0.0 && < 2.8
59+
60+
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
61+
if impl(ghc >= 8.0)
62+
ghc-options: -Wcompat -Wnoncanonical-monad-instances
63+
64+
if impl(ghc <8.8)
65+
ghc-options: -Wnoncanonical-monadfail-instances
66+
67+
if !impl(ghc >= 8.0)
68+
-- at least one of lib:Cabal's dependency (i.e. `parsec`)
69+
-- already depends on `fail` and `semigroups` transitively
70+
build-depends: fail == 4.9.*, semigroups >= 0.18.3 && < 0.20
71+
72+
if !impl(ghc >= 7.10)
73+
build-depends: void >= 0.7.3 && < 0.8
74+
75+
if !impl(ghc >= 7.8)
76+
-- semigroups depends on tagged.
77+
build-depends: tagged >=0.8.6 && <0.9, bytestring-builder >= 0.10.8 && <0.11
78+
79+
exposed-modules:
80+
Distribution.Backpack
81+
Distribution.CabalSpecVersion
82+
Distribution.Compat.Binary
83+
Distribution.Compat.CharParsing
84+
Distribution.Compat.DList
85+
Distribution.Compat.Exception
86+
Distribution.Compat.Graph
87+
Distribution.Compat.Lens
88+
Distribution.Compat.MonadFail
89+
Distribution.Compat.Newtype
90+
Distribution.Compat.NonEmptySet
91+
Distribution.Compat.Parsing
92+
Distribution.Compat.Prelude
93+
Distribution.Compat.Semigroup
94+
Distribution.Compat.Typeable
95+
Distribution.Compiler
96+
Distribution.FieldGrammar
97+
Distribution.FieldGrammar.Class
98+
Distribution.FieldGrammar.FieldDescrs
99+
Distribution.FieldGrammar.Newtypes
100+
Distribution.FieldGrammar.Parsec
101+
Distribution.FieldGrammar.Pretty
102+
Distribution.Fields
103+
Distribution.Fields.ConfVar
104+
Distribution.Fields.Field
105+
Distribution.Fields.Lexer
106+
Distribution.Fields.LexerMonad
107+
Distribution.Fields.ParseResult
108+
Distribution.Fields.Parser
109+
Distribution.Fields.Pretty
110+
Distribution.InstalledPackageInfo
111+
Distribution.License
112+
Distribution.ModuleName
113+
Distribution.Package
114+
Distribution.PackageDescription
115+
Distribution.PackageDescription.Configuration
116+
Distribution.PackageDescription.FieldGrammar
117+
Distribution.PackageDescription.Parsec
118+
Distribution.PackageDescription.PrettyPrint
119+
Distribution.PackageDescription.Quirks
120+
Distribution.PackageDescription.Utils
121+
Distribution.Parsec
122+
Distribution.Parsec.Error
123+
Distribution.Parsec.FieldLineStream
124+
Distribution.Parsec.Position
125+
Distribution.Parsec.Warning
126+
Distribution.Pretty
127+
Distribution.SPDX
128+
Distribution.SPDX.License
129+
Distribution.SPDX.LicenseExceptionId
130+
Distribution.SPDX.LicenseExpression
131+
Distribution.SPDX.LicenseId
132+
Distribution.SPDX.LicenseListVersion
133+
Distribution.SPDX.LicenseReference
134+
Distribution.System
135+
Distribution.Text
136+
Distribution.Types.AbiDependency
137+
Distribution.Types.AbiHash
138+
Distribution.Types.Benchmark
139+
Distribution.Types.Benchmark.Lens
140+
Distribution.Types.BenchmarkInterface
141+
Distribution.Types.BenchmarkType
142+
Distribution.Types.BuildInfo
143+
Distribution.Types.BuildInfo.Lens
144+
Distribution.Types.BuildType
145+
Distribution.Types.Component
146+
Distribution.Types.ComponentId
147+
Distribution.Types.ComponentName
148+
Distribution.Types.ComponentRequestedSpec
149+
Distribution.Types.CondTree
150+
Distribution.Types.Condition
151+
Distribution.Types.ConfVar
152+
Distribution.Types.Dependency
153+
Distribution.Types.DependencyMap
154+
Distribution.Types.ExeDependency
155+
Distribution.Types.Executable
156+
Distribution.Types.Executable.Lens
157+
Distribution.Types.ExecutableScope
158+
Distribution.Types.ExposedModule
159+
Distribution.Types.Flag
160+
Distribution.Types.ForeignLib
161+
Distribution.Types.ForeignLib.Lens
162+
Distribution.Types.ForeignLibOption
163+
Distribution.Types.ForeignLibType
164+
Distribution.Types.GenericPackageDescription
165+
Distribution.Types.GenericPackageDescription.Lens
166+
Distribution.Types.HookedBuildInfo
167+
Distribution.Types.IncludeRenaming
168+
Distribution.Types.InstalledPackageInfo
169+
Distribution.Types.InstalledPackageInfo.Lens
170+
Distribution.Types.InstalledPackageInfo.FieldGrammar
171+
Distribution.Types.LegacyExeDependency
172+
Distribution.Types.Lens
173+
Distribution.Types.Library
174+
Distribution.Types.Library.Lens
175+
Distribution.Types.LibraryName
176+
Distribution.Types.LibraryVisibility
177+
Distribution.Types.Mixin
178+
Distribution.Types.Module
179+
Distribution.Types.ModuleReexport
180+
Distribution.Types.ModuleRenaming
181+
Distribution.Types.MungedPackageId
182+
Distribution.Types.MungedPackageName
183+
Distribution.Types.PackageDescription
184+
Distribution.Types.PackageDescription.Lens
185+
Distribution.Types.PackageId
186+
Distribution.Types.PackageId.Lens
187+
Distribution.Types.PackageName
188+
Distribution.Types.PackageVersionConstraint
189+
Distribution.Types.PkgconfigDependency
190+
Distribution.Types.PkgconfigName
191+
Distribution.Types.PkgconfigVersion
192+
Distribution.Types.PkgconfigVersionRange
193+
Distribution.Types.SetupBuildInfo
194+
Distribution.Types.SetupBuildInfo.Lens
195+
Distribution.Types.SourceRepo
196+
Distribution.Types.SourceRepo.Lens
197+
Distribution.Types.TestSuite
198+
Distribution.Types.TestSuite.Lens
199+
Distribution.Types.TestSuiteInterface
200+
Distribution.Types.TestType
201+
Distribution.Types.UnitId
202+
Distribution.Types.UnqualComponentName
203+
Distribution.Types.Version
204+
Distribution.Types.VersionInterval
205+
Distribution.Types.VersionInterval.Legacy
206+
Distribution.Types.VersionRange
207+
Distribution.Types.VersionRange.Internal
208+
Distribution.Utils.Base62
209+
Distribution.Utils.Generic
210+
Distribution.Utils.MD5
211+
Distribution.Utils.Path
212+
Distribution.Utils.ShortText
213+
Distribution.Utils.String
214+
Distribution.Utils.Structured
215+
Distribution.Version
216+
Language.Haskell.Extension
217+
218+
if flag(bundled-binary-generic)
219+
exposed-modules:
220+
Distribution.Compat.Binary.Class
221+
Distribution.Compat.Binary.Generic
222+
223+
other-extensions:
224+
BangPatterns
225+
CPP
226+
DefaultSignatures
227+
DeriveDataTypeable
228+
DeriveFoldable
229+
DeriveFunctor
230+
DeriveGeneric
231+
DeriveTraversable
232+
ExistentialQuantification
233+
FlexibleContexts
234+
FlexibleInstances
235+
GeneralizedNewtypeDeriving
236+
ImplicitParams
237+
KindSignatures
238+
NondecreasingIndentation
239+
OverloadedStrings
240+
RankNTypes
241+
RecordWildCards
242+
ScopedTypeVariables
243+
StandaloneDeriving
244+
Trustworthy
245+
TypeFamilies
246+
TypeOperators
247+
TypeSynonymInstances
248+
UndecidableInstances
249+
250+
if impl(ghc >= 7.11)
251+
other-extensions: PatternSynonyms

Cabal-syntax/ChangeLog.md

Whitespace-only changes.

Cabal-syntax/LICENSE

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Copyright (c) 2003-2020, Cabal Development Team.
2+
See the AUTHORS file for the full list of copyright holders.
3+
4+
See */LICENSE for the copyright holders of the subcomponents.
5+
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions are
10+
met:
11+
12+
* Redistributions of source code must retain the above copyright
13+
notice, this list of conditions and the following disclaimer.
14+
15+
* Redistributions in binary form must reproduce the above
16+
copyright notice, this list of conditions and the following
17+
disclaimer in the documentation and/or other materials provided
18+
with the distribution.
19+
20+
* Neither the name of Isaac Jones nor the names of other
21+
contributors may be used to endorse or promote products derived
22+
from this software without specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Cabal-syntax/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
The Cabal-syntax package
2+
========================
3+
4+
See the [Cabal web site] for more information.
5+
6+
The `Cabal-syntax` package defines the syntax of the `.cabal` file format
7+
and provides tools for parsing `.cabal` files.
8+
9+
More information
10+
================
11+
12+
Please see the [Cabal web site] for the [user guide] and [API
13+
documentation]. There is additional information available on the
14+
[development wiki].
15+
16+
[user guide]: http://www.haskell.org/cabal/users-guide
17+
[API documentation]: http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple.html
18+
[development wiki]: https://github.com/haskell/cabal/wiki
19+
20+
21+
Bugs
22+
====
23+
24+
Please report bugs and feature requests to Cabal's [bug tracker].
25+
26+
27+
Your help
28+
---------
29+
30+
To help Cabal's development, it is enormously helpful to know from
31+
Cabal's users what their most pressing problems are with Cabal and
32+
[Hackage]. You may have a favourite Cabal bug or limitation. Look at
33+
Cabal's [bug tracker]. Ensure that the problem is reported there and
34+
adequately described. Comment on the issue to report how much of a
35+
problem the bug is for you. Subscribe to the issues's notifications to
36+
discussed requirements and keep informed on progress. For feature
37+
requests, it is helpful if there is a description of how you would
38+
expect to interact with the new feature.
39+
40+
[Hackage]: http://hackage.haskell.org
41+
42+
43+
Source code
44+
===========
45+
46+
You can get the master development branch using:
47+
48+
$ git clone https://github.com/haskell/cabal.git
49+
50+
51+
Credits
52+
=======
53+
54+
See the `AUTHORS` file.
55+
56+
Authors of the [original Cabal
57+
specification](https://www.haskell.org/cabal/proposal/pkg-spec.pdf):
58+
59+
- Isaac Jones
60+
- Simon Marlow
61+
- Ross Patterson
62+
- Simon Peyton Jones
63+
- Malcolm Wallace
64+
65+
66+
[bug tracker]: https://github.com/haskell/cabal/issues
67+
[Cabal web site]: http://www.haskell.org/cabal/

Cabal-syntax/Setup.hs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Distribution.Simple
2+
main :: IO ()
3+
main = defaultMain

Cabal/src/Distribution/FieldGrammar/FieldDescrs.hs renamed to Cabal-syntax/src/Distribution/FieldGrammar/FieldDescrs.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Distribution.Pretty (Pretty (..), showFreeText)
2121

2222
import qualified Data.Map as Map
2323
import qualified Distribution.Compat.CharParsing as C
24-
import qualified Distribution.Fields.Field as P
24+
import qualified Distribution.Fields as P
2525
import qualified Distribution.Parsec as P
2626
import qualified Text.PrettyPrint as Disp
2727

Cabal/src/Distribution/FieldGrammar/Parsec.hs renamed to Cabal-syntax/src/Distribution/FieldGrammar/Parsec.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module Distribution.FieldGrammar.Parsec (
6767

6868
import Distribution.Compat.Newtype
6969
import Distribution.Compat.Prelude
70-
import Distribution.Simple.Utils (fromUTF8BS)
70+
import Distribution.Utils.Generic (fromUTF8BS)
7171
import Distribution.Utils.String (trim)
7272
import Prelude ()
7373

0 commit comments

Comments
 (0)