summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2011-03-02 10:34:29 +0000
committerAlberto Ruiz <aruiz@um.es>2011-03-02 10:34:29 +0000
commit52178710b4c5d2a2bdd9b612d7174e0a79ffe01f (patch)
tree974b1099acd5fb3a89416e7bda3919227a267680
parent11b5d06fba6105b5da1306569a298ebdde51af79 (diff)
import Configure.hs from Setup.lhs to be compiled with the same version of Cabal
-rw-r--r--Config.hs (renamed from configure.hs)9
-rw-r--r--Setup.lhs37
-rw-r--r--configure3
-rw-r--r--hmatrix.cabal2
4 files changed, 41 insertions, 10 deletions
diff --git a/configure.hs b/Config.hs
index bced948..d76a6a2 100644
--- a/configure.hs
+++ b/Config.hs
@@ -1,7 +1,4 @@
1#! /usr/bin/env runhaskell 1{-
2{- configure.hs for hmatrix
3 ------------------------
4
5 GSL and LAPACK may require auxiliary libraries which depend on OS, 2 GSL and LAPACK may require auxiliary libraries which depend on OS,
6 distribution, and implementation. This script tries to to find out 3 distribution, and implementation. This script tries to to find out
7 the correct link command for your system. 4 the correct link command for your system.
@@ -17,6 +14,8 @@
17 14
18-} 15-}
19 16
17module Config(config) where
18
20import System.Process 19import System.Process
21import System.Exit 20import System.Exit
22import System.Environment 21import System.Environment
@@ -97,7 +96,7 @@ getUserLink = concatMap (g . drop (length linkop)) . filter (isPrefixOf linkop)
97 cs ',' = ' ' 96 cs ',' = ' '
98 cs x = x 97 cs x = x
99 98
100main = do 99config = do
101 info <- maybeGetPersistBuildConfig "dist" 100 info <- maybeGetPersistBuildConfig "dist"
102 case info of 101 case info of
103 Nothing -> putStrLn "Please run \"cabal clean\" first." >> exitFailure 102 Nothing -> putStrLn "Please run \"cabal clean\" first." >> exitFailure
diff --git a/Setup.lhs b/Setup.lhs
index 3bce97b..17efee4 100644
--- a/Setup.lhs
+++ b/Setup.lhs
@@ -2,7 +2,42 @@
2 2
3> import Distribution.Simple 3> import Distribution.Simple
4> import System.Process(system) 4> import System.Process(system)
5>
6> import Config(config)
7>
8> import Distribution.Simple.Setup
9> import Distribution.PackageDescription
10> import Distribution.Simple.LocalBuildInfo
11> import Distribution.Simple.Command
12> import Distribution.PackageDescription.Parse
13> import Distribution.Simple.Utils(info)
14> import Distribution.Verbosity
15
16> main = do
17> defaultMainWithHooks autoconfUserHooks {
18> runTests = t,
19> postConf = modifiedPostConf }
20> where modifiedPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
21> modifiedPostConf args flags pkg_descr lbi
22> = do let verbosity = fromFlag (configVerbosity flags)
23> noExtraFlags args
24>
25> config
26>
27> pbi <- getHookedBuildInfo verbosity
28> let pkg_descr' = updatePackageDescription pbi pkg_descr
29> postConf simpleUserHooks args flags pkg_descr' lbi
30
31
32> getHookedBuildInfo :: Verbosity -> IO HookedBuildInfo
33> getHookedBuildInfo verbosity = do
34> maybe_infoFile <- defaultHookedPackageDesc
35> case maybe_infoFile of
36> Nothing -> return emptyHookedBuildInfo
37> Just infoFile -> do
38> info verbosity $ "Reading parameters from " ++ infoFile
39> readHookedBuildInfo verbosity infoFile
5 40
6> main = defaultMainWithHooks autoconfUserHooks {runTests = t}
7 41
8> t _ _ _ _ = system ( "runhaskell examples/tests.hs") >> return() 42> t _ _ _ _ = system ( "runhaskell examples/tests.hs") >> return()
43
diff --git a/configure b/configure
deleted file mode 100644
index b93aee9..0000000
--- a/configure
+++ /dev/null
@@ -1,3 +0,0 @@
1#! /bin/sh
2
3runhaskell configure.hs $* \ No newline at end of file
diff --git a/hmatrix.cabal b/hmatrix.cabal
index b92cdd0..bd64998 100644
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -1,5 +1,5 @@
1Name: hmatrix 1Name: hmatrix
2Version: 0.11.0.2 2Version: 0.11.0.3
3License: GPL 3License: GPL
4License-file: LICENSE 4License-file: LICENSE
5Author: Alberto Ruiz 5Author: Alberto Ruiz