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

Commit d1b6a49

Browse files
U-CIQDEV\gbazermanU-CIQDEV\gbazerman
authored andcommitted
Merge branch 'minimal-full-split' of github.com:gbaz/haskell-platform into minimal-full-split
2 parents 8283420 + 0361d85 commit d1b6a49

File tree

7 files changed

+50
-16
lines changed

7 files changed

+50
-16
lines changed

hptool/src/Config.hs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module Config
55
( askHpRelease
66
, askGhcBinDistTarFile
77
, askBuildConfig
8-
98
, addConfigOracle
9+
, askStackExe
1010
)
1111
where
1212

@@ -66,13 +66,25 @@ newtype BuildConfigQ = BuildConfigQ ()
6666
askBuildConfig :: Action BuildConfig
6767
askBuildConfig = readOracle "BuildConfig" (BuildConfigQ ())
6868

69+
newtype StackExeQ = StackExeQ ()
70+
deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
71+
72+
-- | Provide the stack executable
73+
-- The filepath will be tracked as a dependency
74+
askStackExe :: Action FilePath
75+
askStackExe = do
76+
stackexe <- askOracle $ StackExeQ ()
77+
need [stackexe]
78+
return stackexe
6979

70-
addConfigOracle :: Release -> FilePath -> Maybe FilePath -> Bool -> Rules BuildConfig
71-
addConfigOracle hpRel tarFile prefix includeExtra = do
80+
addConfigOracle :: Release -> FilePath -> FilePath -> Maybe FilePath -> Bool -> Rules BuildConfig
81+
addConfigOracle hpRel tarFile stackexe prefix includeExtra = do
7282
_ <- addOracle $
7383
\(HpReleaseQ _) -> return $ show hpRel
7484
_ <- addOracle $
7585
\(GhcBinDistTarFileQ _) -> return tarFile
86+
_ <- addOracle $
87+
\(StackExeQ _) -> return stackexe
7688
_ <- addOracle $
7789
\(BuildConfigQ _) -> either fail (return . show) buildConfig
7890
either fail return buildConfig

hptool/src/Main.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
4343
if Info `elem` flgs
4444
then info
4545
else case args of
46-
(tarfile:what) -> return $ Just $ do
47-
allRules tarfile flgs
48-
want $ if null what then ["build-all"] else what
49-
[] -> usage
46+
(tarfile:stackexe:buildType) -> return $ Just $ do
47+
allRules tarfile stackexe flgs
48+
want $ if null buildType then ["build-all"] else buildType
49+
_ -> usage
5050

5151
info = do
5252
putStrLn $ "This hptool is built to construct " ++ hpFullName ++ "\n\
@@ -58,7 +58,7 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
5858

5959
usage = do
6060
putStrLn "usage: hptool --info\n\
61-
\ hptool [opts] <ghc-bindist.tar.bz> [target...]\n\
61+
\ hptool [opts] <ghc-bindist.tar.bz> <stack executable> [target...]\n\
6262
\ where target is one of:\n\
6363
\ build-all -- build everything (default)\n\
6464
\ build-source -- build the source tar ball\n\
@@ -68,8 +68,8 @@ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
6868
\ build-website -- build the website\n"
6969
return Nothing
7070

71-
allRules tarfile flgs = do
72-
buildConfig <- addConfigOracle hpRelease tarfile (prefixSetting flgs) (Full `elem` flgs)
71+
allRules tarfile stackexe flgs = do
72+
buildConfig <- addConfigOracle hpRelease tarfile stackexe (prefixSetting flgs) (Full `elem` flgs)
7373
ghcDistRules
7474
packageRules
7575
targetRules buildConfig

hptool/src/OS/Mac.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Paths
1616
import Templates
1717
import Types
1818
import Utils
19+
import Config
1920

2021
macOsFromConfig :: BuildConfig -> OS
2122
macOsFromConfig BuildConfig{..} = OS{..}
@@ -109,7 +110,8 @@ macOsFromConfig BuildConfig{..} = OS{..}
109110
makeDirectory hpBinDir
110111
need [dir extrasDir]
111112
binFiles <- getDirectoryFiles "" [extrasDir </> "bin/*"]
112-
forM_ binFiles $ \f -> do
113+
stackFile <- askStackExe
114+
forM_ (stackFile:binFiles) $ \f -> do
113115
if takeExtension f == ".hs"
114116
then compileToBin f $ hpBinDir </> takeBaseName f
115117
else copyFile' f $ hpBinDir </> takeFileName f

