packages feed

ats-pkg 2.4.2.9 → 2.4.2.18

raw patch · 9 files changed

+46/−17 lines, 9 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Language.ATS.Package: [$sel:description:ATSDependency] :: ATSDependency -> Maybe Text
+ Language.ATS.Package: displayList :: String -> IO ()
- Language.ATS.Package: ATSDependency :: Text -> Text -> Text -> Version -> [LibDep] -> ATSDependency
+ Language.ATS.Package: ATSDependency :: Text -> Text -> Text -> Maybe Text -> Version -> [LibDep] -> ATSDependency

Files

README.md view
@@ -62,7 +62,7 @@  ### Source -Alternately, you can download+If that doesn't work, you can download [Cabal](https://www.haskell.org/cabal/download.html) and [GHC](https://www.haskell.org/ghc/download.html) and install with 
ats-pkg.cabal view
@@ -1,5 +1,5 @@ name:                ats-pkg-version:             2.4.2.9+version:             2.4.2.18 synopsis:            A build tool for ATS description:         A collection of scripts to simplify building ATS projects. homepage:            https://github.com/vmchale/atspkg#readme
src/Language/ATS/Package.hs view
@@ -11,6 +11,7 @@                             , mkBuildPlan                             , buildHelper                             , checkPkg+                            , displayList                             -- * Types                             , Version (..)                             , Pkg (..)
src/Language/ATS/Package/Dependency.hs view
@@ -65,7 +65,7 @@ atslibSetup lib' p = do     putStrLn $ "installing " ++ lib' ++ "..."     subdirs <- allSubdirs p-    pkgPath <- fromMaybe p <$> findFile subdirs "atspkg.dhall" -- FIXME this will fail for more than one package+    pkgPath <- fromMaybe p <$> findFile subdirs "atspkg.dhall"     void $ readCreateProcess ((proc "atspkg" ["install"]) { cwd = Just (takeDirectory pkgPath), std_err = CreatePipe }) ""  clibSetup :: CCompiler -- ^ C compiler@@ -87,7 +87,7 @@  atsPkgSetup :: ATSDependency             -> IO ()-atsPkgSetup (ATSDependency lib' dirName' _ _ _) = do+atsPkgSetup (ATSDependency lib' dirName' _ _ _ _) = do     lib'' <- (<> unpack lib') <$> pkgHome GCCStd     b <- doesFileExist lib''     unless b $ do@@ -97,7 +97,7 @@ setup :: CCompiler -- ^ C compiler to use       -> ATSDependency -- ^ ATSDependency itself       -> IO ()-setup cc' (ATSDependency lib' dirName' _ _ _) = do+setup cc' (ATSDependency lib' dirName' _ _ _ _) = do     lib'' <- (<> unpack lib') <$> pkgHome cc'     b <- doesFileExist lib''     unless b $ do@@ -124,7 +124,7 @@     extractFilesFromArchive [options] (toArchive response)  buildHelper :: Bool -> ATSDependency -> IO ()-buildHelper b (ATSDependency lib' dirName' url'' _ _) = do+buildHelper b (ATSDependency lib' dirName' url'' _ _ _) = do      let (lib, dirName, url') = (lib', dirName', url'') & each %~ unpack 
src/Language/ATS/Package/Exec.hs view
@@ -2,8 +2,9 @@  module Language.ATS.Package.Exec ( exec                                  ) where+ import           Control.Composition-import           Control.Lens               hiding (argument)+import           Control.Lens               hiding (List, argument) import           Data.Bool                  (bool) import           Data.Maybe                 (fromMaybe) import           Data.Semigroup             (Semigroup (..))@@ -43,6 +44,7 @@              | Valgrind { _targets :: [String] }              | Run { _targets :: [String] }              | Check { _filePath :: String, _details :: Bool }+             | List  command' :: Parser Command command' = hsubparser@@ -56,6 +58,7 @@     <> command "valgrind" (info valgrind (progDesc "Run generated binaries through valgrind"))     <> command "run" (info run' (progDesc "Run generated binaries"))     <> command "check" (info check' (progDesc "Check pkg.dhall file to ensure it is well-typed."))+    <> command "list" (info (pure List) (progDesc "List available packages"))     )  check' :: Parser Command@@ -127,7 +130,7 @@ fetchPkg :: String -> IO () fetchPkg pkg = withSystemTempDirectory "atspkg" $ \p -> do     let (lib, dirName, url') = (mempty, p, pkg) & each %~ TL.pack-    buildHelper True (ATSDependency lib dirName url' undefined mempty)+    buildHelper True (ATSDependency lib dirName url' undefined undefined mempty)     ps <- getSubdirs p     pkgDir <- fromMaybe p <$> findFile (p:ps) "atspkg.dhall"     let a = withCurrentDirectory (takeDirectory pkgDir) (mkPkg False False False mempty ["install"] Nothing 0)@@ -143,6 +146,7 @@     =<< check Nothing  run :: Command -> IO ()+run List = displayList "https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/pkg-set.dhall" run (Check p b) = print =<< checkPkg p b run Upgrade = upgradeAtsPkg run Nuke = cleanAll
src/Language/ATS/Package/PackageSet.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings          #-} {-# LANGUAGE RecordWildCards            #-}@@ -5,6 +6,7 @@ module Language.ATS.Package.PackageSet ( ATSPackageSet (..)                                        , setBuildPlan                                        , mkBuildPlan+                                       , displayList                                        ) where  import qualified Data.ByteString.Lazy       as BSL@@ -15,11 +17,25 @@ import           Language.ATS.Package.Type import           Quaalude --- TODO string instance? string :: Type String- newtype ATSPackageSet = ATSPackageSet [ ATSDependency ]     deriving (Interpret, Show) +instance Pretty Version where+    pretty v = text (show v)++instance Pretty ATSDependency where+    pretty (ATSDependency ln _ url Nothing v _) = dullyellow (text (unpack ln)) <#> indent 4 ("url:" <+> text (unpack url) <#> "version:" <+> pretty v) <> hardline+    pretty (ATSDependency ln _ url (Just d) v _) = dullyellow (text (unpack ln)) <#> indent 4 ("description:" <+> text (unpack d) <#> "url:" <+> text (unpack url) <#> "version:" <+> pretty v) <> hardline++instance Pretty ATSPackageSet where+    pretty (ATSPackageSet ds) = mconcat (punctuate hardline (pretty <$> ds))++displayList :: String -> IO ()+displayList = putDoc . pretty <=< listDeps++listDeps :: String -> IO ATSPackageSet+listDeps = input auto . pack+ setBuildPlan :: FilePath -- ^ Filepath for cache inside @.atspkg@              -> String -- ^ URL of package set to use.              -> [String] -- ^ Libraries we want@@ -30,10 +46,12 @@      where depCache = ".atspkg/buildplan-" ++ p           setBuildPlan' = do-            pkgSet <- input auto (pack url)+            pkgSet <- listDeps url             case mkBuildPlan pkgSet deps of-                Right x -> createDirectoryIfMissing True ".atspkg" >> BSL.writeFile depCache (encode x) >> pure x                 Left x  -> resolutionFailed x+                Right x -> createDirectoryIfMissing True ".atspkg" >>+                           BSL.writeFile depCache (encode x) >>+                           pure x  mkBuildPlan :: ATSPackageSet -> [String] -> DepM [[ATSDependency]] mkBuildPlan aps@(ATSPackageSet ps) = finalize . resolve . fmap asDep <=< stringBuildPlan
src/Language/ATS/Package/Type.hs view
@@ -39,11 +39,12 @@ type LibDep = (Text, ATSConstraint)  -- | Type for a dependency-data ATSDependency = ATSDependency { libName    :: Text -- ^ Library name, e.g.-                                   , dir        :: Text -- ^ Directory we should unpack to-                                   , url        :: Text -- ^ Url pointing to tarball-                                   , libVersion :: Version-                                   , libDeps    :: [LibDep] -- ^ Strings containing dependencies+data ATSDependency = ATSDependency { libName     :: Text -- ^ Library name, e.g.+                                   , dir         :: Text -- ^ Directory we should unpack to+                                   , url         :: Text -- ^ Url pointing to tarball+                                   , description :: Maybe Text -- ^ Package description+                                   , libVersion  :: Version+                                   , libDeps     :: [LibDep] -- ^ Strings containing dependencies                                    }                    deriving (Eq, Show, Generic, Interpret, Binary) 
src/Quaalude.hs view
@@ -78,8 +78,12 @@                 -- * "Text.PrettyPrint.ANSI.Leijen" reëxports                 , (<+>)                 , text+                , punctuate                 , red+                , dullyellow+                , hardline                 , hang+                , indent                 , putDoc                 , Pretty (pretty)                 , module X
stack.yaml view
@@ -6,6 +6,7 @@   - 'shake-ats'   - 'hs2ats' extra-deps:+  - dhall-1.9.1   - shake-ext-2.5.0.0   - composition-prelude-1.2.0.1   - language-ats-0.3.0.4