Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
d692561f
Commit
d692561f
authored
Nov 14, 2016
by
John Ericson
Browse files
Add notion of ExeDependency for tool-depends and custom setup
parent
c6928316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Cabal/Cabal.cabal
View file @
d692561f
...
...
@@ -210,6 +210,7 @@ library
Distribution.Types.BuildType
Distribution.Types.ComponentInclude
Distribution.Types.Dependency
Distribution.Types.ExeDependency
Distribution.Types.LegacyExeDependency
Distribution.Types.PkgconfigDependency
Distribution.Types.Executable
...
...
Cabal/Distribution/Parsec/Class.hs
View file @
d692561f
...
...
@@ -42,6 +42,7 @@ import Distribution.Types.BenchmarkType
(
BenchmarkType
(
..
))
import
Distribution.Types.BuildType
(
BuildType
(
..
))
import
Distribution.Types.Dependency
(
Dependency
(
..
))
import
Distribution.Types.ExeDependency
(
ExeDependency
(
..
))
import
Distribution.Types.LegacyExeDependency
(
LegacyExeDependency
(
..
))
import
Distribution.Types.PkgconfigDependency
(
PkgconfigDependency
(
..
))
import
Distribution.Types.GenericPackageDescription
(
FlagName
,
mkFlagName
)
...
...
@@ -136,6 +137,14 @@ instance Parsec Dependency where
ver
<-
parsec
<|>
pure
anyVersion
return
(
Dependency
name
ver
)
instance
Parsec
ExeDependency
where
parsec
=
do
name
<-
lexemeParsec
_
<-
P
.
char
':'
exe
<-
lexemeParsec
ver
<-
parsec
<|>
pure
anyVersion
return
(
ExeDependency
name
exe
ver
)
instance
Parsec
LegacyExeDependency
where
parsec
=
do
name
<-
parsecMaybeQuoted
nameP
...
...
Cabal/Distribution/Types/ExeDependency.hs
0 → 100644
View file @
d692561f
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module
Distribution.Types.ExeDependency
(
ExeDependency
(
..
)
,
qualifiedExeName
)
where
import
Prelude
()
import
Distribution.Compat.Prelude
import
Distribution.Package
import
Distribution.Types.ComponentName
import
Distribution.Types.UnqualComponentName
import
Distribution.Version
(
VersionRange
,
anyVersion
)
import
qualified
Distribution.Compat.ReadP
as
Parse
import
Distribution.Compat.ReadP
import
Distribution.Text
import
Text.PrettyPrint
((
<+>
),
text
)
-- | Describes a dependency on an executable from a package
--
data
ExeDependency
=
ExeDependency
PackageName
UnqualComponentName
-- name of executable component of package
VersionRange
deriving
(
Generic
,
Read
,
Show
,
Eq
,
Typeable
,
Data
)
instance
Binary
ExeDependency
instance
NFData
ExeDependency
where
rnf
=
genericRnf
instance
Text
ExeDependency
where
disp
(
ExeDependency
name
exe
ver
)
=
(
disp
name
<<>>
text
":"
<<>>
disp
exe
)
<+>
disp
ver
parse
=
do
name
<-
parse
_
<-
Parse
.
char
':'
exe
<-
parse
Parse
.
skipSpaces
ver
<-
parse
<++
return
anyVersion
Parse
.
skipSpaces
return
(
ExeDependency
name
exe
ver
)
qualifiedExeName
::
ExeDependency
->
ComponentName
qualifiedExeName
(
ExeDependency
_
ucn
_
)
=
CExeName
ucn
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment