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
a8ce1182
Commit
a8ce1182
authored
Jul 09, 2018
by
Alexis Williams
Browse files
Add flag to control library installation
parent
b9537def
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/CmdInstall.hs
View file @
a8ce1182
...
...
@@ -75,7 +75,7 @@ import Distribution.Client.InstallSymlink
(
symlinkBinary
)
import
Distribution.Simple.Setup
(
Flag
(
Flag
),
HaddockFlags
,
fromFlagOrDefault
,
flagToMaybe
,
toFlag
,
trueArg
,
configureOptions
,
haddockOptions
)
,
trueArg
,
configureOptions
,
haddockOptions
,
flagToList
)
import
Distribution.Solver.Types.SourcePackage
(
SourcePackage
(
..
)
)
import
Distribution.Simple.Command
...
...
@@ -124,11 +124,13 @@ import System.FilePath
data
NewInstallFlags
=
NewInstallFlags
{
ninstInstallLibs
::
Flag
Bool
,
ninstEnvironmentPath
::
Flag
FilePath
}
defaultNewInstallFlags
::
NewInstallFlags
defaultNewInstallFlags
=
NewInstallFlags
{
ninstInstallLibs
=
toFlag
False
,
ninstEnvironmentPath
=
mempty
}
newInstallOptions
::
ShowOrParseArgs
->
[
OptionField
NewInstallFlags
]
...
...
@@ -137,6 +139,10 @@ newInstallOptions _ =
"Install libraries rather than executables from the target package."
ninstInstallLibs
(
\
v
flags
->
flags
{
ninstInstallLibs
=
v
})
trueArg
,
option
[]
[
"env-path"
]
"Set the environment file that may be modified."
ninstEnvironmentPath
(
\
pf
flags
->
flags
{
ninstEnvironmentPath
=
pf
})
(
reqArg
"PATH"
(
succeedReadE
Flag
)
flagToList
)
]
installCommand
::
CommandUI
(
ConfigFlags
,
ConfigExFlags
,
InstallFlags
...
...
@@ -370,8 +376,9 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags, newInstal
configCompilerEx
hcFlavor
hcPath
hcPkg
progDb
verbosity
let
envFile
=
home
</>
".ghc"
</>
ghcPlatformAndVersionString
platform
compilerVersion
</>
"environments"
</>
"default"
envFile
=
flip
fromFlagOrDefault
ninstEnvironmentPath
$
home
</>
".ghc"
</>
ghcPlatformAndVersionString
platform
compilerVersion
</>
"environments"
</>
"default"
GhcImplInfo
{
supportsPkgEnvFiles
}
=
getImplInfo
compiler
-- Why? We know what the first part will be, we only care about the packages.
filterEnvEntries
=
filter
$
\
case
...
...
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