packages feed

chs-cabal 0.1.1.0 → 0.1.1.1

raw patch · 5 files changed

+27/−16 lines, 5 filesdep ~CabalPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: Cabal

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # chs-cabal +## 0.1.1.1++  * Update for Cabal 3.6+ ## 0.1.1.0    * Add `c2hsUserHooks`
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2019+Copyright Vanessa McHale (c) 2019, 2021  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
chs-cabal.cabal view
@@ -1,9 +1,9 @@ cabal-version:   1.18 name:            chs-cabal-version:         0.1.1.0+version:         0.1.1.1 license:         BSD3 license-file:    LICENSE-copyright:       Copyright: (c) 2019 Vanessa McHale+copyright:       Copyright: (c) 2019, 2021 Vanessa McHale maintainer:      vamchale@gmail.com author:          Vanessa McHale synopsis:        Cabal with c2hs dependencies@@ -28,8 +28,8 @@     ghc-options:      -Wall     build-depends:         base >=4.7 && <5,-        chs-deps -any,-        Cabal >=3.0 && <3.2+        chs-deps,+        Cabal >3.4.0.0      if impl(ghc >=8.0)         ghc-options:
src/Distribution/C2Hs.hs view
@@ -31,8 +31,13 @@ import           Distribution.Types.Library import           Distribution.Types.PackageDescription import           Distribution.Types.TestSuite+import           Distribution.Utils.Path               (PackageDir, SourceDir,+                                                        SymbolicPath,+                                                        getSymbolicPath) import           Distribution.Verbosity                (Verbosity, normal) +type CabalFP = SymbolicPath PackageDir SourceDir+ defaultMainC2Hs :: IO () defaultMainC2Hs = defaultMainWithHooks c2hsUserHooks @@ -43,24 +48,27 @@                                 , replHook = c2hsReplHooks                                 } +reorderC2Hs' :: Verbosity -> [CabalFP] -> [ModuleName] -> IO [ModuleName]+reorderC2Hs' v fps = reorderC2Hs v (fmap getSymbolicPath fps)+ -- | Custom build hooks to be used with @.chs@ files which @{\#import\#}@ one -- another. c2hsBuildHooks :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () c2hsBuildHooks = \pd lbi hooks bf -> do     let v = getVerbosity bf-    pd' <- mapPackageDescription (reorderC2Hs v) pd+    pd' <- mapPackageDescription (reorderC2Hs' v) pd     buildHook simpleUserHooks pd' lbi hooks bf  c2hsHaddockHooks :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO () c2hsHaddockHooks = \pd lbi hooks hf -> do     let v = getHaddockVerbosity hf-    pd' <- mapPackageDescription (reorderC2Hs v) pd+    pd' <- mapPackageDescription (reorderC2Hs' v) pd     haddockHook simpleUserHooks pd' lbi hooks hf  c2hsReplHooks :: PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO () c2hsReplHooks = \pd lbi hooks rf ss -> do     let v = getReplVerbosity rf-    pd' <- mapPackageDescription (reorderC2Hs v) pd+    pd' <- mapPackageDescription (reorderC2Hs' v) pd     replHook simpleUserHooks pd' lbi hooks rf ss  getHaddockVerbosity :: HaddockFlags -> Verbosity@@ -72,7 +80,7 @@ getReplVerbosity :: ReplFlags -> Verbosity getReplVerbosity ReplFlags { replVerbosity = v } = fromFlagOrDefault normal v -mapPackageDescription :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> PackageDescription -> IO PackageDescription+mapPackageDescription :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> PackageDescription -> IO PackageDescription mapPackageDescription f p@PackageDescription { library = ml                                              , subLibraries = ls                                              , executables = es@@ -94,7 +102,7 @@              , benchmarks = bs'              } -mapLibrary :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> Library -> IO Library+mapLibrary :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> Library -> IO Library mapLibrary f lib@Library { exposedModules = es, libBuildInfo = bi } = do     let dirs = hsSourceDirs bi         om = otherModules bi@@ -106,27 +114,27 @@         -- egregious     pure $ lib { exposedModules = newMods, libBuildInfo = bi' } -mapBenchmark :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> Benchmark -> IO Benchmark+mapBenchmark :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> Benchmark -> IO Benchmark mapBenchmark f b@Benchmark { benchmarkBuildInfo = bi } = do     bi' <- mapBuildInfo f bi     pure $ b { benchmarkBuildInfo = bi' } -mapExecutable :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> Executable -> IO Executable+mapExecutable :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> Executable -> IO Executable mapExecutable f e@Executable { buildInfo = bi } = do     bi' <- mapBuildInfo f bi     pure $ e { buildInfo = bi' } -mapForeignLibrary :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> ForeignLib -> IO ForeignLib+mapForeignLibrary :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> ForeignLib -> IO ForeignLib mapForeignLibrary f fl@ForeignLib { foreignLibBuildInfo = bi } = do     bi' <- mapBuildInfo f bi     pure $ fl { foreignLibBuildInfo = bi' } -mapTestSuite :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> TestSuite -> IO TestSuite+mapTestSuite :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> TestSuite -> IO TestSuite mapTestSuite f t@TestSuite { testBuildInfo = bi } = do     bi' <- mapBuildInfo f bi     pure $ t { testBuildInfo = bi' } -mapBuildInfo :: ([FilePath] -> [ModuleName] -> IO [ModuleName]) -> BuildInfo -> IO BuildInfo+mapBuildInfo :: ([CabalFP] -> [ModuleName] -> IO [ModuleName]) -> BuildInfo -> IO BuildInfo mapBuildInfo f bi@BuildInfo { otherModules = om, hsSourceDirs = dirs } = do     om' <- f dirs om     pure $ bi { otherModules = om' }
src/Distribution/C2Hs/TopSort.hs view
@@ -40,4 +40,3 @@             Nothing -> warn v ("Cannot parse module name in .chs file " ++ f) $> []         Left err -> warn v ("Cannot parse c2hs import in " ++ f ++ ": " ++ err) $> []     pure (N m m mods)-