summaryrefslogtreecommitdiff
path: root/hadrian/src/Rules/SourceDist.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-12-08 12:42:35 -0500
committerBen Gamari <ben@smart-cactus.org>2017-12-08 13:22:41 -0500
commit7733e44dd4ba7e7a0a9f3456e6ddc32decbcf5a3 (patch)
tree79c5e7151d760e6c7617d8450fb9ec2a10560989 /hadrian/src/Rules/SourceDist.hs
parent5695f462f604fc63cbb45a7f3073bc114f9b475f (diff)
downloadhaskell-7733e44dd4ba7e7a0a9f3456e6ddc32decbcf5a3.tar.gz
Rip out hadrian subtree
Sadly subtrees haven't worked quite as well as we would have liked for developers. See Hadrian #440.
Diffstat (limited to 'hadrian/src/Rules/SourceDist.hs')
-rw-r--r--hadrian/src/Rules/SourceDist.hs113
1 files changed, 0 insertions, 113 deletions
diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs
deleted file mode 100644
index 3143c4b153..0000000000
--- a/hadrian/src/Rules/SourceDist.hs
+++ /dev/null
@@ -1,113 +0,0 @@
-module Rules.SourceDist (sourceDistRules) where
-
-import Hadrian.Oracles.DirectoryContents
-
-import Base
-import Builder
-import Oracles.Setting
-import Rules.Clean
-
-sourceDistRules :: Rules ()
-sourceDistRules = do
- "sdist-ghc" ~> do
- -- We clean the source tree first.
- -- See https://github.com/snowleopard/hadrian/issues/384.
- cleanSourceTree
- version <- setting ProjectVersion
- need ["sdistprep/ghc-" ++ version ++ "-src.tar.xz"]
- putSuccess "| Done"
- "sdistprep/ghc-*-src.tar.xz" %> \fname -> do
- let tarName = takeFileName fname
- dropTarXz = dropExtension . dropExtension
- treePath = "sdistprep/ghc" -/- dropTarXz tarName
- prepareTree treePath
- runBuilderWithCmdOptions [Cwd "sdistprep/ghc"] (Tar Create)
- ["cJf", ".." -/- tarName, dropTarXz tarName]
- ["cJf", ".." -/- tarName] [dropTarXz tarName]
- "GIT_COMMIT_ID" %> \fname ->
- writeFileChanged fname =<< setting ProjectGitCommitId
- "VERSION" %> \fname ->
- writeFileChanged fname =<< setting ProjectVersion
-
-prepareTree :: FilePath -> Action ()
-prepareTree dest = do
- mapM_ cpDir srcDirs
- mapM_ cpFile srcFiles
- where
- cpFile a = copyFile a (dest -/- a)
- cpDir a = copyDirectoryContents (Not excluded) a (dest -/- a)
- excluded = Or
- [ Test "//.*"
- , Test "//#*"
- , Test "//*-SAVE"
- , Test "//*.orig"
- , Test "//*.rej"
- , Test "//*~"
- , Test "//autom4te*"
- , Test "//dist"
- , Test "//dist-install"
- , Test "//log"
- , Test "//stage0"
- , Test "//stage1"
- , Test "//stage2"
- , Test "//stage3"
- , Test "hadrian/.cabal-sandbox"
- , Test "hadrian/.stack-work"
- , Test "hadrian/UserSettings.hs"
- , Test "hadrian/cabal.sandbox.config"
- , Test "hadrian/cfg/system.config"
- , Test "hadrian/bin"
- , Test "hadrian/dist"
- , Test "hadrian/dist-newstyle"
- , Test "libraries//*.buildinfo"
- , Test "libraries//GNUmakefile"
- , Test "libraries//config.log"
- , Test "libraries//config.status"
- , Test "libraries//configure"
- , Test "libraries//ghc.mk"
- , Test "libraries//include/Hs*Config.h"
- , Test "libraries/dph"
- , Test "libraries/parallel"
- , Test "libraries/primitive"
- , Test "libraries/random"
- , Test "libraries/stm"
- , Test "libraries/vector"
- , Test "mk/build.mk" ]
- srcDirs =
- [ "bindisttest"
- , "compiler"
- , "distrib"
- , "docs"
- , "docs"
- , "driver"
- , "ghc"
- , "hadrian"
- , "includes"
- , "iserv"
- , "libffi"
- , "libffi-tarballs"
- , "libraries"
- , "mk"
- , "rts"
- , "rules"
- , "utils" ]
- srcFiles =
- [ "ANNOUNCE"
- , "GIT_COMMIT_ID"
- , "HACKING.md"
- , "INSTALL.md"
- , "LICENSE"
- , "MAKEHELP.md"
- , "Makefile"
- , "README.md"
- , "VERSION"
- , "aclocal.m4"
- , "boot"
- , "config.guess"
- , "config.sub"
- , "configure"
- , "configure.ac"
- , "ghc.mk"
- , "install-sh"
- , "packages"
- , "settings.in" ]