cabal-helper 0.3.0.0 → 0.3.1.0
raw patch · 2 files changed
+19/−10 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Distribution.Helper: buildPlatform :: IO String
Files
- Distribution/Helper.hs +14/−8
- cabal-helper.cabal +5/−2
Distribution/Helper.hs view
@@ -38,6 +38,9 @@ , ChComponentName(..) , ChEntrypoint(..) + -- * General information+ , buildPlatform+ -- * Managing @dist/@ , reconfigure , writeAutogenFiles@@ -54,6 +57,7 @@ import Control.Monad.State.Strict import Control.Monad.Reader import Control.Exception as E+import Data.Char import Data.Monoid import Data.List import Data.Default@@ -202,8 +206,17 @@ -> m () writeAutogenFiles distdir = liftIO $ do exe <- findLibexecExe "cabal-helper-wrapper"- callProcess' exe [distdir, "write-autogen-files"]+ void $ readProcess exe [distdir, "write-autogen-files"] "" +buildPlatform :: IO String+buildPlatform = do+ exe <- findLibexecExe "cabal-helper-wrapper"+ dropWhileEnd isSpace <$> readProcess exe ["print-build-platform"] ""+ where+ -- dropWhileEnd is not provided prior to base 4.5.0.0.+ dropWhileEnd :: (a -> Bool) -> [a] -> [a]+ dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) []+ -- | This exception is thrown by all 'runQuery' functions if the internal -- wrapper executable cannot be found. You may catch this and present the user -- an appropriate error message however the default is to print@@ -275,11 +288,4 @@ getExecutablePath #else getProgName-#endif--callProcess' exe args =-#if MIN_VERSION_process(1,2,0)- callProcess exe args-#else- void $ readProcess exe args "" #endif
cabal-helper.cabal view
@@ -1,5 +1,5 @@ name: cabal-helper-version: 0.3.0.0+version: 0.3.1.0 synopsis: Simple interface to Cabal's configuration state used by ghc-mod description: @cabal-helper@ provides a library which wraps the internal use of executables@@ -21,6 +21,9 @@ Furthermore the wrapper supports one special case namely reading a state file for Cabal itself. This is needed as Cabal compiles it's Setup.hs using itself and not using any version of Cabal installed in any package database.+ .+ @cabal-helper@ can compile with @Cabal >= 1.14@ but requires @Cabal >= 1.16@+ at runtime. license: AGPL-3 license-file: LICENSE@@ -62,7 +65,7 @@ X-Install-Target: $libexecdir Build-Depends: base >= 4.5 && < 5 , bytestring- , Cabal >= 1.16 && <= 1.22+ , Cabal >= 1.14 && < 1.23 , directory , filepath , process