git.iko.soy/typeable/http-api-data
on master help sign in
allow newer in all cabal execs
b473c6aOleg Grenrus
.travis.yml+2−2
@@ -90,7 +90,7 @@ script:
90 - cabal new-build ${CABALFLAGS} -w ${HC} --disable-tests --disable-benchmarks --flag http-api-data:use-text-show
90 - cabal new-build ${CABALFLAGS} -w ${HC} --disable-tests --disable-benchmarks --flag http-api-data:use-text-show
91 # this builds all libraries and executables (including tests/benchmarks)
91 # this builds all libraries and executables (including tests/benchmarks)
92 # - rm -rf ./dist-newstyle
92 # - rm -rf ./dist-newstyle
93− - cabal new-build -w ${HC} ${TEST} ${BENCH}
93+ - cabal new-build ${CABALFLAGS} -w ${HC} ${TEST} ${BENCH}
94
94
95 # there's no 'cabal new-test' yet, so let's emulate for now
95 # there's no 'cabal new-test' yet, so let's emulate for now
96 - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
96 - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
@@ -100,7 +100,7 @@ script:
100 if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
100 if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
101 else echo "= $T FAILED ="; RC=false; fi; done; $RC
101 else echo "= $T FAILED ="; RC=false; fi; done; $RC
102
102
103− - cabal new-build -w ${HC} ${TEST} ${BENCH} --flag http-api-data:use-text-show
103+ - cabal new-build ${CABALFLAGS} -w ${HC} ${TEST} ${BENCH} --flag http-api-data:use-text-show
104 - shopt -s globstar;
104 - shopt -s globstar;
105 RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
105 RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
106 if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
106 if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
Setup.lhs+8−15
@@ -8,18 +8,18 @@
8#endif
8#endif
9module Main (main) where
9module Main (main) where
10
10
11+import Control.Monad ( when )
11import Data.List ( nub )
12import Data.List ( nub )
12import Distribution.Package ( InstalledPackageId )
13import Distribution.Package ( InstalledPackageId )
13−import Distribution.Package ( PackageId, Package (..), packageVersion, packageName )
14+import Distribution.Package ( PackageId, Package (..), packageVersion )
14import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) , Library (..), BuildInfo (..))
15import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) , Library (..), BuildInfo (..))
15import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
16import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
16−import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose, copyFiles )
17+import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )
17import Distribution.Simple.BuildPaths ( autogenModulesDir )
18import Distribution.Simple.BuildPaths ( autogenModulesDir )
18−import Distribution.Simple.Setup ( BuildFlags(buildDistPref, buildVerbosity), Flag(..), fromFlag, HaddockFlags(haddockDistPref))
19+import Distribution.Simple.Setup ( BuildFlags(buildDistPref, buildVerbosity), fromFlag)
19−import Distribution.Simple.LocalBuildInfo ( withPackageDB, withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps), compiler, buildDir )
20+import Distribution.Simple.LocalBuildInfo ( withPackageDB, withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps), compiler )
20import Distribution.Simple.Compiler ( showCompilerId , PackageDB (..))
21import Distribution.Simple.Compiler ( showCompilerId , PackageDB (..))
21import Distribution.Text ( display , simpleParse )
22import Distribution.Text ( display , simpleParse )
22−import Distribution.Verbosity ( Verbosity, normal )
23import System.FilePath ( (</>) )
23import System.FilePath ( (</>) )
24
24
25#if MIN_VERSION_Cabal(1,25,0)
25#if MIN_VERSION_Cabal(1,25,0)
@@ -33,13 +33,6 @@ main = defaultMainWithHooks simpleUserHooks
33 buildHook simpleUserHooks pkg lbi hooks flags
33 buildHook simpleUserHooks pkg lbi hooks flags
34 }
34 }
35
35
36−haddockOutputDir :: Package p => HaddockFlags -> p -> FilePath
37−haddockOutputDir flags pkg = destDir where
38− baseDir = case haddockDistPref flags of
39− NoFlag -> "."
40− Flag x -> x
41− destDir = baseDir </> "doc" </> "html" </> display (packageName pkg)
42−
43generateBuildModule :: BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
36generateBuildModule :: BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
44generateBuildModule flags pkg lbi = do
37generateBuildModule flags pkg lbi = do
45 let verbosity = fromFlag (buildVerbosity flags)
38 let verbosity = fromFlag (buildVerbosity flags)
@@ -49,7 +42,6 @@ generateBuildModule flags pkg lbi = do
49 let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> "package.conf.inplace" ]
42 let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref </> "package.conf.inplace" ]
50 let dbFlags = "-hide-all-packages" : packageDbArgs dbStack
43 let dbFlags = "-hide-all-packages" : packageDbArgs dbStack
51
44
52− let bdir = buildDir lbi
53 withLibLBI pkg lbi $ \lib libcfg -> do
45 withLibLBI pkg lbi $ \lib libcfg -> do
54 let libBI = libBuildInfo lib
46 let libBI = libBuildInfo lib
55
47
@@ -67,8 +59,9 @@ generateBuildModule flags pkg lbi = do
67 -- CPP includes, i.e. include cabal_macros.h
59 -- CPP includes, i.e. include cabal_macros.h
68 let cppFlags = [ "-optP-include", "-optP" ++ libAutogenDir ++ "/cabal_macros.h" ]
60 let cppFlags = [ "-optP-include", "-optP" ++ libAutogenDir ++ "/cabal_macros.h" ]
69
61
62+ -- Actually we need to check whether testName suite == "doctests"
63+ -- pending https://github.com/haskell/cabal/pull/4229 getting into GHC HEAD tree
70− withTestLBI pkg lbi $ \suite suitecfg -> do
64+ withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == testName suite) $ do
71− -- when (testName suite == "doctests") $ we need IsString instance
72
65
73 -- get and create autogen dir
66 -- get and create autogen dir
74#if MIN_VERSION_Cabal(1,25,0)
67#if MIN_VERSION_Cabal(1,25,0)