ats-pkg 3.2.4.6 → 3.2.5.3
raw patch · 9 files changed
+52/−81 lines, 9 filesdep +libarchivedep −filemanipdep −tar
Dependencies added: libarchive
Dependencies removed: filemanip, tar
Files
- CHANGELOG.md +8/−0
- LICENSE +1/−1
- app/Main.hs +2/−17
- ats-pkg.cabal +2/−3
- dhall/atspkg-prelude.dhall +6/−9
- man/atspkg.1 +27/−32
- src/Language/ATS/Package.hs +0/−2
- src/Language/ATS/Package/Compiler.hs +4/−15
- src/Language/ATS/Package/Dependency.hs +2/−2
CHANGELOG.md view
@@ -1,5 +1,13 @@ # ats-pkg +## 3.2.5.0++ * Use `libarchive` instead of `tar`+ * Change URL for compilers+ * Remove hidden `pack` command+ * Remove `packageCompiler` function+ * Update latest Dhall libraries+ ## 3.2.4.6 * Bump Dhall libraries again
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2017+Copyright Vanessa McHale (c) 2017-2019 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
app/Main.hs view
@@ -40,7 +40,6 @@ , _prof :: Bool } | Clean- | Pack { _target :: String } | Test { _targets :: [String] , _atspkgArg :: Maybe String , _rebuildAll :: Bool@@ -69,8 +68,8 @@ | List | Setup -userCmd :: Parser Command-userCmd = hsubparser+command' :: Parser Command+command' = hsubparser (command "install" (info install (progDesc "Install all binaries to $HOME/.local/bin")) <> command "clean" (info (pure Clean) (progDesc "Clean current project directory")) <> command "remote" (info fetch (progDesc "Fetch and install a binary package"))@@ -86,19 +85,6 @@ <> command "setup" (info (pure Setup) (progDesc "Install manpages and shell completions.")) ) -command' :: Parser Command-command' = userCmd <|> internalCmd--internalCmd :: Parser Command-internalCmd = subparser- (internal- <> command "pack" (info pack (progDesc "Make a tarball for distributing the compiler"))- )--pack :: Parser Command-pack = Pack- <$> targetP mempty id "package"- install :: Parser Command install = Install <$> triple@@ -245,7 +231,6 @@ run (Run ts mArg rba v lint tim) = runHelper rba lint tim ("run" : ts) mArg Nothing v run (Install tgt mArg) = runHelper False True False ["install"] mArg tgt 0 run (Valgrind ts mArg) = runHelper False True False ("valgrind" : ts) mArg Nothing 0-run (Pack dir') = packageCompiler dir' run Setup = installActions installActions :: IO ()
ats-pkg.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: ats-pkg-version: 3.2.4.6+version: 3.2.5.3 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale@@ -81,8 +81,8 @@ bzlib -any, Cabal >=2.2.0.0, lzma -any,- tar -any, zlib -any,+ libarchive -any, http-client-tls -any, text -any, process -any,@@ -97,7 +97,6 @@ zip-archive -any, ansi-wl-pprint -any, dependency >=1.2.0.0,- filemanip -any, quaalude -any if flag(development)
dhall/atspkg-prelude.dhall view
@@ -181,7 +181,7 @@ lib ⫽ { static = True } in -let Solver = constructors < PatsSolve : {} | Z3 : {} | Ignore : {} >+let Solver = < PatsSolve : {} | Z3 : {} | Ignore : {} > in let solver = Solver.PatsSolve {=}@@ -301,18 +301,15 @@ let atsProject = "target" in -let CCConstructors = constructors CCompiler-in--let gcc = CCConstructors.GCC {=}+let gcc = CCompiler.GCC {=} in-let clang = CCConstructors.Clang {=}+let clang = CCompiler.Clang {=} in-let compCert = CCConstructors.CompCert {=}+let compCert = CCompiler.CompCert {=} in-let icc = CCConstructors.ICC {=}+let icc = CCompiler.ICC {=} in-let cc = CCConstructors.CC {=}+let cc = CCompiler.CC {=} in let printCompiler =
man/atspkg.1 view
@@ -1,10 +1,10 @@-.\" Automatically generated by Pandoc 2.4+.\" Automatically generated by Pandoc 2.6 .\" .TH "atspkg (1)" "" "" "" "" .hy .SH NAME .PP-atspkg \- a build tool for ATS+atspkg - a build tool for ATS .SH DESCRIPTION .PP \f[B]atspkg\f[R] is a build tool for the ATS2 language, written in@@ -20,66 +20,61 @@ atspkg test .SH SUBCOMMANDS .PP-\f[B]build\f[R] \- Build all binary targets listed in atspkg.dhall+\f[B]build\f[R] - Build all binary targets listed in atspkg.dhall .PP-\f[B]test\f[R] \- Run all tests listed in atspkg.dhall+\f[B]test\f[R] - Run all tests listed in atspkg.dhall .PP-\f[B]clean\f[R] \- Clean current project directory+\f[B]clean\f[R] - Clean current project directory .PP-\f[B]nuke\f[R] \- Remove all local files installed by \f[B]atspkg\f[R]+\f[B]nuke\f[R] - Remove all local files installed by \f[B]atspkg\f[R] .PP-\f[B]remote\f[R] \- Download a tarball from the given URL and try to+\f[B]remote\f[R] - Download a tarball from the given URL and try to build its binary targets .PP-\f[B]install\f[R] \- Install binary targets to $HOME/.local/bin and+\f[B]install\f[R] - Install binary targets to $HOME/.local/bin and relevant manpages to $HOME/.local/share/man/man1 .PP-\f[B]upgrade\f[R] \- Download the latest binary release of+\f[B]upgrade\f[R] - Download the latest binary release of \f[B]atspkg\f[R], if available .PP-\f[B]valgrind\f[R] \- Run \f[B]valgrind\f[R] on the generated binary-.PP-\f[B]run\f[R] \- Run the generated binary+\f[B]valgrind\f[R] - Run \f[B]valgrind\f[R] on the generated binary .PP-\f[B]check\f[R] \- Check a pkg.dhall file to make sure it is-well\-typed.+\f[B]run\f[R] - Run the generated binary .PP-\f[B]check\-set\f[R] \- Check a package set to make sure it is-well\-typed.+\f[B]check\f[R] - Check a pkg.dhall file to make sure it is well-typed. .PP-\f[B]list\f[R] \- List all available packages in current package set.+\f[B]check-set\f[R] - Check a package set to make sure it is well-typed. .PP-\f[B]pack\f[R] \- Create a tarball suitable for packaging the compiler.-Takes as an argument a directory containing the unpacked compiler.+\f[B]list\f[R] - List all available packages in current package set. .PP-\f[B]setup\f[R] \- Set up manpages and shell completions.+\f[B]setup\f[R] - Set up manpages and shell completions. .SH OPTIONS .TP-.B \f[B]\-h\f[R] \f[B]\-\-help\f[R]+.B \f[B]-h\f[R] \f[B]--help\f[R] Display help .TP-.B \f[B]\-V\f[R] \f[B]\-\-version\f[R]+.B \f[B]-V\f[R] \f[B]--version\f[R] Display version information .TP-.B \f[B]\-\-pkg\-args\f[R]+.B \f[B]--pkg-args\f[R] Arguments to be passed to atspkg.dhall .TP-.B \f[B]\-c\f[R] \f[B]\-\-no\-cache\f[R]+.B \f[B]-c\f[R] \f[B]--no-cache\f[R] Ignore cached configuration file .TP-.B \f[B]\-r\f[R], \f[B]\-\-rebuild\f[R]+.B \f[B]-r\f[R], \f[B]--rebuild\f[R] Rebuild all binary targets. .TP-.B \f[B]\-l\f[R], \f[B]\-\-no\-lint\f[R]+.B \f[B]-l\f[R], \f[B]--no-lint\f[R] Disable the build system linter .TP-.B \f[B]\-t\f[R], \f[B]\-\-target\f[R]+.B \f[B]-t\f[R], \f[B]--target\f[R] Set the compilation target using its triple. .TP-.B \f[B]\-v\f[R], \f[B]\-\-verbose\f[R]+.B \f[B]-v\f[R], \f[B]--verbose\f[R] Turn up the verbosity .TP-.B \f[B]\-d\f[R], \f[B]\-\-detailed\f[R]+.B \f[B]-d\f[R], \f[B]--detailed\f[R] Enable detailed error messages when checking configuration files .SH CONFIGURATION .PP@@ -104,13 +99,13 @@ .IP .nf \f[C]-pi git vmchale/haskell\-ats ambitious\-project+pi git vmchale/haskell-ats ambitious-project \f[R] .fi .IP .nf \f[C]-pi git vmchale/ats\-haskell weird\-project+pi git vmchale/ats-haskell weird-project \f[R] .fi .SH BUGS@@ -121,7 +116,7 @@ libraries). .SH COPYRIGHT .PP-Copyright 2018.+Copyright 2018-2019. Vanessa McHale. All Rights Reserved. .SH AUTHORS
src/Language/ATS/Package.hs view
@@ -6,8 +6,6 @@ -- * Ecosystem functionality , displayList , atspkgVersion- -- * Functions involving the compiler- , packageCompiler -- * Types , Version (..) , Pkg (..)
src/Language/ATS/Package/Compiler.hs view
@@ -4,16 +4,15 @@ -- | This module contains functions for installing the @patscc@ compiler. It -- also includes functions for building @libatslib@. module Language.ATS.Package.Compiler- ( packageCompiler- , fetchCompiler+ ( fetchCompiler , setupCompiler , cleanAll -- * Types , SetupScript ) where -import qualified Codec.Archive.Tar as Tar-import Codec.Compression.GZip (compress, decompress)+import qualified Codec.Archive as Archive+import Codec.Compression.GZip (decompress) import Control.Monad import qualified Data.ByteString.Lazy as BS import Data.Dependency@@ -21,7 +20,6 @@ import Network.HTTP.Client hiding (decompress) import Network.HTTP.Client.TLS (tlsManagerSettings) import Quaalude-import System.FilePath.Find (find) libatsCfg :: String libatsCfg = $(embedStringFile ("dhall" </> "atslib.dhall"))@@ -30,15 +28,6 @@ compilerDir v = makeAbsolute =<< dir where dir = getAppUserDataDirectory ("atspkg" </> show v) --- | Make a tarball from a directory containing the compiler.-packageCompiler :: FilePath -> IO ()-packageCompiler directory = do- files <- find (pure True) (pure True) directory- bytes <- fmap Tar.write . Tar.pack directory $ fmap (drop $ length (directory :: String) + 1) files- BS.writeFile (directory ++ ".tar.gz") (compress bytes)---- TODO:--- http://ats-lang.sourceforge.net/IMPLEMENT/Postiats/ATS2-Postiats-0.3.12.tgz ? pkgUrl :: Version -> String pkgUrl v = "https://github.com/vmchale/atspkg/releases/download/compiler/ATS2-Postiats-" ++ show v ++ ".tar.gz" @@ -59,7 +48,7 @@ response <- responseBody <$> httpLbs (initialRequest { method = "GET" }) manager withCompiler "Unpacking" v- Tar.unpack cd . Tar.read . decompress $ response+ Archive.unpackToDir cd (BS.toStrict $ decompress response) make :: Verbosity -> Version -> FilePath -> IO () make v' v cd =
src/Language/ATS/Package/Dependency.hs view
@@ -7,7 +7,7 @@ , SetupScript ) where -import qualified Codec.Archive.Tar as Tar+import Codec.Archive as Archive import Codec.Archive.Zip (ZipOption (..), extractFilesFromArchive, toArchive) import qualified Codec.Compression.BZip as Bzip import qualified Codec.Compression.GZip as Gzip@@ -107,7 +107,7 @@ tarResponse :: Text -> FilePath -> ByteString -> IO () tarResponse url' dirName response = do compress <- getCompressor url'- let f = Tar.unpack dirName . Tar.read . compress+ let f = Archive.unpackToDir dirName . BSL.toStrict . compress f response zipResponse :: FilePath -> ByteString -> IO ()