check at configure time for sha commands in Mac OSX location

This commit is contained in:
Joey Hess 2012-05-31 23:33:07 -04:00
parent 2183fd2abd
commit 665c0fbdaa
2 changed files with 12 additions and 9 deletions

View file

@ -6,6 +6,7 @@ import System.Directory
import Data.List
import System.Cmd.Utils
import Control.Applicative
import System.FilePath
import Build.TestConfig
import Utility.SafeCommand
@ -30,12 +31,17 @@ tests =
shaTestCases :: Bool -> [Int] -> [TestCase]
shaTestCases required l = map make l
where make n =
let
cmds = map (\x -> "sha" ++ show n ++ x) ["", "sum"]
key = "sha" ++ show n
selector = if required then selectCmd else maybeSelectCmd
in TestCase key $ selector key cmds "</dev/null"
where
make n = TestCase key $ selector key (shacmds n) "</dev/null"
where
key = "sha" ++ show n
selector = if required then selectCmd else maybeSelectCmd
shacmds n = concatMap (\x -> [x, osxpath </> x]) $
map (\x -> "sha" ++ show n ++ x) ["", "sum"]
-- Max OSX puts GNU tools outside PATH, so look in
-- the location it uses, and remember where to run them
-- from.
osxpath = "/opt/local/libexec/gnubin"
tmpDir :: String
tmpDir = "tmp"

View file

@ -7,9 +7,6 @@ sudo port install git-core ossp-uuid md5sha1sum coreutils pcre
sudo ln -s /opt/local/include/pcre.h /usr/include/pcre.h # This is hack that allows pcre-light to find pcre
# this will enable the gnu tools, (to give sha256sum etc..., it does not override the BSD userland)
export PATH=$PATH:/opt/local/libexec/gnubin
git clone git://git-annex.branchable.com/ git-annex
cd git-annex
git checkout ghc7.0