git.iko.soy/typeable/entropy
on main help sign in
Merge pull request #7 from hamishmack/master

Revert "Use template haskell to fix the call to withTempDirectory in Setup.hs so that it works with Cabal 1.17"

commit713f554ed92f087de338651659e5926026e2d2f0 authorThomas M. DuBuisson <Thomas.DuBuisson@gmail.com> dateThu 1 Aug 2013, 16:37 (13 years ago) parent2e522014a9c532
1 file changed+1−7
Setup.hs+1−7
Setup.hs+1−7
@@ -1,4 +1,3 @@
1−{-# LANGUAGE TemplateHaskell #-}
21import Distribution.Simple
32import Distribution.Simple.LocalBuildInfo
43import Distribution.Simple.Setup
@@ -10,7 +9,6 @@ import System.Process
109import System.Directory
1110import System.FilePath
1211import System.Exit
13−import Language.Haskell.TH (appE, varE, mkName, conE)
1412
1513main = defaultMainWithHooks hk
1614 where
@@ -34,11 +32,7 @@ cArgsHC = map ("-optc" ++) cArgs
3432
3533canUseRDRAND :: FilePath -> IO Bool
3634canUseRDRAND cc = do
37− -- Template haskell to call withTempDirectory in a backward compatible way
38− -- withTempDirectory normal False "" "testRDRAND" $ \tmpDir -> do
39− $(if cabalVersion >= Version [1,17,0] []
40− then appE (appE (varE $ mkName "withTempDirectory") (varE 'normal)) (conE (mkName "False"))
41− else appE (varE $ mkName "withTempDirectory") (varE 'normal)) "" "testRDRAND" $ \tmpDir -> do
35+ withTempDirectory normal "" "testRDRAND" $ \tmpDir -> do
4236 writeFile (tmpDir ++ "/testRDRAND.c")
4337 (unlines [ "#include <stdint.h>"
4438 , "int main() {"