Skip to content

Commit

Permalink
Merge pull request #7620 from patrickdoc/wip/cabal-syntax
Browse files Browse the repository at this point in the history
Create Cabal-syntax for .cabal parsing and types
  • Loading branch information
mergify[bot] committed Jan 26, 2022
2 parents 0986d13 + a64b9ae commit 0abbe37
Show file tree
Hide file tree
Showing 187 changed files with 1,008 additions and 711 deletions.
5 changes: 3 additions & 2 deletions Cabal-QuickCheck/Cabal-QuickCheck.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ library
build-depends:
, base
, bytestring
, Cabal ^>=3.7.0.0
, QuickCheck ^>=2.13.2 || ^>=2.14
, Cabal ^>=3.7.0.0
, Cabal-syntax ^>=3.7.0.0
, QuickCheck ^>=2.13.2 || ^>=2.14

if !impl(ghc >= 8.0)
build-depends: semigroups
Expand Down
1 change: 1 addition & 0 deletions Cabal-described/Cabal-described.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ library
build-depends:
, base
, Cabal ^>=3.7.0.0
, Cabal-syntax ^>=3.7.0.0
, containers
, pretty
, QuickCheck
Expand Down
251 changes: 251 additions & 0 deletions Cabal-syntax/Cabal-syntax.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
cabal-version: >=1.10
name: Cabal-syntax
version: 3.7.0.0
copyright: 2003-2021, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
author: Cabal Development Team <cabal-devel@haskell.org>
maintainer: cabal-devel@haskell.org
homepage: http://www.haskell.org/cabal/
bug-reports: https://github.com/haskell/cabal/issues
synopsis: A library for working with .cabal files
description:
This library provides tools for reading and manipulating the .cabal file
format.
category: Distribution
build-type: Simple

extra-source-files:
README.md ChangeLog.md

source-repository head
type: git
location: https://github.com/haskell/cabal/
subdir: Cabal-syntax

flag bundled-binary-generic
default: False

library
default-language: Haskell2010
hs-source-dirs: src

build-depends:
array >= 0.4.0.1 && < 0.6,
base >= 4.6 && < 5,
bytestring >= 0.10.0.0 && < 0.12,
containers >= 0.5.0.0 && < 0.7,
deepseq >= 1.3.0.1 && < 1.5,
directory >= 1.2 && < 1.4,
filepath >= 1.3.0.1 && < 1.5,
mtl >= 2.1 && < 2.3,
parsec >= 3.1.13.0 && < 3.2,
pretty >= 1.1.1 && < 1.2,
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1),
time >= 1.4.0.1 && < 1.13,
-- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity
-- See also https://github.com/ekmett/transformers-compat/issues/35
transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6)

if flag(bundled-binary-generic)
build-depends: binary >= 0.5.1.1 && < 0.7
else
build-depends: binary >= 0.7 && < 0.9

if os(windows)
build-depends: Win32 >= 2.3.0.0 && < 2.13
else
build-depends: unix >= 2.6.0.0 && < 2.8

ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances

