Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit 2035784

Browse files
committed
Incorporate msys2 tools into installer
* hptool/src/OS/Win.hs * call copyWinTargetExtras with the BuildConfig * hptool/src/OS/Win/WinPaths.hs * Add the build source and target dest paths for msys * hptool/src/OS/Win/WinRules.hs * Add a step which copies the pre-built msys folder from our build tree to the target tree (no installer change is needed here since the installer just bundles up every file from the target tree) * windows-platform.sh * add some sanity checks to make sure the pre-built msys tree is available
1 parent a124e95 commit 2035784

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

hptool/src/OS/Win.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ winOsFromConfig BuildConfig{..} = os
5252

5353
osPackageTargetDir p = winHpPrefix </> packagePattern p
5454

55-
-- The ghc-7.8.3 build for Windows does not have pre-built .dyn_hi files
55+
-- The ghc builds for Windows do not have pre-built .dyn_hi files
5656
-- (Revisit this in future versions)
5757
osDoShared = False
5858

@@ -86,7 +86,6 @@ winOsFromConfig BuildConfig{..} = os
8686
whenM mp m = mp >>= \p -> when p m
8787

8888
osTargetAction = do
89-
copyWinTargetExtras
9089
-- Now, targetDir is actually ready to snapshot (we skipped doing
9190
-- this in osGhcTargetInstall).
9291
void $ getDirectoryFiles "" [targetDir ++ "//*"]
@@ -123,13 +122,15 @@ winOsFromConfig BuildConfig{..} = os
123122

124123
osProduct = winProductFile hpVersion bcArch
125124

126-
osRules _rel _bc = do
125+
osRules _rel bc = do
127126
winRules
128127

129128
osProduct %> \_ -> do
130129
need $ [dir ghcLocalDir, targetDir, vdir ghcVirtualTarget]
131130
++ winNeeds
132131

132+
copyWinTargetExtras bc
133+
133134
-- Now, it is time to make sure there are no problems with the
134135
-- conf files copied to
135136
localCommand' [] "ghc-pkg"

hptool/src/OS/Win/WinPaths.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ winExternalWinGhciDir = winExternalSrc </> "winghci"
106106
winWinGhciTargetDir :: FilePath
107107
winWinGhciTargetDir = winTargetDir </> "winghci"
108108

109+
winExternalMSysDir :: BuildConfig -> FilePath
110+
winExternalMSysDir bc = winExternalSrc </> "msys" </> bcArch bc
111+
112+
winMSysTargetDir :: FilePath
113+
winMSysTargetDir = winTargetDir </> "msys"
114+
109115
-- | ghc.exe file, relative to the install
110116
winGhcExeBin :: FilePath
111117
winGhcExeBin = "bin" </> "ghc" <.> exe

hptool/src/OS/Win/WinRules.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ winGhcInstall destDir bc distDir = do
5858
return destDir
5959

6060

61-
copyWinTargetExtras :: Action ()
62-
copyWinTargetExtras = do
61+
copyWinTargetExtras :: BuildConfig -> Action ()
62+
copyWinTargetExtras bc = do
6363
-- copy icons
6464
let mkIconsDir = makeDirectory $ winTargetDir </> "icons"
6565
copyFilesAction mkIconsDir winExtrasSrc winTargetDir winIconsFiles
@@ -70,6 +70,9 @@ copyWinTargetExtras = do
7070
-- copy winghci pieces
7171
copyDirAction winExternalWinGhciDir winWinGhciTargetDir
7272

73+
-- copy msys(msys2) pieces
74+
copyDirAction (winExternalMSysDir bc) winMSysTargetDir
75+
7376

7477
-- | These files are needed when building the installer
7578
copyInstExtras :: Rules ()

windows-platform.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ if [ \! \( -d winExternalSrc \
9292
-a -d winExternalSrc/doc/html \
9393
-a -d winExternalSrc/winghci \
9494
-a -e winExternalSrc/winghci/winghci.exe \
95+
-a -d winExternalSrc/msys/i386/usr \
96+
-a -d winExternalSrc/msys/x86_64/usr \
9597
\) ]
9698
then
9799
echo '***'
@@ -100,6 +102,7 @@ then
100102
echo ' * winghci (can copy from a previous HP release)'
101103
echo ' * GLUT library & DLL (e.g,. from freeglut-MinGW-2.8.1-1.mp.zip)'
102104
echo " * GHC user's guide (matching the GHC in this HP)"
105+
echo " * MSys2 'usr' directory, as seen in git-for-windows(tm)"
103106
echo ''
104107
echo 'Please create a subdirectory in this directory (where this script'
105108
echo 'is), with the following contents and structure:'
@@ -124,7 +127,11 @@ then
124127
winghci/
125128
winghci.exe
126129
<and any other DLL, etc. needed to run this particular winghci>
127-
130+
msys/
131+
i386/
132+
usr/{bin,lib,libexec,share,ssl}
133+
x86_64/
134+
usr/{bin,lib,libexec,share,ssl}
128135
EOF
129136

130137
exit 1

0 commit comments

Comments
 (0)