Permalink
Browse files

Merge most of pull request #202 - fixes to the windows installer

  • Loading branch information...
2 parents 36d1f00 + 2035784 commit aac4418ef67d658042ceeab3ab46f84dd5486e11 @mzero mzero committed Aug 3, 2015
View
4 hptool/os-extras/win/templates/Nsisfile.nsi.mu
@@ -289,6 +289,8 @@ Section "Store GHC's location in registry" SecGHCLoc
WriteRegStr HKCU "Software\Haskell\GHC\ghc-${GHC_VERSION}" "InstallDir" "$INSTDIR"
WriteRegStr HKCU "Software\Haskell\GHC" "InstallDir" "$INSTDIR"
+ WriteRegStr HKCU "Software\Haskell\WinGHCi 1.0.6" "WorkingDir" "$INSTDIR\winghci"
+
SectionEnd
Section "Create uninstaller" SecAddRem
@@ -397,6 +399,8 @@ Section "Uninstall"
DeleteRegKey HKCU "Software\Haskell\GHC\ghc-${GHC_VERSION}"
DeleteRegKey HKCU "Software\Haskell\GHC"
+ ; remove WorkingDir but keep any user customizations for winGHCi
+ DeleteRegValue HKCU "Software\Haskell\WinGHCi 1.0.6" "WorkingDir"
DeleteRegKey HKLM "${PRODUCT_DIR_REG_KEY}"
DeleteRegKey /IfEmpty HKCU Software\Haskell
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\HaskellPlatform-${PLATFORM_VERSION}"
View
7 hptool/src/OS/Win.hs
@@ -52,7 +52,7 @@ winOsFromConfig BuildConfig{..} = os
osPackageTargetDir p = winHpPrefix </> packagePattern p
- -- The ghc-7.8.3 build for Windows does not have pre-built .dyn_hi files
+ -- The ghc builds for Windows do not have pre-built .dyn_hi files
-- (Revisit this in future versions)
osDoShared = False
@@ -86,7 +86,6 @@ winOsFromConfig BuildConfig{..} = os
whenM mp m = mp >>= \p -> when p m
osTargetAction = do
- copyWinTargetExtras
-- Now, targetDir is actually ready to snapshot (we skipped doing
-- this in osGhcTargetInstall).
void $ getDirectoryFiles "" [targetDir ++ "//*"]
@@ -123,13 +122,15 @@ winOsFromConfig BuildConfig{..} = os
osProduct = winProductFile hpVersion bcArch
- osRules _rel _bc = do
+ osRules _rel bc = do
winRules
osProduct %> \_ -> do
need $ [dir ghcLocalDir, targetDir, vdir ghcVirtualTarget]
++ winNeeds
+ copyWinTargetExtras bc
+
-- Now, it is time to make sure there are no problems with the
-- conf files copied to
localCommand' [] "ghc-pkg"
View
6 hptool/src/OS/Win/WinPaths.hs
@@ -106,6 +106,12 @@ winExternalWinGhciDir = winExternalSrc </> "winghci"
winWinGhciTargetDir :: FilePath
winWinGhciTargetDir = winTargetDir </> "winghci"
+winExternalMSysDir :: BuildConfig -> FilePath
+winExternalMSysDir bc = winExternalSrc </> "msys" </> bcArch bc
+
+winMSysTargetDir :: FilePath
+winMSysTargetDir = winTargetDir </> "msys"
+
-- | ghc.exe file, relative to the install
winGhcExeBin :: FilePath
winGhcExeBin = "bin" </> "ghc" <.> exe
View
7 hptool/src/OS/Win/WinRules.hs
@@ -58,8 +58,8 @@ winGhcInstall destDir bc distDir = do
return destDir
-copyWinTargetExtras :: Action ()
-copyWinTargetExtras = do
+copyWinTargetExtras :: BuildConfig -> Action ()
+copyWinTargetExtras bc = do
-- copy icons
let mkIconsDir = makeDirectory $ winTargetDir </> "icons"
copyFilesAction mkIconsDir winExtrasSrc winTargetDir winIconsFiles
@@ -70,6 +70,9 @@ copyWinTargetExtras = do
-- copy winghci pieces
copyDirAction winExternalWinGhciDir winWinGhciTargetDir
+ -- copy msys(msys2) pieces
+ copyDirAction (winExternalMSysDir bc) winMSysTargetDir
+
-- | These files are needed when building the installer
copyInstExtras :: Rules ()
View
44 windows-platform.sh
@@ -7,16 +7,16 @@ GHC_VERS=${tar_vers%%-*}
# These may need to be edited to suit your specific environment
# MSYS_BIN is needed on path for configure scripts;
-# HASK_BIN is needed on path for cabal.exe
+# HASK_BIN is needed on path for shake.exe, HsColour.exe (maybe cabal.exe)
# NSIS_BIN is needed on path for makensisw.exe
MSYS_BIN="/c/Program Files (x86)/MinGW/msys/1.0/bin"
-HASK_BIN="/c/Program Files (x86)/Haskell/bin"
+HASK_BIN="/c/Program Files/Haskell/bin:/c/Program Files/Haskell Platform/2014.2.0.0/lib/extralibs/bin"
NSIS_BIN="/c/Program Files (x86)/NSIS"
+GHC_BINDIST=build/ghc-bindist/local
HPTOOL=hptool/dist/build/hptool/hptool.exe
-if [ \! \( -e $HPTOOL -a -x $HPTOOL \) ]
-then
+if ( cabal sandbox --help >/dev/null 2>&1 ) ; then
if [ \! -d hptool/.cabal-sandbox ]
then
echo '***'
@@ -25,25 +25,38 @@ then
cabal update
(cd hptool; cabal sandbox init; cabal install --only-dependencies)
fi
-
- echo '***'
- echo '*** Building hptool'
- echo '***'
- (cd hptool; cabal build)
+else
+ if ( cabal install --dry-run --only-dependencies | grep -q 'would be installed' ) ; then
+ echo '=== pre-requisite packages for hptool are not installed'
+ echo ' run the following:'
+ echo ' cd hptool ; cabal install --only-dependencies'
+ exit 1
+ fi
fi
+echo '***'
+echo '*** Building hptool'
+echo '***'
+(cd hptool; cabal build)
+
CWD=`pwd`
-GHC_BINDIST=build/ghc-bindist/local
MINGW=$GHC_BINDIST/mingw
-# A clean, cruft-free PATH
+# A clean, well-lighted, cruft-free PATH
export PATH=$CWD/$GHC_BINDIST/bin:$CWD/$MINGW/bin:$MSYS_BIN:$NSIS_BIN:$HASK_BIN
which cabal ||
{ echo "Could not find cabal.exe on PATH!"; echo "PATH=$PATH"; exit 1; }
which makensisw ||
{ echo "Could not find makensisw.exe on PATH!"; echo "PATH=$PATH"; exit 1; }
+echo "> cabal --version"
+cabal --version
+echo "> which haddock"
+which haddock
+echo "> haddock --version"
+haddock --version
+
# Make sure makensisw.exe is compiled with support for large strings
# makensisw="/c/Program\ Files\ \(x86\)/NSIS/Orig/makensis //HDRINFO"
nsis_max_strlen=`makensis //HDRINFO | grep 'NSIS_MAX_STRLEN' | awk '{ match($0, /NSIS_MAX_STRLEN=([0-9]+)/, x); if(x[1] != "") print x[1] }'`
@@ -79,6 +92,8 @@ if [ \! \( -d winExternalSrc \
-a -d winExternalSrc/doc/html \
-a -d winExternalSrc/winghci \
-a -e winExternalSrc/winghci/winghci.exe \
+ -a -d winExternalSrc/msys/i386/usr \
+ -a -d winExternalSrc/msys/x86_64/usr \
\) ]
then
echo '***'
@@ -87,6 +102,7 @@ then
echo ' * winghci (can copy from a previous HP release)'
echo ' * GLUT library & DLL (e.g,. from freeglut-MinGW-2.8.1-1.mp.zip)'
echo " * GHC user's guide (matching the GHC in this HP)"
+ echo " * MSys2 'usr' directory, as seen in git-for-windows(tm)"
echo ''
echo 'Please create a subdirectory in this directory (where this script'
echo 'is), with the following contents and structure:'
@@ -111,7 +127,11 @@ then
winghci/
winghci.exe
<and any other DLL, etc. needed to run this particular winghci>
-
+ msys/
+ i386/
+ usr/{bin,lib,libexec,share,ssl}
+ x86_64/
+ usr/{bin,lib,libexec,share,ssl}
EOF
exit 1

0 comments on commit aac4418

Please sign in to comment.