ats-pkg 2.11.0.10 → 3.0.0.0
raw patch · 15 files changed
+351/−342 lines, 15 filesdep +cli-setupdep ~basedep ~dependencydep ~dhallsetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies added: cli-setup
Dependency ranges changed: base, dependency, dhall, shake
API changes (from Hackage documentation)
- Distribution.ATS: atsPolyglotBuild :: IO ()
- Distribution.ATS: cabalHooks :: UserHooks
- Language.ATS.Package: ATSConstraint :: Maybe Version -> Maybe Version -> ATSConstraint
- Language.ATS.Package: ATSDependency :: Text -> Text -> Text -> Maybe Text -> Version -> [LibDep] -> [LibDep] -> [LibDep] -> [Text] -> ATSDependency
- Language.ATS.Package: ATSPackageSet :: [ATSDependency] -> ATSPackageSet
- Language.ATS.Package: Bin :: Text -> Text -> [Text] -> [ForeignCabal] -> [TargetPair] -> Bool -> [Text] -> Bin
- Language.ATS.Package: DepErr :: ResolveError -> PackageError
- Language.ATS.Package: ForeignCabal :: Maybe Text -> Text -> Text -> ForeignCabal
- Language.ATS.Package: InstallDirs :: a -> FilePath -> a -> String -> FilePath -> a -> String -> FilePath -> a -> [FilePath] -> a -> [FilePath] -> InstallDirs a
- Language.ATS.Package: Lib :: Text -> [Text] -> Text -> [Text] -> [Text] -> [ForeignCabal] -> [(Text, Text)] -> [TargetPair] -> [Text] -> Bool -> Lib
- Language.ATS.Package: Package :: ReaderT (InstallDirs a) IO b -> Package a b
- Language.ATS.Package: Pkg :: [Bin] -> [Bin] -> [Lib] -> Maybe Text -> Maybe Text -> Version -> Version -> [LibDep] -> [LibDep] -> [LibDep] -> Text -> [Text] -> [Text] -> [Src] -> Bool -> Solver -> Maybe Debian -> Bool -> Pkg
- Language.ATS.Package: Src :: Text -> Text -> [TargetPair] -> [Text] -> Src
- Language.ATS.Package: TargetPair :: Text -> Text -> Bool -> TargetPair
- Language.ATS.Package: Unrecognized :: String -> PackageError
- Language.ATS.Package: Version :: [Natural] -> Version
- Language.ATS.Package: [$sel:ats:TargetPair] :: TargetPair -> Text
- Language.ATS.Package: [$sel:atsFlags:Pkg] :: Pkg -> [Text]
- Language.ATS.Package: [$sel:atsGen:Src] :: Src -> [TargetPair]
- Language.ATS.Package: [$sel:atsLib:Pkg] :: Pkg -> Bool
- Language.ATS.Package: [$sel:atsSource:Pkg] :: Pkg -> [Src]
- Language.ATS.Package: [$sel:atsSrc:Src] :: Src -> Text
- Language.ATS.Package: [$sel:bin:Pkg] :: Pkg -> [Bin]
- Language.ATS.Package: [$sel:buildDeps:Pkg] :: Pkg -> [LibDep]
- Language.ATS.Package: [$sel:cTarget:Src] :: Src -> Text
- Language.ATS.Package: [$sel:ccompiler:Pkg] :: Pkg -> Text
- Language.ATS.Package: [$sel:cflags:Pkg] :: Pkg -> [Text]
- Language.ATS.Package: [$sel:clib:Pkg] :: Pkg -> [LibDep]
- Language.ATS.Package: [$sel:compiler:Pkg] :: Pkg -> Version
- Language.ATS.Package: [$sel:completions:Pkg] :: Pkg -> Maybe Text
- Language.ATS.Package: [$sel:cpphs:TargetPair] :: TargetPair -> Bool
- Language.ATS.Package: [$sel:debPkg:Pkg] :: Pkg -> Maybe Debian
- Language.ATS.Package: [$sel:dependencies:Pkg] :: Pkg -> [LibDep]
- Language.ATS.Package: [$sel:description:ATSDependency] :: ATSDependency -> Maybe Text
- Language.ATS.Package: [$sel:dir:ATSDependency] :: ATSDependency -> Text
- Language.ATS.Package: [$sel:dynLink:Pkg] :: Pkg -> Bool
- Language.ATS.Package: [$sel:extSolve:Pkg] :: Pkg -> Solver
- Language.ATS.Package: [$sel:extras:Bin] :: Bin -> [Text]
- Language.ATS.Package: [$sel:extras:Lib] :: Lib -> [Text]
- Language.ATS.Package: [$sel:extras:Src] :: Src -> [Text]
- Language.ATS.Package: [$sel:gcBin:Bin] :: Bin -> Bool
- Language.ATS.Package: [$sel:hs2ats:Bin] :: Bin -> [TargetPair]
- Language.ATS.Package: [$sel:hs2ats:Lib] :: Lib -> [TargetPair]
- Language.ATS.Package: [$sel:hs:TargetPair] :: TargetPair -> Text
- Language.ATS.Package: [$sel:hsDeps:Bin] :: Bin -> [ForeignCabal]
- Language.ATS.Package: [$sel:hsDeps:Lib] :: Lib -> [ForeignCabal]
- Language.ATS.Package: [$sel:includes:Lib] :: Lib -> [Text]
- Language.ATS.Package: [$sel:libBldDeps:ATSDependency] :: ATSDependency -> [LibDep]
- Language.ATS.Package: [$sel:libCDeps:ATSDependency] :: ATSDependency -> [LibDep]
- Language.ATS.Package: [$sel:libDeps:ATSDependency] :: ATSDependency -> [LibDep]
- Language.ATS.Package: [$sel:libName:ATSDependency] :: ATSDependency -> Text
- Language.ATS.Package: [$sel:libTarget:Lib] :: Lib -> Text
- Language.ATS.Package: [$sel:libVersion:ATSDependency] :: ATSDependency -> Version
- Language.ATS.Package: [$sel:libraries:Pkg] :: Pkg -> [Lib]
- Language.ATS.Package: [$sel:libs:Bin] :: Bin -> [Text]
- Language.ATS.Package: [$sel:libs:Lib] :: Lib -> [Text]
- Language.ATS.Package: [$sel:links:Lib] :: Lib -> [(Text, Text)]
- Language.ATS.Package: [$sel:lower:ATSConstraint] :: ATSConstraint -> Maybe Version
- Language.ATS.Package: [$sel:man:Pkg] :: Pkg -> Maybe Text
- Language.ATS.Package: [$sel:name:Lib] :: Lib -> Text
- Language.ATS.Package: [$sel:script:ATSDependency] :: ATSDependency -> [Text]
- Language.ATS.Package: [$sel:src:Bin] :: Bin -> Text
- Language.ATS.Package: [$sel:src:Lib] :: Lib -> [Text]
- Language.ATS.Package: [$sel:static:Lib] :: Lib -> Bool
- Language.ATS.Package: [$sel:target:Bin] :: Bin -> Text
- Language.ATS.Package: [$sel:test:Pkg] :: Pkg -> [Bin]
- Language.ATS.Package: [$sel:upper:ATSConstraint] :: ATSConstraint -> Maybe Version
- Language.ATS.Package: [$sel:url:ATSDependency] :: ATSDependency -> Text
- Language.ATS.Package: [$sel:version:Pkg] :: Pkg -> Version
- Language.ATS.Package: [_atsPkgSet] :: ATSPackageSet -> [ATSDependency]
- Language.ATS.Package: [binDir] :: InstallDirs a -> a -> FilePath
- Language.ATS.Package: [cabalFile] :: ForeignCabal -> Text
- Language.ATS.Package: [includeDeps] :: InstallDirs a -> a -> [FilePath]
- Language.ATS.Package: [includeDir] :: InstallDirs a -> a -> String -> FilePath
- Language.ATS.Package: [libDeps] :: InstallDirs a -> a -> [FilePath]
- Language.ATS.Package: [libDir] :: InstallDirs a -> a -> String -> FilePath
- Language.ATS.Package: [objectFile] :: ForeignCabal -> Text
- Language.ATS.Package: [projectFile] :: ForeignCabal -> Maybe Text
- Language.ATS.Package: [unPack] :: Package a b -> ReaderT (InstallDirs a) IO b
- Language.ATS.Package: atsInstallDirs :: Hashable a => IO (InstallDirs a)
- Language.ATS.Package: atspkgVersion :: Version
- Language.ATS.Package: binRules :: GenericPackage a => a -> Package a ()
- Language.ATS.Package: buildAll :: Int -> Maybe String -> Maybe FilePath -> IO ()
- Language.ATS.Package: buildHelper :: Bool -> ATSDependency -> IO ()
- Language.ATS.Package: check :: Maybe FilePath -> IO Bool
- Language.ATS.Package: checkPkg :: FilePath -> Bool -> IO (Version -> ATSDependency)
- Language.ATS.Package: checkPkgSet :: FilePath -> Bool -> IO ATSPackageSet
- Language.ATS.Package: class Hashable a => GenericPackage a
- Language.ATS.Package: cleanAll :: IO ()
- Language.ATS.Package: data ATSConstraint
- Language.ATS.Package: data ATSDependency
- Language.ATS.Package: data Bin
- Language.ATS.Package: data ForeignCabal
- Language.ATS.Package: data InstallDirs a
- Language.ATS.Package: data Lib
- Language.ATS.Package: data PackageError
- Language.ATS.Package: data Pkg
- Language.ATS.Package: data Src
- Language.ATS.Package: data TargetPair
- Language.ATS.Package: dirLens :: Lens' ATSDependency Text
- Language.ATS.Package: displayList :: String -> IO ()
- Language.ATS.Package: includeRules :: GenericPackage a => a -> Package a ()
- Language.ATS.Package: libRules :: GenericPackage a => a -> Package a ()
- Language.ATS.Package: mkPkg :: Bool -> Bool -> Bool -> [IO ()] -> [String] -> Maybe String -> Int -> IO ()
- Language.ATS.Package: newtype ATSPackageSet
- Language.ATS.Package: newtype Package a b
- Language.ATS.Package: newtype Version
- Language.ATS.Package: packageCompiler :: FilePath -> IO ()
- Language.ATS.Package: type CacheValid a = a -> a -> Bool
- Language.ATS.Package: type DepSelector = ATSDependency -> [LibDep]
- Language.ATS.Package: type LibDep = (Text, ATSConstraint)
- Language.ATS.Package: upgradeBin :: String -> String -> IO ()
+ Quaalude: ($>) :: Functor f => f a -> b -> f b
+ Quaalude: (%>) :: FilePattern -> FilePath -> Action () -> Rules ()
+ Quaalude: (%~) :: () => ASetter s t a b -> a -> b -> s -> t
+ Quaalude: (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
+ Quaalude: (&) :: () => a -> a -> b -> b
+ Quaalude: (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
+ Quaalude: (-<.>) :: FilePath -> String -> FilePath
+ Quaalude: (.*) :: () => c -> d -> a -> b -> c -> a -> b -> d
+ Quaalude: (.**) :: () => d -> e -> a -> b -> c -> d -> a -> b -> c -> e
+ Quaalude: (<#>) :: Doc -> Doc -> Doc
+ Quaalude: (<+>) :: Doc -> Doc -> Doc
+ Quaalude: (</>) :: FilePath -> FilePath -> FilePath
+ Quaalude: (<=<) :: Monad m => b -> m c -> a -> m b -> a -> m c
+ Quaalude: (~>) :: String -> Action () -> Rules ()
+ Quaalude: ChangeDigest :: Change
+ Quaalude: ChangeModtime :: Change
+ Quaalude: ChangeModtimeAndDigest :: Change
+ Quaalude: ChangeModtimeAndDigestInput :: Change
+ Quaalude: ChangeModtimeOrDigest :: Change
+ Quaalude: Chatty :: Verbosity
+ Quaalude: Diagnostic :: Verbosity
+ Quaalude: ExitSuccess :: ExitCode
+ Quaalude: LintBasic :: Lint
+ Quaalude: LintFSATrace :: Lint
+ Quaalude: Loud :: Verbosity
+ Quaalude: Normal :: Verbosity
+ Quaalude: Quiet :: Verbosity
+ Quaalude: RebuildLater :: Rebuild
+ Quaalude: RebuildNormal :: Rebuild
+ Quaalude: RebuildNow :: Rebuild
+ Quaalude: ShakeOptions :: FilePath -> Int -> String -> Verbosity -> Bool -> [FilePath] -> Maybe Lint -> [FilePath] -> [FilePattern] -> [CmdOption] -> Maybe Double -> [(Rebuild, FilePattern)] -> [(String, String)] -> Bool -> Bool -> Bool -> Bool -> Change -> Bool -> [FilePath] -> Bool -> Bool -> IO Progress -> IO () -> Verbosity -> String -> IO () -> HashMap TypeRep Dynamic -> ShakeOptions
+ Quaalude: Silent :: Verbosity
+ Quaalude: [shakeAbbreviations] :: ShakeOptions -> [(String, String)]
+ Quaalude: [shakeChange] :: ShakeOptions -> Change
+ Quaalude: [shakeColor] :: ShakeOptions -> Bool
+ Quaalude: [shakeCommandOptions] :: ShakeOptions -> [CmdOption]
+ Quaalude: [shakeCreationCheck] :: ShakeOptions -> Bool
+ Quaalude: [shakeExtra] :: ShakeOptions -> HashMap TypeRep Dynamic
+ Quaalude: [shakeFiles] :: ShakeOptions -> FilePath
+ Quaalude: [shakeFlush] :: ShakeOptions -> Maybe Double
+ Quaalude: [shakeLineBuffering] :: ShakeOptions -> Bool
+ Quaalude: [shakeLintIgnore] :: ShakeOptions -> [FilePattern]
+ Quaalude: [shakeLintInside] :: ShakeOptions -> [FilePath]
+ Quaalude: [shakeLint] :: ShakeOptions -> Maybe Lint
+ Quaalude: [shakeLiveFiles] :: ShakeOptions -> [FilePath]
+ Quaalude: [shakeOutput] :: ShakeOptions -> Verbosity -> String -> IO ()
+ Quaalude: [shakeProgress] :: ShakeOptions -> IO Progress -> IO ()
+ Quaalude: [shakeRebuild] :: ShakeOptions -> [(Rebuild, FilePattern)]
+ Quaalude: [shakeReport] :: ShakeOptions -> [FilePath]
+ Quaalude: [shakeRunCommands] :: ShakeOptions -> Bool
+ Quaalude: [shakeStaunch] :: ShakeOptions -> Bool
+ Quaalude: [shakeStorageLog] :: ShakeOptions -> Bool
+ Quaalude: [shakeThreads] :: ShakeOptions -> Int
+ Quaalude: [shakeTimings] :: ShakeOptions -> Bool
+ Quaalude: [shakeVerbosity] :: ShakeOptions -> Verbosity
+ Quaalude: [shakeVersionIgnore] :: ShakeOptions -> Bool
+ Quaalude: [shakeVersion] :: ShakeOptions -> String
+ Quaalude: _1 :: Field1 s t a b => Lens s t a b
+ Quaalude: _2 :: Field2 s t a b => Lens s t a b
+ Quaalude: _4 :: Field4 s t a b => Lens s t a b
+ Quaalude: _Just :: Applicative f => a -> f a' -> Maybe a -> f Maybe a'
+ Quaalude: auto :: Interpret a => Type a
+ Quaalude: biaxe :: (Traversable t, Monad m) => t a -> b -> m () -> a -> b -> m ()
+ Quaalude: bool :: () => a -> a -> Bool -> a
+ Quaalude: both :: () => a -> b -> (a, a) -> (b, b)
+ Quaalude: class Binary t
+ Quaalude: class Generic a
+ Quaalude: class Inject a
+ Quaalude: class Interpret a
+ Quaalude: class Monad m => MonadIO (m :: * -> *)
+ Quaalude: class Pretty a
+ Quaalude: cmd :: CmdArguments args => args :-> Action r
+ Quaalude: cmd_ :: (CmdArguments args, Unit args) => args :-> Action ()
+ Quaalude: command :: CmdResult r => [CmdOption] -> String -> [String] -> Action r
+ Quaalude: command_ :: [CmdOption] -> String -> [String] -> Action ()
+ Quaalude: copyFile' :: FilePath -> FilePath -> Action ()
+ Quaalude: data Action a
+ Quaalude: data ByteString
+ Quaalude: data Change
+ Quaalude: data ExitCode
+ Quaalude: data Lint
+ Quaalude: data Rebuild
+ Quaalude: data Request
+ Quaalude: data Response body
+ Quaalude: data Rules a
+ Quaalude: data ShakeOptions
+ Quaalude: data Text
+ Quaalude: data Verbosity
+ Quaalude: decode :: Binary a => ByteString -> a
+ Quaalude: detailed :: () => IO a -> IO a
+ Quaalude: dullred :: Doc -> Doc
+ Quaalude: dullyellow :: Doc -> Doc
+ Quaalude: each :: Each s t a b => Traversal s t a b
+ Quaalude: encode :: Binary a => a -> ByteString
+ Quaalude: exitWith :: () => ExitCode -> IO a
+ Quaalude: filterM :: Applicative m => a -> m Bool -> [a] -> m [a]
+ Quaalude: first :: Arrow a => a b c -> a (b, d) (c, d)
+ Quaalude: fold :: (Foldable t, Monoid m) => t m -> m
+ Quaalude: fromMaybe :: () => a -> Maybe a -> a
+ Quaalude: getEnv :: String -> IO String
+ Quaalude: hang :: Int -> Doc -> Doc
+ Quaalude: hardline :: Doc
+ Quaalude: hex :: Int -> String
+ Quaalude: httpLbs :: Request -> Manager -> IO Response ByteString
+ Quaalude: indent :: Int -> Doc -> Doc
+ Quaalude: infix 1 ~>
+ Quaalude: infixl 0 `on`
+ Quaalude: infixl 1 &
+ Quaalude: infixl 4 $>
+ Quaalude: infixr 1 <=<
+ Quaalude: infixr 3 &&&
+ Quaalude: infixr 4 %~
+ Quaalude: infixr 5 <#>
+ Quaalude: infixr 6 <+>
+ Quaalude: infixr 7 -<.>
+ Quaalude: infixr 8 .**
+ Quaalude: input :: () => Type a -> Text -> IO a
+ Quaalude: instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (Development.Shake.Internal.Core.Types.Action a)
+ Quaalude: instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Development.Shake.Internal.Core.Types.Action a)
+ Quaalude: intersperse :: () => a -> [a] -> [a]
+ Quaalude: isPrefixOf :: Eq a => [a] -> [a] -> Bool
+ Quaalude: isSuffixOf :: Eq a => [a] -> [a] -> Bool
+ Quaalude: join :: Monad m => m m a -> m a
+ Quaalude: liftIO :: MonadIO m => IO a -> m a
+ Quaalude: linebreak :: Doc
+ Quaalude: makeExe :: String
+ Quaalude: makeExecutable :: FilePath -> IO ()
+ Quaalude: need :: [FilePath] -> Action ()
+ Quaalude: newManager :: ManagerSettings -> IO Manager
+ Quaalude: on :: () => b -> b -> c -> a -> b -> a -> a -> c
+ Quaalude: over :: () => ASetter s t a b -> a -> b -> s -> t
+ Quaalude: pack :: String -> Text
+ Quaalude: parseRequest :: MonadThrow m => String -> m Request
+ Quaalude: pathSeparator :: Char
+ Quaalude: pretty :: Pretty a => a -> Doc
+ Quaalude: punctuate :: Doc -> [Doc] -> [Doc]
+ Quaalude: putDoc :: Doc -> IO ()
+ Quaalude: removeFilesAfter :: FilePath -> [FilePattern] -> Action ()
+ Quaalude: second :: Arrow a => a b c -> a (d, b) (d, c)
+ Quaalude: shake :: ShakeOptions -> Rules () -> IO ()
+ Quaalude: shakeOptions :: ShakeOptions
+ Quaalude: showVersion :: Version -> String
+ Quaalude: silentCreateProcess :: Verbosity -> CreateProcess -> IO ()
+ Quaalude: sortBy :: () => a -> a -> Ordering -> [a] -> [a]
+ Quaalude: takeBaseName :: FilePath -> String
+ Quaalude: takeDirectory :: FilePath -> FilePath
+ Quaalude: takeFileName :: FilePath -> FilePath
+ Quaalude: text :: String -> Doc
+ Quaalude: thread :: () => [a -> a] -> a -> a
+ Quaalude: tlsManagerSettings :: ManagerSettings
+ Quaalude: transpose :: () => [[a]] -> [[a]]
+ Quaalude: traverse_ :: (Foldable t, Applicative f) => a -> f b -> t a -> f ()
+ Quaalude: type Lens' s a = Lens s s a a
+ Quaalude: unless :: Applicative f => Bool -> f () -> f ()
+ Quaalude: unpack :: Text -> String
+ Quaalude: view :: () => Getting a s a -> s -> a
+ Quaalude: void :: Functor f => f a -> f ()
+ Quaalude: want :: [FilePath] -> Rules ()
+ Quaalude: when :: Applicative f => Bool -> f () -> f ()
+ Quaalude: zipWithM :: Applicative m => a -> b -> m c -> [a] -> [b] -> m [c]
+ Quaalude: zipWithM_ :: Applicative m => a -> b -> m c -> [a] -> [b] -> m ()
Files
- Setup.hs +2/−26
- app/Language/ATS/Package/Dhall.hs +27/−0
- app/Language/ATS/Package/Upgrade.hs +45/−0
- app/Main.hs +17/−1
- ats-pkg.cabal +47/−25
- dhall/atspkg-prelude.dhall +4/−0
- internal/Quaalude.cpphs +186/−0
- internal/System/Process/Ext.hs +21/−0
- man/atspkg.1 +2/−0
- src/Language/ATS/Package.hs +0/−6
- src/Language/ATS/Package/Compiler.hs +0/−2
- src/Language/ATS/Package/Dhall.hs +0/−28
- src/Language/ATS/Package/Upgrade.hs +0/−45
- src/Quaalude.cpphs +0/−188
- src/System/Process/Ext.hs +0/−21
Setup.hs view
@@ -1,26 +1,2 @@-{-# OPTIONS_GHC -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat #-}--import Data.Bool (bool)-import Data.Foldable (fold)-import Data.Functor (($>))-import Distribution.CommandLine-import Distribution.PackageDescription-import Distribution.Simple-import Distribution.Simple.Setup--installActions :: IO ()-installActions = fold- [ writeManpages "man/atspkg.1" "atspkg.1"- , writeTheFuck- , writeBashCompletions "atspkg"- ]--maybeInstallActions :: ConfigFlags -> IO ()-maybeInstallActions cfs = bool nothing act cond- where act = installActions- nothing = mempty- cond = (mkFlagName "no-executable", True) `notElem` unFlagAssignment (configConfigurationsFlags cfs)--main :: IO ()-main = defaultMainWithHooks $- simpleUserHooks { preConf = \_ flags -> maybeInstallActions flags $> emptyHookedBuildInfo }+import Distribution.Simple+main = defaultMain
+ app/Language/ATS/Package/Dhall.hs view
@@ -0,0 +1,27 @@+module Language.ATS.Package.Dhall ( checkPkgSet+ , checkPkg+ ) where++import Data.Dependency+import qualified Data.Text as T+import Language.ATS.Package+import Quaalude++-- | Check a @pkg.dhall@ file.+checkPkg :: FilePath+ -> Bool+ -> IO (Version -> ATSDependency)+checkPkg = checkDhall++checkDhall :: Interpret a+ => FilePath+ -> Bool+ -> IO a+checkDhall path d =+ bool id detailed d $+ input auto (T.pack ('.' : pathSeparator : path))++checkPkgSet :: FilePath -- ^ Path to @.dhall@ file defining a package set.+ -> Bool -- ^ Whether to print detailed error messages.+ -> IO ATSPackageSet+checkPkgSet = checkDhall
+ app/Language/ATS/Package/Upgrade.hs view
@@ -0,0 +1,45 @@+{-# LANGUAGE OverloadedStrings #-}++module Language.ATS.Package.Upgrade ( upgradeBin+ ) where++import qualified Data.ByteString.Lazy.Char8 as BSL+import Data.Char (isDigit)+import Quaalude+import System.Info++manufacturer :: String+manufacturer = case os of+ "darwin" -> "apple"+ _ -> "unknown"++targetArch :: String+targetArch = g [arch, manufacturer, os]+ where g = mconcat . intersperse "-"++atspkgPath :: IO String+atspkgPath = do+ home <- getEnv "HOME"+ pure $ home </> ".local" </> "bin" </> "atspkg"++upgradeBin :: String -> String -> IO ()+upgradeBin user proj = do++ let inner = user </> proj++ putStrLn "Finding latest release..."+ manager <- newManager tlsManagerSettings+ initialRequest <- parseRequest ("https://github.com/" ++ inner ++ "/releases/latest")+ response <- responseBody <$> httpLbs (initialRequest { method = "GET", redirectCount = 0 }) manager++ putStrLn "Downloading latest release..."+ let strVersion = BSL.takeWhile (/='"') . BSL.dropWhile (not . isDigit) . BSL.dropWhile (/='"') $ response+ binRequest = "https://github.com/" <> inner <> "/releases/download/" <> BSL.unpack strVersion <> "/atspkg-" <> targetArch+ followupRequest <- parseRequest binRequest+ binBytes <- responseBody <$> httpLbs (followupRequest { method = "GET" }) manager++ atsPath <- atspkgPath+ createDirectoryIfMissing True (takeDirectory atsPath)+ BSL.writeFile (atsPath ++ "-new") binBytes+ renameFile (atsPath ++ "-new") atsPath+ makeExecutable atsPath
app/Main.hs view
@@ -7,15 +7,19 @@ import Control.Concurrent.ParallelIO.Global import Control.Monad import Data.Bool (bool)+import Data.Foldable (fold) import Data.Maybe (fromMaybe, isNothing)-import Data.Semigroup (Semigroup (..)) import qualified Data.Text.Lazy as TL import Data.Version hiding (Version (..)) import Development.Shake.ATS import Development.Shake.FilePath+import Distribution.CommandLine import Language.ATS.Package+import Language.ATS.Package.Dhall+import Language.ATS.Package.Upgrade import Lens.Micro import Options.Applicative+import Paths_ats_pkg import System.Directory import System.IO.Temp (withSystemTempDirectory) @@ -58,6 +62,7 @@ | Check { _filePath :: String, _details :: Bool } | CheckSet { _filePath :: String, _details :: Bool } | List+ | Setup userCmd :: Parser Command userCmd = hsubparser@@ -73,6 +78,7 @@ <> command "check" (info check' (progDesc "Check that a pkg.dhall file is well-typed.")) <> command "check-set" (info checkSet (progDesc "Audit a package set to ensure it is well-typed.")) <> command "list" (info (pure List) (progDesc "List available packages"))+ <> command "setup" (info (pure Setup) (progDesc "Install manpages and shell completions.")) ) command' :: Parser Command@@ -221,3 +227,13 @@ run (Install tgt) = runHelper False True False ["install"] tgt 0 run (Valgrind ts) = runHelper False True False ("valgrind" : ts) Nothing 0 run (Pack dir') = packageCompiler dir'+run Setup = installActions++installActions :: IO ()+installActions = do+ path <- getDataFileName "man/atspkg.1"+ fold+ [ writeManpages path "atspkg.1"+ , writeTheFuck+ , writeBashCompletions "atspkg"+ ]
ats-pkg.cabal view
@@ -1,6 +1,6 @@-cabal-version: 1.18+cabal-version: 2.0 name: ats-pkg-version: 2.11.0.10+version: 3.0.0.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -11,9 +11,10 @@ description: A collection of scripts to simplify building ATS projects. category: Development, ATS-build-type: Custom-extra-source-files:+build-type: Simple+data-files: man/atspkg.1+extra-source-files: dhall/config.dhall dhall/atslib.dhall dhall/atspkg-prelude.dhall@@ -24,11 +25,6 @@ type: git location: git@github.com:vmchale/atspkg.git -custom-setup- setup-depends: base -any,- Cabal >=2.2,- cli-setup >=0.2.0.1- flag profile description: Enable profiling@@ -51,7 +47,6 @@ exposed-modules: Language.ATS.Package Distribution.ATS- build-tools: cpphs -any hs-source-dirs: src other-modules: Paths_ats_pkg@@ -61,16 +56,14 @@ Language.ATS.Package.Compiler Language.ATS.Package.Config Language.ATS.Package.Dependency- Language.ATS.Package.Dhall Language.ATS.Package.Error Language.ATS.Package.Generic Language.ATS.Package.PackageSet Language.ATS.Package.Type- Language.ATS.Package.Upgrade Language.ATS.Package.Debian Distribution.ATS.Version- System.Process.Ext- Quaalude+ autogen-modules:+ Paths_ats_pkg default-language: Haskell2010 other-extensions: OverloadedStrings GADTs GeneralizedNewtypeDeriving DeriveAnyClass DeriveGeneric@@ -79,7 +72,7 @@ ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates build-depends:- base >=4.9 && <5,+ base >=4.11 && <5, http-client -any, bytestring -any, file-embed -any,@@ -91,7 +84,6 @@ zlib -any, http-client-tls -any, text -any,- directory -any, process -any, hashable -any, containers -any,@@ -102,33 +94,59 @@ shake-ats >=1.8.0.0, shake-ext >=3.0.0.0, shake-c -any,- composition-prelude >=1.3.0.0, zip-archive -any, ansi-wl-pprint -any,- binary -any,- microlens -any, dependency >=1.2.0.0, filemanip -any,- filepath -any+ quaalude -any + if flag(development)+ ghc-options: -Werror++library quaalude+ exposed-modules:+ Quaalude+ build-tools: cpphs -any+ hs-source-dirs: internal+ other-modules:+ System.Process.Ext+ default-language: Haskell2010+ build-depends:+ base -any,+ http-client -any,+ http-client-tls -any,+ process -any,+ directory -any,+ filepath -any,+ microlens -any,+ dhall -any,+ ansi-wl-pprint -any,+ shake -any,+ bytestring -any,+ composition-prelude >=1.3.0.0,+ binary -any,+ text -any+ if !os(windows) build-depends: unix -any- - if (flag(development) && impl(ghc <8.4))- ghc-options: -Werror executable atspkg main-is: Main.hs hs-source-dirs: app other-modules: Paths_ats_pkg+ Language.ATS.Package.Dhall+ Language.ATS.Package.Upgrade+ autogen-modules:+ Paths_ats_pkg default-language: Haskell2010+ other-extensions: OverloadedStrings ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -with-rtsopts=-I0 -Wincomplete-uni-patterns -Wincomplete-record-updates build-depends:- base -any,+ base >=4.11, ats-pkg -any, optparse-applicative -any, shake-ats -any,@@ -138,7 +156,11 @@ composition-prelude -any, text -any, parallel-io -any,- shake -any+ quaalude -any,+ dependency -any,+ bytestring -any,+ shake -any,+ cli-setup -any if flag(eventlog) ghc-options: -eventlog -with-rtsopts=-l
dhall/atspkg-prelude.dhall view
@@ -260,6 +260,9 @@ [ "-D_ATS_CCOMP_PRELUDE_NONE_", "-D_ATS_CCOMP_EXCEPTION_NONE_", "-D_ATS_CCOMP_RUNTIME_NONE_" ] in +let atsProject = "target"+in+ {- We collect everything in a single record for convenience -} { mkDeb = mkDeb , emptySrc = emptySrc@@ -285,4 +288,5 @@ , ignore = ignore , debian = debian , noPrelude = noPrelude+, atsProject }
+ internal/Quaalude.cpphs view
@@ -0,0 +1,186 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Quaalude ( hex+ , bool+ , intersperse+ , transpose+ , sortBy+ , void+ , unless+ , when+ , join+ , fold+ , zipWithM_+ , zipWithM+ , filterM+ , encode+ , decode+ , fromMaybe+ , isPrefixOf+ , isSuffixOf+ , on+ , both+ , (***)+ , (&&&)+ , (<=<)+ , ($>)+ , first+ , second+ , getEnv+ , exitWith+ , showVersion+ , traverse_+ , ExitCode (ExitSuccess)+ , MonadIO (..)+ -- * Miscellaneous+ , makeExe+ -- * "System.Process.Ext" reëxports+ , silentCreateProcess+ -- * "Data.Text.Lazy" reëxports+ , Text+ , pack+ , unpack+ -- * "Control.Composition" reëxports+ , biaxe+ , (.*)+ , (.**)+ , thread+ -- * Dhall reëxports+ , Interpret+ , Inject+ , Generic+ , Binary+ , input+ , auto+ , detailed+ -- * Shake reëxports+ , Rules+ , Action+ , command+ , command_+ , (%>)+ , need+ , want+ , shake+ , Rebuild (..)+ , (~>)+ , cmd+ , cmd_+ , ShakeOptions (..)+ , shakeOptions+ , copyFile'+ , Change (..)+ , Verbosity (..)+ , removeFilesAfter+ , Lint (..)+ , takeBaseName+ , takeFileName+ , takeDirectory+ , (-<.>)+ , makeExecutable+ -- * "Network.HTTP.Client.TLS" reëxports+ , tlsManagerSettings+ -- "Network.HTTP.Client" reëxports+ , newManager+ , parseRequest+ , httpLbs+ , Response (..)+ , Request (method, redirectCount)+ -- * "System.FilePath" reëxports+ , (</>)+ , pathSeparator+ -- * ByteString reëxports+ , ByteString+ -- * Helpers for pretty-printing+ , (<#>)+ -- * "Text.PrettyPrint.ANSI.Leijen" reëxports+ , (<+>)+ , text+ , punctuate+ , dullred+ , linebreak+ , dullyellow+ , hardline+ , hang+ , indent+ , putDoc+ , Pretty (pretty)+ , module X+ -- Lens exports+ , Lens'+ , over+ , _Just+ , view+ , _1+ , _2+ , _4+ , each+ , (&)+ , (%~)+ ) where++import Control.Arrow hiding ((<+>))+import Control.Composition+import Control.Monad+import Control.Monad.IO.Class+import Data.Binary+import Data.Bool (bool)+import Data.ByteString.Lazy (ByteString)+import Data.Foldable (fold, traverse_)+import Data.Functor (($>))+import Data.List+import Data.Maybe (fromMaybe)+import Data.Text.Lazy (Text, pack, unpack)+import Data.Version (showVersion)+import Development.Shake hiding (getEnv)+import Development.Shake.FilePath+import Dhall hiding (bool, Text)+import Lens.Micro hiding (both)+import Lens.Micro.Extras+import Network.HTTP.Client+import Network.HTTP.Client.TLS (tlsManagerSettings)+import Numeric (showHex)+import System.Directory as X+import System.Environment (getEnv)+import System.Exit (ExitCode (ExitSuccess), exitWith)+import System.Info (os)+#ifndef mingw32_HOST_OS+import System.Posix.Files+#endif+import System.Process as X+import System.Process.Ext+import Text.PrettyPrint.ANSI.Leijen hiding (bool, (<$>), (<>), (</>))++infixr 5 <#>++#ifdef mingw32_HOST_OS+makeExecutable :: FilePath -> IO ()+makeExecutable = pure mempty+#else+makeExecutable :: FilePath -> IO ()+makeExecutable = flip setFileMode ownerModes+#endif++makeExe :: String+makeExe = case os of+ "freebsd" -> "gmake"+ "openbsd" -> "gmake"+ "netbsd" -> "gmake"+ "solaris" -> "gmake"+ "dragonfly" -> "gmake"+ _ -> "make"++hex :: Int -> String+hex = flip showHex mempty++instance Semigroup a => Semigroup (Action a) where+ (<>) a b = (<>) <$> a <*> b++instance (Semigroup a, Monoid a) => Monoid (Action a) where+ mempty = pure mempty+ mappend = (<>)++-- | Same as "Text.PrettyPrint.ANSI.Leijen"'s @<$>@, but doesn't clash with the+-- prelude.+(<#>) :: Doc -> Doc -> Doc+(<#>) a b = a <> line <> b
+ internal/System/Process/Ext.hs view
@@ -0,0 +1,21 @@+module System.Process.Ext ( silentCreateProcess+ ) where++import Control.Monad+import Development.Shake+import System.Exit+import System.Process++verbosityErr :: Verbosity -> StdStream+verbosityErr v | v >= Loud = Inherit+verbosityErr _ = CreatePipe++handleExit :: ExitCode -> IO ()+handleExit ExitSuccess = mempty+handleExit x = exitWith x++silentCreateProcess :: Verbosity -> CreateProcess -> IO ()+silentCreateProcess v proc' | v >= Chatty = do+ (_, _, _, r) <- createProcess (proc' { std_err = verbosityErr v, std_out = Inherit })+ handleExit =<< waitForProcess r+silentCreateProcess v proc' = void $ readCreateProcess (proc' { std_err = verbosityErr v }) ""
man/atspkg.1 view
@@ -50,6 +50,8 @@ .PP \f[B]pack\f[] \- Create a tarball suitable for packaging the compiler. Takes as an argument a directory containing the unpacked compiler.+.PP+\f[B]setup\f[] \- Set up manpages and shell completions. .SH OPTIONS .TP .B \f[B]\-h\f[] \f[B]\-\-help\f[]
src/Language/ATS/Package.hs view
@@ -3,12 +3,8 @@ , mkPkg , cleanAll , buildHelper- -- * Dhall verification helpers- , checkPkgSet- , checkPkg -- * Ecosystem functionality , displayList- , upgradeBin , atspkgVersion -- * Functions involving the compiler , packageCompiler@@ -42,9 +38,7 @@ import Language.ATS.Package.Build import Language.ATS.Package.Compiler import Language.ATS.Package.Dependency-import Language.ATS.Package.Dhall import Language.ATS.Package.Error import Language.ATS.Package.Generic import Language.ATS.Package.PackageSet import Language.ATS.Package.Type-import Language.ATS.Package.Upgrade
src/Language/ATS/Package/Compiler.hs view
@@ -14,7 +14,6 @@ import qualified Codec.Archive.Tar as Tar import Codec.Compression.GZip (compress, decompress)-import Control.Composition import Control.Monad import qualified Data.ByteString.Lazy as BS import Data.Dependency@@ -24,7 +23,6 @@ import Quaalude import System.Environment (getEnv) import System.FilePath.Find (find)-import System.Process.Ext (silentCreateProcess) libatsCfg :: String libatsCfg = $(embedStringFile ("dhall" </> "atslib.dhall"))
− src/Language/ATS/Package/Dhall.hs
@@ -1,28 +0,0 @@-module Language.ATS.Package.Dhall ( checkPkgSet- , checkPkg- ) where--import Data.Dependency-import qualified Data.Text as T-import Language.ATS.Package.PackageSet-import Language.ATS.Package.Type-import Quaalude---- | Check a @pkg.dhall@ file.-checkPkg :: FilePath- -> Bool- -> IO (Version -> ATSDependency)-checkPkg = checkDhall--checkDhall :: Interpret a- => FilePath- -> Bool- -> IO a-checkDhall path d =- bool id detailed d $- input auto (T.pack ('.' : pathSeparator : path))--checkPkgSet :: FilePath -- ^ Path to @.dhall@ file defining a package set.- -> Bool -- ^ Whether to print detailed error messages.- -> IO ATSPackageSet-checkPkgSet = checkDhall
− src/Language/ATS/Package/Upgrade.hs
@@ -1,45 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--module Language.ATS.Package.Upgrade ( upgradeBin- ) where--import qualified Data.ByteString.Lazy.Char8 as BSL-import Data.Char (isDigit)-import Quaalude-import System.Info--manufacturer :: String-manufacturer = case os of- "darwin" -> "apple"- _ -> "unknown"--targetArch :: String-targetArch = g [arch, manufacturer, os]- where g = mconcat . intersperse "-"--atspkgPath :: IO String-atspkgPath = do- home <- getEnv "HOME"- pure $ home </> ".local" </> "bin" </> "atspkg"--upgradeBin :: String -> String -> IO ()-upgradeBin user proj = do-- let inner = user </> proj-- putStrLn "Finding latest release..."- manager <- newManager tlsManagerSettings- initialRequest <- parseRequest ("https://github.com/" ++ inner ++ "/releases/latest")- response <- responseBody <$> httpLbs (initialRequest { method = "GET", redirectCount = 0 }) manager-- putStrLn "Downloading latest release..."- let strVersion = BSL.takeWhile (/='"') . BSL.dropWhile (not . isDigit) . BSL.dropWhile (/='"') $ response- binRequest = "https://github.com/" <> inner <> "/releases/download/" <> BSL.unpack strVersion <> "/atspkg-" <> targetArch- followupRequest <- parseRequest binRequest- binBytes <- responseBody <$> httpLbs (followupRequest { method = "GET" }) manager-- atsPath <- atspkgPath- createDirectoryIfMissing True (takeDirectory atsPath)- BSL.writeFile (atsPath ++ "-new") binBytes- renameFile (atsPath ++ "-new") atsPath- makeExecutable atsPath
− src/Quaalude.cpphs
@@ -1,188 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Quaalude ( hex- , bool- , intersperse- , transpose- , sortBy- , void- , unless- , when- , join- , fold- , zipWithM_- , zipWithM- , filterM- , encode- , decode- , fromMaybe- , isPrefixOf- , isSuffixOf- , on- , both- , (***)- , (&&&)- , (<=<)- , (<>)- , ($>)- , first- , second- , getEnv- , exitWith- , showVersion- , traverse_- , ExitCode (ExitSuccess)- , MonadIO (..)- -- * Miscellaneous- , makeExe- -- * "System.Process.Ext" reëxports- , silentCreateProcess- -- * "Data.Text.Lazy" reëxports- , Text- , pack- , unpack- -- * "Control.Composition" reëxports- , biaxe- , (.*)- , (.**)- , thread- -- * Dhall reëxports- , Interpret- , Inject- , Generic- , Binary- , input- , auto- , detailed- -- * Shake reëxports- , Rules- , Action- , command- , command_- , (%>)- , need- , want- , shake- , Rebuild (..)- , (~>)- , cmd- , cmd_- , ShakeOptions (..)- , shakeOptions- , copyFile'- , Change (..)- , Verbosity (..)- , removeFilesAfter- , Lint (..)- , takeBaseName- , takeFileName- , takeDirectory- , (-<.>)- , makeExecutable- -- * "Network.HTTP.Client.TLS" reëxports- , tlsManagerSettings- -- "Network.HTTP.Client" reëxports- , newManager- , parseRequest- , httpLbs- , Response (..)- , Request (method, redirectCount)- -- * "System.FilePath" reëxports- , (</>)- , pathSeparator- -- * ByteString reëxports- , ByteString- -- * Helpers for pretty-printing- , (<#>)- -- * "Text.PrettyPrint.ANSI.Leijen" reëxports- , (<+>)- , text- , punctuate- , dullred- , linebreak- , dullyellow- , hardline- , hang- , indent- , putDoc- , Pretty (pretty)- , module X- -- Lens exports- , Lens'- , over- , _Just- , view- , _1- , _2- , _4- , each- , (&)- , (%~)- ) where--import Control.Arrow hiding ((<+>))-import Control.Composition-import Control.Monad-import Control.Monad.IO.Class-import Data.Binary-import Data.Bool (bool)-import Data.ByteString.Lazy (ByteString)-import Data.Foldable (fold, traverse_)-import Data.Functor (($>))-import Data.List-import Data.Maybe (fromMaybe)-import Data.Semigroup-import Data.Text.Lazy (Text, pack, unpack)-import Data.Version (showVersion)-import Development.Shake hiding (getEnv)-import Development.Shake.FilePath-import Dhall hiding (bool, Text)-import Lens.Micro hiding (both)-import Lens.Micro.Extras-import Network.HTTP.Client-import Network.HTTP.Client.TLS (tlsManagerSettings)-import Numeric (showHex)-import System.Directory as X-import System.Environment (getEnv)-import System.Exit (ExitCode (ExitSuccess), exitWith)-import System.Info (os)-#ifndef mingw32_HOST_OS-import System.Posix.Files-#endif-import System.Process as X-import System.Process.Ext-import Text.PrettyPrint.ANSI.Leijen hiding (bool, (<$>), (<>), (</>))--infixr 5 <#>--#ifdef mingw32_HOST_OS-makeExecutable :: FilePath -> IO ()-makeExecutable = pure mempty-#else-makeExecutable :: FilePath -> IO ()-makeExecutable = flip setFileMode ownerModes-#endif--makeExe :: String-makeExe = case os of- "freebsd" -> "gmake"- "openbsd" -> "gmake"- "netbsd" -> "gmake"- "solaris" -> "gmake"- "dragonfly" -> "gmake"- _ -> "make"--hex :: Int -> String-hex = flip showHex mempty--instance Semigroup a => Semigroup (Action a) where- (<>) a b = (<>) <$> a <*> b--instance (Semigroup a, Monoid a) => Monoid (Action a) where- mempty = pure mempty- mappend = (<>)---- | Same as "Text.PrettyPrint.ANSI.Leijen"'s @<$>@, but doesn't clash with the--- prelude.-(<#>) :: Doc -> Doc -> Doc-(<#>) a b = a <> line <> b
− src/System/Process/Ext.hs
@@ -1,21 +0,0 @@-module System.Process.Ext ( silentCreateProcess- ) where--import Control.Monad-import Development.Shake-import System.Exit-import System.Process--verbosityErr :: Verbosity -> StdStream-verbosityErr v | v >= Loud = Inherit-verbosityErr _ = CreatePipe--handleExit :: ExitCode -> IO ()-handleExit ExitSuccess = mempty-handleExit x = exitWith x--silentCreateProcess :: Verbosity -> CreateProcess -> IO ()-silentCreateProcess v proc' | v >= Chatty = do- (_, _, _, r) <- createProcess (proc' { std_err = verbosityErr v, std_out = Inherit })- handleExit =<< waitForProcess r-silentCreateProcess v proc' = void $ readCreateProcess (proc' { std_err = verbosityErr v }) ""