packages feed

shake-ats 1.9.0.5 → 1.10.0.1

raw patch · 4 files changed

+20/−13 lines, 4 filesdep ~shake-cabalPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: shake-cabal

API changes (from Hackage documentation)

- Development.Shake.ATS: cabalForeign :: CCompiler -> ForeignCabal -> Rules ()
+ Development.Shake.ATS: cabalForeign :: HsCompiler -> ForeignCabal -> Rules ()

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # shake-ats +## 1.10.0.0++  * Make `cabalForeign` take a `HsCompiler` instead of a `CCompiler`.+ ## 1.9.0.5    * Bugfix for recent version of `shake-cabal`
shake-ats.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: shake-ats-version: 1.9.0.5+version: 1.10.0.1 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale
src/Development/Shake/ATS.hs view
@@ -43,7 +43,9 @@ import           Development.Shake.ATS.Environment import           Development.Shake.ATS.Rules import           Development.Shake.ATS.Type-import           Development.Shake.C+import           Development.Shake.C               hiding (GHC)+import qualified Development.Shake.C               as C+import           Development.Shake.Cabal import           Development.Shake.FilePath import           Development.Shake.Version import           Language.ATS@@ -140,7 +142,7 @@ atsToC :: FilePath -> FilePath atsToC = (-<.> "c") . ((".atspkg" </> "c") </>) -ghcV :: CCompiler -> [ForeignCabal] -> Action String+ghcV :: HsCompiler -> [ForeignCabal] -> Action String ghcV (GHC _ suff) hsLibs' = maybe def' (fmap (drop 1)) (pure <$> suff) where     def' = case hsLibs' of         [] -> pure undefined@@ -157,11 +159,12 @@ satsGen :: HATSGen -> Rules () satsGen (HATSGen x y) = genLinks x y --- /.atspkg/contrib/atscntrb-hx-libgmp+ccToHsc :: CCompiler -> HsCompiler+ccToHsc (C.GHC pref suff) = GHC pref suff+ccToHsc _                 = GHC Nothing Nothing  -- | Rules for generating binaries or libraries from ATS code. This is very--- general; use 'defaultATSTarget' for sensible defaults that can be modified--- with the provided lenses.+-- general; use 'defaultATSTarget' for sensible defaults. atsBin :: ATSTarget -> Rules () atsBin ATSTarget{..} = do @@ -169,7 +172,7 @@      traverse_ hsAts _genTargets -    traverse_ (cabalForeign (_cc _toolConfig)) _hsLibs+    traverse_ (cabalForeign (ccToHsc $ _cc _toolConfig)) _hsLibs      let cTargets = atsToC <$> _src @@ -196,7 +199,7 @@          need (h' cTargets) -        ghcV' <- ghcV (_cc _toolConfig) _hsLibs+        ghcV' <- ghcV (ccToHsc $ _cc _toolConfig) _hsLibs          cconfig'' <- cconfig _toolConfig _libs _gc (makeCFlags _cFlags _hsLibs ghcV' _gc) 
src/Development/Shake/ATS/Rules.hs view
@@ -15,10 +15,10 @@ import           Development.Shake              hiding (doesDirectoryExist) import           Development.Shake.ATS.Generate import           Development.Shake.ATS.Type     hiding (ATSTarget (..))-import           Development.Shake.C-import           Development.Shake.Cabal        hiding (GHC)+import           Development.Shake.Cabal import           Development.Shake.FilePath import           Development.Shake.Version+import           Language.ATS import           Language.ATS.Generate import           System.Directory @@ -38,7 +38,7 @@     link %> \out -> liftIO $ do         contents <- readFile dats         let proc = generateLinks contents-        writeFile out (either undefined id proc) -- FIXME better error+        either printErr (flip writeFile out) proc  -- | Get subdirectories recursively. getSubdirs :: FilePath -> IO [FilePath]@@ -53,7 +53,7 @@  -- | These rules take a @.cabal@ file and the @.o@ file to be produced from -- them, building the @.o@ file.-cabalForeign :: CCompiler -> ForeignCabal -> Rules () -- TODO HsCompiler?+cabalForeign :: HsCompiler -> ForeignCabal -> Rules () cabalForeign (GHC _ suff) (ForeignCabal cbp' cf' obf') = do      let cf = TL.unpack cf'@@ -83,7 +83,7 @@          let hdr = dropExtension obj ++ "_stub.h"         liftIO $ copyFile hdr (takeDirectory out </> takeFileName hdr)-cabalForeign _ _ = error "CCompiler must be GHC"+cabalForeign _ _ = error "HsCompiler must be GHC"  -- | Build a @.lats@ file using @atslex@. atsLex :: FilePath -- ^ Filepath of @.lats@ file