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
GHC
Commits
aee30889
Commit
aee30889
authored
Dec 31, 2015
by
Moritz Angermann
Browse files
ghcPkg Wrapper
parent
d9d00b86
Changes
3
Hide whitespace changes
Inline
Side-by-side
shaking-up-ghc.cabal
View file @
aee30889
...
...
@@ -55,6 +55,7 @@ executable ghc-shake
, Rules.Program
, Rules.Resources
, Rules.Wrappers.Ghc
, Rules.Wrappers.GhcPkg
, Settings
, Settings.Args
, Settings.Builders.Alex
...
...
src/Rules/Program.hs
View file @
aee30889
...
...
@@ -10,6 +10,7 @@ import Rules.Actions
import
Rules.Library
import
Rules.Resources
import
Rules.Wrappers.Ghc
import
Rules.Wrappers.GhcPkg
import
Settings
import
Settings.Builders.GhcCabal
...
...
@@ -22,7 +23,8 @@ type Wrapper = FilePath -> Expr String
-- List of wrappers we build
wrappers
::
[(
PartialTarget
,
Wrapper
)]
wrappers
=
[(
PartialTarget
Stage0
ghc
,
ghcWrapper
)]
wrappers
=
[
(
PartialTarget
Stage0
ghc
,
ghcWrapper
)
,
(
PartialTarget
Stage0
ghcPkg
,
ghcPkgWrapper
)]
buildProgram
::
Resources
->
PartialTarget
->
Rules
()
buildProgram
_
target
@
(
PartialTarget
stage
pkg
)
=
do
...
...
src/Rules/Wrappers/GhcPkg.hs
0 → 100644
View file @
aee30889
module
Rules.Wrappers.GhcPkg
(
ghcPkgWrapper
)
where
import
Base
import
Expression
import
Oracles
-- Note about wrapper:
-- bindir is usually GhcSourcePath / inplace / bin
-- topdir is usually GhcSourcePath / inplace / lib
-- datadir is usually the same as topdir
ghcPkgWrapper
::
FilePath
->
Expr
String
ghcPkgWrapper
program
=
do
lift
$
need
[
sourcePath
-/-
"Rules/Wrappers/GhcPkg.hs"
]
top
<-
getSetting
GhcSourcePath
let
pkgConf
=
top
-/-
"inplace"
-/-
"lib"
-/-
"package.conf.d"
return
$
unlines
[
"#!/bin/bash"
,
"exec "
++
(
top
-/-
program
)
++
" --global-package-db "
++
pkgConf
++
" ${1+
\"
$@
\"
}"
]
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