packages feed

ats-setup 0.3.1.1 → 0.4.0.0

raw patch · 2 files changed

+11/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Distribution.ATS: fetchDependencies :: [ATSDependency] -> IO ()
+ Distribution.ATS: fetchDependencies :: ConfigFlags -> [ATSDependency] -> IO ()

Files

ats-setup.cabal view
@@ -1,5 +1,5 @@ name:                ats-setup-version:             0.3.1.1+version:             0.4.0.0 synopsis:            ATS scripts for Cabal builds description:         This package contains various scripts that go in a package's @Setup.hs@ to make building libraries with ATS dependencies easier. license:             BSD3
src/Distribution/ATS.hs view
@@ -60,11 +60,13 @@ setupCompiler' :: IO () setupCompiler' = setupCompiler (Just "ats-deps") defV +-- preConf :: Args -> ConfigFlags -> IO HookedBuildInfo+ -- | This generates user hooks for a Cabal distribution that has some ATS -- library dependencies. For an example of its use, see the @Setup.hs@ of -- [fast-arithmetic](https://hackage.haskell.org/package/fast-arithmetic) atsUserHooks :: [ATSDependency] -> UserHooks-atsUserHooks deps = simpleUserHooks { preConf = \_ _ -> fetchDependencies deps >> pure emptyHookedBuildInfo+atsUserHooks deps = simpleUserHooks { preConf = \_ flags -> fetchDependencies flags deps >> pure emptyHookedBuildInfo                                     , postBuild = \_ _ _ -> maybeCleanBuild                                     } @@ -77,7 +79,7 @@  -- | Same as 'atsUserHooks', but installs @atslib@ as well. atsLibUserHooks :: [ATSDependency] -> UserHooks-atsLibUserHooks deps = simpleUserHooks { preConf = \_ _ -> mconcat [ installCompiler, fetchDependencies deps ] >> pure emptyHookedBuildInfo+atsLibUserHooks deps = simpleUserHooks { preConf = \_ flags -> mconcat [ installCompiler, fetchDependencies flags deps ] >> pure emptyHookedBuildInfo                                        , postBuild = \_ _ _ -> maybeCleanBuild                                        } -- TODO custom directory?@@ -106,8 +108,12 @@ atsPrelude v = ATSDependency ("ats2-postiats-" ++ vs ++ "-prelude") "ats-deps/prelude" ("https://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-" ++ vs ++ "/ATS2-Postiats-include-" ++ vs ++ ".tgz")     where vs = vString v -fetchDependencies :: [ATSDependency] -> IO ()-fetchDependencies = (>> stopGlobalPool) . parallel_ . fmap fetchDependency+fetchDependencies :: ConfigFlags -> [ATSDependency] -> IO ()+fetchDependencies cfs =+    bool nothing act cond+    where act = (>> stopGlobalPool) . parallel_ . fmap fetchDependency+          nothing = pure $ pure ()+          cond = (mkFlagName "with-atsdeps", True) `elem` configConfigurationsFlags cfs  fetchDependency :: ATSDependency -> IO () fetchDependency (ATSDependency libNameATS dirName url) = do