if impl(ghc <8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if !impl(ghc >= 8.0)
-- at least one of lib:Cabal's dependency (i.e. `parsec`)
-- already depends on `fail` and `semigroups` transitively
build-depends: fail == 4.9.*, semigroups >= 0.18.3 && < 0.20

if !impl(ghc >= 7.10)
build-depends: void >= 0.7.3 && < 0.8

if !impl(ghc >= 7.8)
-- semigroups depends on tagged.
build-depends: tagged >=0.8.6 && <0.9, bytestring-builder >= 0.10.8 && <0.11

exposed-modules:
Distribution.Backpack
Distribution.CabalSpecVersion
Distribution.Compat.Binary
Distribution.Compat.CharParsing
Distribution.Compat.DList
Distribution.Compat.Exception
Distribution.Compat.Graph
Distribution.Compat.Lens
Distribution.Compat.MonadFail
Distribution.Compat.Newtype
Distribution.Compat.NonEmptySet
Distribution.Compat.Parsing
Distribution.Compat.Prelude
Distribution.Compat.Semigroup
Distribution.Compat.Typeable
Distribution.Compiler
Distribution.FieldGrammar
Distribution.FieldGrammar.Class
Distribution.FieldGrammar.FieldDescrs
Distribution.FieldGrammar.Newtypes
Distribution.FieldGrammar.Parsec
Distribution.FieldGrammar.Pretty
Distribution.Fields
Distribution.Fields.ConfVar
Distribution.Fields.Field
Distribution.Fields.Lexer
Distribution.Fields.LexerMonad
Distribution.Fields.ParseResult
Distribution.Fields.Parser
Distribution.Fields.Pretty
Distribution.InstalledPackageInfo
Distribution.License
Distribution.ModuleName
Distribution.Package
Distribution.PackageDescription
Distribution.PackageDescription.Configuration
Distribution.PackageDescription.FieldGrammar
Distribution.PackageDescription.Parsec
Distribution.PackageDescription.PrettyPrint
Distribution.PackageDescription.Quirks
Distribution.PackageDescription.Utils
Distribution.Parsec
Distribution.Parsec.Error
Distribution.Parsec.FieldLineStream
Distribution.Parsec.Position
Distribution.Parsec.Warning
Distribution.Pretty
Distribution.SPDX
Distribution.SPDX.License
Distribution.SPDX.LicenseExceptionId
Distribution.SPDX.LicenseExpression
Distribution.SPDX.LicenseId
Distribution.SPDX.LicenseListVersion
Distribution.SPDX.LicenseReference
Distribution.System
Distribution.Text
Distribution.Types.AbiDependency
Distribution.Types.AbiHash
Distribution.Types.Benchmark
Distribution.Types.Benchmark.Lens
Distribution.Types.BenchmarkInterface
Distribution.Types.BenchmarkType
Distribution.Types.BuildInfo
Distribution.Types.BuildInfo.Lens
Distribution.Types.BuildType
Distribution.Types.Component
Distribution.Types.ComponentId
Distribution.Types.ComponentName
Distribution.Types.ComponentRequestedSpec
Distribution.Types.CondTree
Distribution.Types.Condition
Distribution.Types.ConfVar
Distribution.Types.Dependency
Distribution.Types.DependencyMap
Distribution.Types.ExeDependency
Distribution.Types.Executable
Distribution.Types.Executable.Lens
Distribution.Types.ExecutableScope
Distribution.Types.ExposedModule
Distribution.Types.Flag
Distribution.Types.ForeignLib
Distribution.Types.ForeignLib.Lens
Distribution.Types.ForeignLibOption
Distribution.Types.ForeignLibType
Distribution.Types.GenericPackageDescription
Distribution.Types.GenericPackageDescription.Lens
Distribution.Types.HookedBuildInfo
Distribution.Types.IncludeRenaming
Distribution.Types.InstalledPackageInfo
Distribution.Types.InstalledPackageInfo.Lens
Distribution.Types.InstalledPackageInfo.FieldGrammar
Distribution.Types.LegacyExeDependency
Distribution.Types.Lens
Distribution.Types.Library
Distribution.Types.Library.Lens
Distribution.Types.LibraryName
Distribution.Types.LibraryVisibility
Distribution.Types.Mixin
Distribution.Types.Module
Distribution.Types.ModuleReexport
Distribution.Types.ModuleRenaming
Distribution.Types.MungedPackageId
Distribution.Types.MungedPackageName
Distribution.Types.PackageDescription
Distribution.Types.PackageDescription.Lens
Distribution.Types.PackageId
Distribution.Types.PackageId.Lens
Distribution.Types.PackageName
Distribution.Types.PackageVersionConstraint
Distribution.Types.PkgconfigDependency
Distribution.Types.PkgconfigName
Distribution.Types.PkgconfigVersion
Distribution.Types.PkgconfigVersionRange
Distribution.Types.SetupBuildInfo
Distribution.Types.SetupBuildInfo.Lens
Distribution.Types.SourceRepo
Distribution.Types.SourceRepo.Lens
Distribution.Types.TestSuite
Distribution.Types.TestSuite.Lens
Distribution.Types.TestSuiteInterface
Distribution.Types.TestType
Distribution.Types.UnitId
Distribution.Types.UnqualComponentName
Distribution.Types.Version
Distribution.Types.VersionInterval
Distribution.Types.VersionInterval.Legacy
Distribution.Types.VersionRange
Distribution.Types.VersionRange.Internal
Distribution.Utils.Base62
Distribution.Utils.Generic
Distribution.Utils.MD5
Distribution.Utils.Path
Distribution.Utils.ShortText
Distribution.Utils.String
Distribution.Utils.Structured
Distribution.Version
Language.Haskell.Extension

if flag(bundled-binary-generic)
exposed-modules:
Distribution.Compat.Binary.Class
Distribution.Compat.Binary.Generic

other-extensions:
BangPatterns
CPP
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
ExistentialQuantification
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
NondecreasingIndentation
OverloadedStrings
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
Trustworthy
TypeFamilies
TypeOperators
TypeSynonymInstances
UndecidableInstances

if impl(ghc >= 7.11)
other-extensions: PatternSynonyms
Empty file added Cabal-syntax/ChangeLog.md
Empty file.
34 changes: 34 additions & 0 deletions Cabal-syntax/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Copyright (c) 2003-2020, Cabal Development Team.
See the AUTHORS file for the full list of copyright holders.

See */LICENSE for the copyright holders of the subcomponents.

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Isaac Jones nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 changes: 67 additions & 0 deletions Cabal-syntax/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
The Cabal-syntax package
========================

See the [Cabal web site] for more information.

The `Cabal-syntax` package defines the syntax of the `.cabal` file format
and provides tools for parsing `.cabal` files.

More information
================

Please see the [Cabal web site] for the [user guide] and [API
documentation]. There is additional information available on the
[development wiki].

[user guide]: http://www.haskell.org/cabal/users-guide
[API documentation]: http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple.html
[development wiki]: https://github.com/haskell/cabal/wiki


Bugs
====

Please report bugs and feature requests to Cabal's [bug tracker].


Your help
---------

To help Cabal's development, it is enormously helpful to know from
Cabal's users what their most pressing problems are with Cabal and
[Hackage]. You may have a favourite Cabal bug or limitation. Look at
Cabal's [bug tracker]. Ensure that the problem is reported there and
adequately described. Comment on the issue to report how much of a
problem the bug is for you. Subscribe to the issues's notifications to
discussed requirements and keep informed on progress. For feature
requests, it is helpful if there is a description of how you would
expect to interact with the new feature.

[Hackage]: http://hackage.haskell.org


Source code
===========

You can get the master development branch using:

$ git clone https://github.com/haskell/cabal.git


Credits
=======

See the `AUTHORS` file.

Authors of the [original Cabal
specification](https://www.haskell.org/cabal/proposal/pkg-spec.pdf):

- Isaac Jones
- Simon Marlow
- Ross Patterson
- Simon Peyton Jones
- Malcolm Wallace


[bug tracker]: https://github.com/haskell/cabal/issues
[Cabal web site]: http://www.haskell.org/cabal/
3 changes: 3 additions & 0 deletions Cabal-syntax/Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Distribution.Simple
main :: IO ()
main = defaultMain
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Distribution.Pretty (Pretty (..), showFreeText)

import qualified Data.Map as Map
import qualified Distribution.Compat.CharParsing as C
import qualified Distribution.Fields.Field as P
import qualified Distribution.Fields as P
import qualified Distribution.Parsec as P
import qualified Text.PrettyPrint as Disp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module Distribution.FieldGrammar.Parsec (

import Distribution.Compat.Newtype
import Distribution.Compat.Prelude
import Distribution.Simple.Utils (fromUTF8BS)
import Distribution.Utils.Generic (fromUTF8BS)
import Distribution.Utils.String (trim)
import Prelude ()

Expand Down
Loading

0 comments on commit 0abbe37

Please sign in to comment.