5
5
runghc
6
6
--package shake
7
7
--package directory
8
- --package tar
9
- --package zlib
10
8
-}
11
-
12
- import qualified Data.ByteString.Lazy as BS
13
- import qualified Codec.Archive.Tar as Tar
14
- import qualified Codec.Compression.GZip as GZip
15
-
16
9
import Development.Shake
17
10
import Development.Shake.Command
18
11
import Development.Shake.FilePath
@@ -40,8 +33,7 @@ hieVersions =
40
33
[" 8.2.1" , " 8.2.2" , " 8.4.2" , " 8.4.3" , " 8.4.4" , " 8.6.1" , " 8.6.2" , " 8.6.3" , " 8.6.4" ]
41
34
42
35
-- | Most recent version of hie.
43
- -- Important for `dist`, the `hie-wrapper` of the most recent hie
44
- -- will be copied to the tar-archive.
36
+ -- Shown in the more concise help message.
45
37
mostRecentHieVersion :: VersionNumber
46
38
mostRecentHieVersion = last hieVersions
47
39
@@ -61,7 +53,6 @@ main = do
61
53
phony " short-help" shortHelpMessage
62
54
phony " all" shortHelpMessage
63
55
phony " help" helpMessage
64
- phony " dist" buildDist
65
56
66
57
phony " cabal-ghcs" $ do
67
58
let
@@ -129,47 +120,6 @@ main = do
129
120
phony " icu-macos-fix-install" (command_ [] " brew" [" install" , " icu4c" ])
130
121
phony " icu-macos-fix-build" $ mapM_ buildIcuMacosFix hieVersions
131
122
132
- -- | Creates a compressed tar-archive consisting of all hie versions and `hie-wrapper`.
133
- -- Creates a temporary folder, copies all hie versions to it and compresses it in the end.
134
- buildDist :: Action ()
135
- buildDist = do
136
- need [" submodules" ]
137
- need [" cabal" ]
138
- -- Create the name of the resulting tar file.
139
- Stdout gitRef' <- command [] " git" [" describe" , " --tags" ]
140
- let gitRef = trim gitRef'
141
- let hieDistName = concat [" hie-" , gitRef, " -" , arch, " -" , os]
142
- -- define name constants for later use
143
- let hieWrapper = " hie-wrapper" <.> exe
144
- let hie = " hie" <.> exe
145
- let mkHie version = " hie-" ++ version <.> exe
146
-
147
- withTempDir
148
- (\ temporaryDir -> do
149
- forM_ hieVersions $ \ hieVersion -> do
150
- stackBuildHie hieVersion
151
- -- after building `hie` copy it to the temporary folder
152
- localInstallRoot <- getLocalInstallRoot hieVersion
153
- copyFile' (localInstallRoot </> " bin" </> hie)
154
- (temporaryDir </> mkHie hieVersion)
155
-
156
- -- if the most recent hie-* version is copied,
157
- -- copy it again as the default hie version
158
- -- Also, add its hie-wrapper to the tar archive
159
- when (hieVersion == mostRecentHieVersion) $ do
160
- copyFile' (localInstallRoot </> " bin" </> hieWrapper)
161
- (temporaryDir </> hieWrapper)
162
- copyFile' (localInstallRoot </> " bin" </> hie) (temporaryDir </> hie)
163
-
164
- -- After every hie has been built, pack them into a tar.
165
- -- Encrypt the resulting tar file with gzip
166
- liftIO
167
- $ BS. writeFile (hieDistName ++ " .tar.gz" )
168
- . GZip. compress
169
- . Tar. write
170
- =<< Tar. pack temporaryDir (hieWrapper : hie : map mkHie hieVersions)
171
- )
172
- return ()
173
123
174
124
buildIcuMacosFix :: VersionNumber -> Action ()
175
125
buildIcuMacosFix version = execStackWithYaml_
@@ -356,7 +306,6 @@ helpMessage = do
356
306
, ( " cabal"
357
307
, " Makes sure that Cabal the lib is available for cabal-helper-wapper, to speed up project start"
358
308
)
359
- , (" dist" , " Creates a tarball containing all the hie binaries" )
360
309
]
361
310
362
311
macosTargets = [(" icu-macos-fix" , " Fixes icu related problems in MacOS" )]
0 commit comments