summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-02-28 14:19:30 -0400
committerJoey Hess2015-02-28 14:19:30 -0400
commit15b2c167b502a18a42903bf4d9d249e678e96450 (patch)
tree2e8dd10fb90896eab4b7526bed51cd6d02316afc /src
parent9619e62183c00f9ad4600d021150d7f77d68fa13 (diff)
parent6734d89eb49f20329b1c8d5f84a0c462d12a67cc (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Bootstrap.hs30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 45340832..214f65d5 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -13,7 +13,7 @@ import Data.List
type ShellCommand = String
-- Shell command line to build propellor, used when bootstrapping on a new
--- host. Should be run inside the propellor source tree, and will install
+-- host. Should be run inside the propellor config dir, and will install
-- all necessary build dependencies.
bootstrapPropellorCommand :: ShellCommand
bootstrapPropellorCommand = "if ! test -x ./propellor; then " ++ go ++ "; fi"
@@ -30,23 +30,34 @@ buildCommand = intercalate " && "
, "ln -sf dist/build/propellor-config/propellor-config propellor"
]
+-- Install build dependencies of propellor.
+--
+-- First, try to install ghc, cabal, gnupg, and all haskell libraries that
+-- propellor uses from OS packages.
+--
+-- Some packages may not be available in some versions of Debian
+-- (eg, Debian wheezy lacks async), or propellor may need a newer version.
+-- So, as a second step, cabal is used to install all dependencies.
+--
+-- Note: May succeed and leave some deps not installed.
depsCommand :: ShellCommand
-depsCommand =
- "(" ++ aptinstall debdeps ++ " || (apt-get update && " ++ aptinstall debdeps ++ ")) && "
- ++ "(" ++ aptinstall ["libghc-async-dev"] ++ " || (" ++ cabalinstall ["async"] ++ ")) || "
- ++ "(" ++ cabalinstall ["--only-dependencies"] ++ ")"
+depsCommand = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ " ) || true"
where
- aptinstall ps = "apt-get --no-upgrade --no-install-recommends -y install " ++ unwords ps
+ osinstall = "apt-get update" : map aptinstall debdeps
- cabalinstall ps = "cabal update; cabal install " ++ unwords ps
+ cabalinstall =
+ [ "cabal update"
+ , "cabal install --only-dependencies"
+ ]
+
+ aptinstall p = "apt-get --no-upgrade --no-install-recommends -y install " ++ p
-- This is the same build deps listed in debian/control.
debdeps =
[ "gnupg"
, "ghc"
, "cabal-install"
- -- async is not available in debian stable
- -- , "libghc-async-dev"
+ , "libghc-async-dev"
, "libghc-missingh-dev"
, "libghc-hslogger-dev"
, "libghc-unix-compat-dev"
@@ -58,7 +69,6 @@ depsCommand =
, "libghc-monadcatchio-transformers-dev"
]
-
installGitCommand :: ShellCommand
installGitCommand = "if ! git --version >/dev/null; then apt-get update && apt-get --no-install-recommends --no-upgrade -y install git; fi"