Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,324
Issues
4,324
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
388
Merge Requests
388
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
36c9781b
Commit
36c9781b
authored
Jun 20, 2018
by
Chitrak Raj Gupta
Committed by
Andrey Mokhov
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add includes to bindist (
#632
)
* adding include directories * Adding includes * Shipping ghci
parent
d4b9c1fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
13 deletions
+44
-13
src/Context.hs
src/Context.hs
+1
-1
src/Rules/BinaryDist.hs
src/Rules/BinaryDist.hs
+43
-12
No files found.
src/Context.hs
View file @
36c9781b
...
...
@@ -7,7 +7,7 @@ module Context (
withHsPackage
,
-- * Paths
contextDir
,
buildPath
,
buildDir
,
pkgInplaceConfig
,
pkgSetupConfigFile
,
contextDir
,
buildPath
,
buildDir
,
pkgI
d
,
pkgI
nplaceConfig
,
pkgSetupConfigFile
,
pkgHaddockFile
,
pkgLibraryFile
,
pkgGhciLibraryFile
,
pkgConfFile
,
objectPath
,
contextPath
,
getContextPath
,
libDir
,
libPath
)
where
...
...
src/Rules/BinaryDist.hs
View file @
36c9781b
module
Rules.BinaryDist
where
import
Context
import
Expression
import
GHC
import
Oracles.Setting
...
...
@@ -14,19 +15,25 @@ bindistRules = do
-- We 'need' all binaries and libraries
targets
<-
mapM
pkgTarget
=<<
stagePackages
Stage1
need
targets
version
<-
setting
ProjectVersion
version
<-
setting
ProjectVersion
targetPlatform
<-
setting
TargetPlatformFull
hostOs
<-
setting
BuildOs
hostArch
<-
setting
BuildArch
rtsDir
<-
pkgId
$
vanillaContext
Stage1
rts
let
ghcBuildDir
=
root
-/-
stageString
Stage1
bindistFilesDir
=
root
-/-
"bindist"
-/-
ghcVersionPretty
ghcVersionPretty
=
"ghc-"
++
version
++
"-"
++
targetPlatform
distDir
=
hostArch
++
"-"
++
hostOs
++
"-ghc-"
++
version
rtsIncludeDir
=
ghcBuildDir
-/-
"lib"
-/-
distDir
-/-
rtsDir
-/-
"include"
-- we create the bindist directory at <root>/bindist/ghc-X.Y.Z-platform/
-- and populate it with a stage2 build
createDirectory
bindistFilesDir
copyDirectory
(
ghcBuildDir
-/-
"bin"
)
bindistFilesDir
copyDirectory
(
ghcBuildDir
-/-
"lib"
)
bindistFilesDir
copyDirectory
(
rtsIncludeDir
)
bindistFilesDir
{- SHOULD WE SHIP DOCS?
need ["docs"]
copyDirectory (root -/- "docs") bindistFilesDir
...
...
@@ -39,7 +46,8 @@ bindistRules = do
([
"configure"
,
"Makefile"
]
++
bindistInstallFiles
)
need
$
map
((
bindistFilesDir
-/-
"wrappers"
)
-/-
)
[
"check-api-annotations"
,
"check-ppr"
,
"ghc"
,
"ghc-iserv"
,
"ghc-pkg"
,
"ghc-split"
,
"ghci"
,
"haddock"
,
"hpc"
,
"hp2ps"
,
"hsc2hs"
,
"runhaskell"
]
,
"ghci-script"
,
"ghci"
,
"haddock"
,
"hpc"
,
"hp2ps"
,
"hsc2hs"
,
"runhaskell"
]
-- finally, we create the archive, at
-- <root>/bindist/ghc-X.Y.Z-platform.tar.xz
...
...
@@ -89,7 +97,7 @@ bindistInstallFiles :: [FilePath]
bindistInstallFiles
=
[
"config.sub"
,
"config.guess"
,
"install-sh"
,
"mk"
-/-
"config.mk.in"
,
"mk"
-/-
"install.mk.in"
,
"mk"
-/-
"project.mk
.in
"
,
"settings.in"
,
"README"
,
"INSTALL"
,
"mk"
-/-
"project.mk"
,
"settings.in"
,
"README"
,
"INSTALL"
]
-- | Auxiliary function that gives us a 'Filepath' we can 'need' for
...
...
@@ -165,7 +173,7 @@ bindistMakefile = unlines
,
"GHCBINDIR =
\"
$(LIBPARENT)/bin
\"
"
,
""
,
".PHONY: install"
,
"install: install_bin install_lib"
,
"install: install_bin install_lib
install_includes
"
,
""
,
"# Check if we need to install docs"
,
"ifeq
\"
DOCS
\"
\"
YES
\"
"
...
...
@@ -186,6 +194,12 @@ bindistMakefile = unlines
,
"
\t
for i in $(BINARIES); do
\\
"
,
"
\t\t
cp -R $$i
\"
$(GHCBINDIR)
\"
;
\\
"
,
"
\t
done"
,
"
\t
@echo
\"
Copying and installing ghci
\"
"
,
"
\t
rm -f $(GHCBINDIR)/dir"
,
"
\t
$(CREATE_SCRIPT) $(GHCBINDIR)/ghci"
,
"
\t
@echo
\"
#!$(SHELL)
\"
>> $(GHCBINDIR)/ghci"
,
"
\t
cat wrappers/ghci-script >> $(GHCBINDIR)/ghci"
,
"
\t
$(EXECUTABLE_FILE) $(GHCBINDIR)/ghci"
,
""
,
"LIBRARIES = $(wildcard ./lib/*)"
,
"install_lib:"
...
...
@@ -195,6 +209,14 @@ bindistMakefile = unlines
,
"
\t\t
cp -R $$i
\"
$(libdir)/
\"
;
\\
"
,
"
\t
done"
,
""
,
"INCLUDES = $(wildcard ./include/*)"
,
"install_includes:"
,
"
\t
@echo
\"
Copying libraries to $(includedir)
\"
"
,
"
\t
$(INSTALL_DIR)
\"
$(includedir)
\"
"
,
"
\t
for i in $(INCLUDES); do
\\
"
,
"
\t\t
cp -R $$i
\"
$(includedir)/
\"
;
\\
"
,
"
\t
done"
,
""
,
"DOCS = $(wildcard ./docs/*)"
,
"install_docs:"
,
"
\t
@echo
\"
Copying libraries to $(docdir)
\"
"
...
...
@@ -215,13 +237,14 @@ bindistMakefile = unlines
]
wrapper
::
FilePath
->
String
wrapper
"ghc"
=
ghcWrapper
wrapper
"ghc-pkg"
=
ghcPkgWrapper
wrapper
"ghci"
=
ghciWrapper
wrapper
"haddock"
=
haddockWrapper
wrapper
"hsc2hs"
=
hsc2hsWrapper
wrapper
"runhaskell"
=
runhaskellWrapper
wrapper
_
=
commonWrapper
wrapper
"ghc"
=
ghcWrapper
wrapper
"ghc-pkg"
=
ghcPkgWrapper
wrapper
"ghci"
=
ghciWrapper
wrapper
"ghci-script"
=
ghciScriptWrapper
wrapper
"haddock"
=
haddockWrapper
wrapper
"hsc2hs"
=
hsc2hsWrapper
wrapper
"runhaskell"
=
runhaskellWrapper
wrapper
_
=
commonWrapper
-- | Wrapper scripts for different programs. Common is default wrapper.
...
...
@@ -279,4 +302,12 @@ runhaskellWrapper = unlines
[
"exec
\"
$executablename
\"
-f
\"
$exedir/ghc
\"
${1+
\"
$@
\"
}"
]
-- | We need to ship ghci executable, which basically just calls ghc with
-- | --interactive flag.
ghciScriptWrapper
::
String
ghciScriptWrapper
=
unlines
[
"DIR=`dirname
\"
$0
\"
`"
,
"executable=
\"
$DIR/ghc
\"
"
,
"exec $executable --interactive
\"
$@
\"
"
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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