ats-pkg 3.4.0.8 → 3.5.0.0
raw patch · 9 files changed
+86/−99 lines, 9 filesdep +libarchivedep −filemanipdep −tar
Dependencies added: libarchive
Dependencies removed: filemanip, tar
Files
- CHANGELOG.md +4/−0
- app/Main.hs +1/−13
- ats-pkg.cabal +3/−4
- dhall/atslib.dhall +52/−52
- man/atspkg.1 +1/−4
- src/Language/ATS/Package.hs +0/−2
- src/Language/ATS/Package/Build.hs +1/−2
- src/Language/ATS/Package/Compiler.hs +20/−18
- src/Language/ATS/Package/Dependency.hs +4/−4
CHANGELOG.md view
@@ -1,5 +1,9 @@ # ats-pkg +## 3.5.0.0++ * Remove `packageCompiler`+ ## 3.4.0.8 * Drop `.bz2` decompression; support GHC 8.8.1
app/Main.hs view
@@ -45,7 +45,6 @@ , _prof :: Bool } | Clean- | Pack { _target :: String } | Test { _targets :: [String] , _atspkgArg :: Maybe String , _rebuildAll :: Bool@@ -101,17 +100,7 @@ ) 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"+command' = userCmd install :: Parser Command install = Install@@ -277,7 +266,6 @@ run (Run ts mArg rba v lint tim) = runHelper rba lint tim ("run" : ts) mArg Nothing False v run (Install tgt mArg) = runHelper False True False ["install"] mArg tgt False 0 run (Valgrind ts mArg) = runHelper False True False ("valgrind" : ts) mArg Nothing False 0-run (Pack dir') = packageCompiler dir' run Setup = installActions installActions :: IO ()
ats-pkg.cabal view
@@ -1,12 +1,12 @@ cabal-version: 2.0 name: ats-pkg-version: 3.4.0.8+version: 3.5.0.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale maintainer: vamchale@gmail.com author: Vanessa McHale-tested-with: ghc ==8.4.4 ghc ==8.6.5+tested-with: ghc ==8.4.4 ghc ==8.6.5 ghc ==8.8.2 bug-reports: https://github.com/vmchale/atspkg/issues synopsis: A build tool for ATS description: A collection of scripts to simplify building ATS projects.@@ -88,8 +88,7 @@ ansi-wl-pprint -any, dependency >=1.2.0.0, quaalude -any,- tar -any,- filemanip -any,+ libarchive >=2.2.1.0, unix-compat -any if flag(development)
dhall/atslib.dhall view
@@ -23,58 +23,58 @@ → λ(libVersion : List Natural) → prelude.default ⫽ { libraries =- [ prelude.staticLib- ⫽ { libTarget = "target/libatslib.a"- , name = "atslib"- , src =- concat- Text- [ mapPre- [ "bool"- , "integer"- , "basics"- , "pointer"- , "integer_long"- , "integer_short"- , "integer_size"- , "char"- , "float"- , "string"- , "strptr"- , "integer_ptr"- , "integer_fixed"- , "filebas"- ]- , mapC- [ "math"- , "float"- , "errno"- , "fcntl"- , "dirent"- , "stdio"- , "stdlib"- , "string"- , "strings"- , "time"- , "unistd"- ]- , mapML- [ "list0"- , "option0"- , "array0"- , "matrix0"- , "string"- , "strarr"- , "gvalue"- , "dynarray"- , "hashtblref"- , "filebas"- , "filebas_dirent"- ]- ]- , includes = [] : List Text- }- ]+ [ prelude.staticLib+ ⫽ { libTarget = "target/libatslib.a"+ , name = "atslib"+ , src =+ concat+ Text+ [ mapPre+ [ "bool"+ , "integer"+ , "basics"+ , "pointer"+ , "integer_long"+ , "integer_short"+ , "integer_size"+ , "char"+ , "float"+ , "string"+ , "strptr"+ , "integer_ptr"+ , "integer_fixed"+ , "filebas"+ ]+ , mapC+ [ "math"+ , "float"+ , "errno"+ , "fcntl"+ , "dirent"+ , "stdio"+ , "stdlib"+ , "string"+ , "strings"+ , "time"+ , "unistd"+ ]+ , mapML+ [ "list0"+ , "option0"+ , "array0"+ , "matrix0"+ , "string"+ , "strarr"+ , "gvalue"+ , "dynarray"+ , "hashtblref"+ , "filebas"+ , "filebas_dirent"+ ]+ ]+ , includes = [] : List Text+ }+ ] , cflags = [ "-fPIC" ] , compiler = compilerVersion , version = libVersion
man/atspkg.1 view
@@ -1,4 +1,4 @@-.\" Automatically generated by Pandoc 2.9+.\" Automatically generated by Pandoc 2.9.1.1 .\" .TH "atspkg (1)" "" "" "" "" .hy@@ -48,9 +48,6 @@ \f[B]check-set\f[R] - Check a package set to make sure it is well-typed. .PP \f[B]list\f[R] - List all available packages in current package set.-.PP-\f[B]pack\f[R] - Create a tarball suitable for packaging the compiler.-Takes as an argument a directory containing the unpacked compiler. .PP \f[B]setup\f[R] - Set up manpages and shell completions. .SH OPTIONS
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/Build.hs view
@@ -286,9 +286,8 @@ -- | The directory that will be @PATSHOME@. patsHomeAtsPkg :: MonadIO m => Version -> m String-patsHomeAtsPkg v = fmap (</> vs) (pkgHome (GCC Nothing Nothing))+patsHomeAtsPkg v = fmap (</> vs </> "ATS2-Postiats-gmp-" ++ vs) (pkgHome (GCC Nothing Nothing)) where vs = show v- -- gmp = if v >= Version [0,3,13] then "gmp-" else "" home' :: MonadIO m => Version -- ^ Compiler version -> Version -- ^ Library version
src/Language/ATS/Package/Compiler.hs view
@@ -4,47 +4,50 @@ -- | This module contains functions for installing the @patscc@ compiler. It -- also includes functions for building @libatslib@. module Language.ATS.Package.Compiler- ( packageCompiler- , fetchCompiler+ -- ( packageCompiler+ ( 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.Exception (throw) import Control.Monad-import qualified Data.ByteString.Lazy as BS import Data.Dependency import Data.FileEmbed import qualified Development.Shake.Check as Check import Network.HTTP.Client hiding (decompress) import Quaalude-import System.FilePath.Find (find) libatsCfg :: String libatsCfg = $(embedStringFile ("dhall" </> "atslib.dhall")) +compilerUnpackDir :: Version -> IO FilePath+compilerUnpackDir v = makeAbsolute =<< dir+ where dir = getAppUserDataDirectory ("atspkg" </> vs)+ vs = show v+ compilerDir :: Version -> IO FilePath compilerDir v = makeAbsolute =<< dir- where dir = getAppUserDataDirectory ("atspkg" </> vs)+ where dir = getAppUserDataDirectory ("atspkg" </> vs </> "ATS2-Postiats-gmp-" ++ vs) vs = show v- -- gmp = if v >= Version [0,3,13] then "gmp-" else "" pkgUrl :: Version -> String pkgUrl v = let vs = show v- in "https://github.com/vmchale/atspkg/releases/download/compiler/ATS2-Postiats-" ++ vs ++ ".tar.gz"- -- gmp = if v >= Version [0,3,13] then "gmp-" else ""+ in "http://ats-lang.sourceforge.net/IMPLEMENT/Postiats/ATS2-Postiats-" ++ gmp ++ vs ++ ".tgz"+ where gmp = if v >= Version [0,4,0] then "gmp-" else "" -- in "https://cytranet.dl.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-" ++ vs ++ "/ATS2-Postiats-" ++ gmp ++ vs ++ ".tgz" -- | 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)+-- 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) withCompiler :: String -> Version -> IO () withCompiler s v = putStrLn $ s ++ " compiler v" ++ show v ++ "..."@@ -52,7 +55,7 @@ fetchCompiler :: Version -> IO () fetchCompiler v = do - cd <- compilerDir v+ cd <- compilerUnpackDir v needsSetup <- not <$> doesDirectoryExist cd when needsSetup $ do@@ -63,8 +66,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)+ fmap (either throw id) $ Archive.runArchiveM $ Archive.unpackToDirLazy cd (decompress response) make :: Verbosity -> Version -> FilePath -> IO () make v' v cd =
src/Language/ATS/Package/Dependency.hs view
@@ -7,12 +7,12 @@ , SetupScript ) where --- import Codec.Archive as Archive-import qualified Codec.Archive.Tar as Tar+import Codec.Archive as Archive import Codec.Archive.Zip (ZipOption (..), extractFilesFromArchive, toArchive) import qualified Codec.Compression.GZip as Gzip import qualified Codec.Compression.Lzma as Lzma import Control.Concurrent.ParallelIO.Global+import Control.Exception (throw) import qualified Data.ByteString.Lazy as BSL import qualified Data.Text.Lazy as TL import Development.Shake.ATS@@ -106,8 +106,8 @@ tarResponse :: Text -> FilePath -> ByteString -> IO () tarResponse url' dirName response = do compress <- getCompressor url'- -- let f = Archive.unpackToDir dirName . BSL.toStrict . compress- let f = Tar.unpack dirName . Tar.read . compress+ let f = fmap (either throw id) . runArchiveM . Archive.unpackToDirLazy dirName . compress+ -- let f = Tar.unpack dirName . Tar.read . compress f response zipResponse :: FilePath -> ByteString -> IO ()