diff options
-rw-r--r-- | Config.hs (renamed from configure.hs) | 9 | ||||
-rw-r--r-- | Setup.lhs | 37 | ||||
-rw-r--r-- | configure | 3 | ||||
-rw-r--r-- | hmatrix.cabal | 2 |
4 files changed, 41 insertions, 10 deletions
@@ -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 | ||
17 | module Config(config) where | ||
18 | |||
20 | import System.Process | 19 | import System.Process |
21 | import System.Exit | 20 | import System.Exit |
22 | import System.Environment | 21 | import 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 | ||
100 | main = do | 99 | config = 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 |
@@ -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 | |||
3 | runhaskell 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 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.11.0.2 | 2 | Version: 0.11.0.3 |
3 | License: GPL | 3 | License: GPL |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: Alberto Ruiz |