diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-04-02 12:05:07 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-04-02 12:07:12 -0400 |
| commit | ecf786ddab0161a4f5fa84e07cced60efb1595cd (patch) | |
| tree | 37d77302fc57a274d30f392fdca8e8cd1c284f24 | |
| parent | db2d46246c5772c12aa8cf64ea604b65d164a7b0 (diff) | |
got rid of build flag to detect stack
| -rw-r--r-- | propellor.cabal | 6 | ||||
| -rw-r--r-- | src/Propellor/DotDir.hs | 20 | ||||
| -rw-r--r-- | stack.yaml | 3 |
3 files changed, 7 insertions, 22 deletions
diff --git a/propellor.cabal b/propellor.cabal index 3431d410..d97d4096 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -34,10 +34,6 @@ Description: . It is configured using haskell. -Flag UseStack - Description: Have propellor rebuild itself using Stack (default is Cabal) - Default: False - Executable propellor Main-Is: wrapper.hs GHC-Options: -threaded -Wall -fno-warn-tabs -O0 @@ -50,8 +46,6 @@ Executable propellor unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async, time, mtl, transformers, exceptions (>= 0.6), stm, text, concurrent-output - if flag(UseStack) - CPP-Options: -DUSE_STACK Executable propellor-config Main-Is: config.hs diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index 43067417..21479cb1 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE CPP #-} - module Propellor.DotDir where import Propellor.Message @@ -53,14 +51,11 @@ dotPropellor = do home <- myHomeDir return (home </> ".propellor") -data InitCfg = UseCabal | UseStack - -initCfg :: InitCfg -#ifdef USE_STACK -initCfg = UseStack -#else -initCfg = UseCabal -#endif +-- Detect if propellor was built using stack. This is somewhat of a hack. +buildSystem :: IO String +buildSystem = do + d <- Package.getLibDir + return $ if "stack-work" `isInfixOf` d then "stack" else "cabal" interactiveInit :: IO () interactiveInit = ifM (doesDirectoryExist =<< dotPropellor) @@ -125,12 +120,11 @@ setup = do section putStrLn "Let's try building the propellor configuration, to make sure it will work..." putStrLn "" + b <- buildSystem void $ boolSystem "git" [ Param "config" , Param "propellor.buildsystem" - , Param $ case initCfg of - UseCabal -> "cabal" - UseStack -> "stack" + , Param b ] buildPropellor Nothing putStrLn "" @@ -1,6 +1,3 @@ resolver: lts-5.10 packages: - '.' -flags: - propellor: - usestack: true |