hptool/src/OS/Posix.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Development.Shake
1212
import Development.Shake.FilePath
1313

1414
import Dirs
15+
import Config
1516
import OS.Internal
1617
import Paths
1718
import Templates
@@ -115,7 +116,8 @@ posixOS BuildConfig{..} = OS{..}
115116
makeDirectory hpBinDir
116117
need [dir extrasDir]
117118
binFiles <- getDirectoryFiles "" [extrasDir </> "bin/*"]
118-
forM_ binFiles $ \f -> do
119+
stackFile <- askStackExe
120+
forM_ (stackFile:binFiles) $ \f -> do
119121
copyFile' f $ hpBinDir </> takeFileName f
120122
return Nothing
121123

hptool/src/OS/Win/WinRules.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import qualified Data.ByteString as B
1212
import qualified Data.Text as T
1313
import qualified Data.Text.Encoding as E
1414
import Development.Shake
15-
import Development.Shake.FilePath ( (</>), takeDirectory )
15+
import Development.Shake.FilePath ( (</>), takeDirectory, takeFileName )
1616

17+
import Config
1718
import Dirs
1819
import OS.Internal
1920
import OS.Win.WinNsis
@@ -73,6 +74,11 @@ copyWinTargetExtras bc = do
7374
-- copy msys(msys2) pieces
7475
copyDirAction (winExternalMSysDir bc) winMSysTargetDir
7576

77+
-- copy stack executable
78+
stackFile <- askStackExe
79+
copyFileAction (return ()) (takeDirectory stackFile) (winHpTargetDir </> "bin") (takeFileName stackFile)
80+
81+
7682

7783
-- | These files are needed when building the installer
7884
copyInstExtras :: Rules ()
32.3 KB
Loading

website/templates/plan-a/download-os-sections.html.mu

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<ul>
3939
<li class="active"><a href="#osx-none"><span class="logo"><i class="fa fa-cogs"></i></span>None</a></li>
4040
<li><a href="#osx-macports"><img alt="MacPorts logo" class="logo" src="img/distro-macports.png">MacPorts</a></li>
41+
<li><a href="#osx-homebrewcask"><img alt="Homebrew logo" class="logo" src="img/distro-homebrew.png">Homebrew</a></li>
4142
</ul>
4243
</div>
4344

@@ -101,6 +102,15 @@
101102
<pre>$ sudo port install haskell-platform</pre>
102103
</div> <!-- #osx-macports -->
103104

105+
<div id="osx-homebrewcask" class="flavor">
106+
<h3>Homebrew Cask</h3>
107+
<p>To install Haskell Platform with
108+
<a href="http://caskroom.io">Homebrew Cask</a>,
109+
simply run,
110+
</p>
111+
<pre>$ brew cask install haskell-platform</pre>
112+
</div> <!-- #osx-homebrewcask -->
113+
104114
</div>
105115
<div class="bottom-rule"></div>
106116
</section>
@@ -188,7 +198,9 @@
188198
<h3>Select your distribution</h3>
189199
<p>
190200
Please select your Linux distribution in the
191-
list on the right.
201+
list on the right. Note that distribution-packaged versions are typically behind the current
202+
platform release. If you prefer to use the latest version rather than the
203+
distribution-packaged version, then you may use the generic Linux installer.
192204
</p>
193205
<div class="point-to-flavors-list"><i class="fa fa-arrow-right"></i></div>
194206
</div>
@@ -199,9 +211,9 @@
199211
This is a <strong>generic</strong>
200212
distribution of the Haskell Platform. While
201213
it should work on most modern Linux
202-
distributions, you should use one of the
214+
distributions, you may want to investigate use one of the
203215
distribution-specific options listed on the
204-
right if possible.
216+
right.
205217
</p>
206218
<p>
207219
The latest version of the Haskell Platform for Linux is

0 commit comments

Comments
 (0)