haskus-system-build 0.7.0.0 → 1.0
raw patch · 9 files changed
+84/−71 lines, 9 filesdep +conduitdep +http-conduitdep −simple-downloaddep ~basedep ~haskus-utilsdep ~optparse-applicativesetup-changed
Dependencies added: conduit, http-conduit
Dependencies removed: simple-download
Dependency ranges changed: base, haskus-utils, optparse-applicative, optparse-simple, process, temporary
Files
- Setup.hs +0/−2
- haskus-system-build.cabal +47/−46
- src/apps/Haskus/Apps/System/Build/CmdLine.hs +0/−1
- src/apps/Haskus/Apps/System/Build/Config.hs +2/−2
- src/apps/Haskus/Apps/System/Build/Download.hs +17/−0
- src/apps/Haskus/Apps/System/Build/Main.hs +2/−2
- src/apps/Haskus/Apps/System/Build/QEMU.hs +13/−6
- src/apps/Haskus/Apps/System/Build/Stack.hs +2/−11
- src/apps/Haskus/Apps/System/Build/Utils.hs +1/−1
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
haskus-system-build.cabal view
@@ -1,51 +1,52 @@-name: haskus-system-build-version: 0.7.0.0-synopsis: Haskus system build tool-license: BSD3-license-file: LICENSE-author: Sylvain Henry-maintainer: sylvain@haskus.fr-homepage: http://www.haskus.org/system-copyright: Sylvain Henry 2017-category: System-build-type: Simple-cabal-version: >=1.20-+cabal-version: >=1.20+name: haskus-system-build+version: 1.0+license: BSD3+license-file: LICENSE+copyright: Sylvain Henry 2018+maintainer: sylvain@haskus.fr+author: Sylvain Henry+homepage: http://www.haskus.org/system+synopsis: Haskus system build tool description:- Build tool to use with haskus-system.+ Build tool to use with haskus-system.+category: System+build-type: Simple source-repository head- type: git- location: git://github.com/haskus/haskus-system-build.git+ type: git+ location: git://github.com/haskus/haskus-system-build.git executable haskus-system-build- main-is: Haskus/Apps/System/Build/Main.hs- hs-source-dirs: src/apps- other-modules:- Haskus.Apps.System.Build.Config- Haskus.Apps.System.Build.Linux- Haskus.Apps.System.Build.Ramdisk- Haskus.Apps.System.Build.Syslinux- Haskus.Apps.System.Build.Stack- Haskus.Apps.System.Build.CmdLine- Haskus.Apps.System.Build.Utils- Haskus.Apps.System.Build.GMP- Haskus.Apps.System.Build.QEMU- Haskus.Apps.System.Build.ISO- Haskus.Apps.System.Build.Disk- build-depends:- base >= 4.9 && < 4.10- , process >= 1.4 && < 1.5- , yaml >= 0.8 && < 0.9- , text >= 1.2 && < 1.3- , haskus-utils >= 0.7 && < 0.8- , optparse-simple >= 0.0 && < 0.1- , optparse-applicative >= 0.13 && < 0.14- , temporary >= 1.2 && < 1.3- , directory >= 1.2 && < 1.4- , simple-download >= 0.0 && < 0.1- , filepath >= 1.4 && < 1.5- , hashable >= 1.2 && < 1.3-- default-language: Haskell2010- ghc-options: -Wall -threaded+ main-is: Haskus/Apps/System/Build/Main.hs+ hs-source-dirs: src/apps+ other-modules:+ Haskus.Apps.System.Build.Config+ Haskus.Apps.System.Build.Linux+ Haskus.Apps.System.Build.Ramdisk+ Haskus.Apps.System.Build.Syslinux+ Haskus.Apps.System.Build.Stack+ Haskus.Apps.System.Build.CmdLine+ Haskus.Apps.System.Build.Utils+ Haskus.Apps.System.Build.GMP+ Haskus.Apps.System.Build.QEMU+ Haskus.Apps.System.Build.ISO+ Haskus.Apps.System.Build.Disk+ Haskus.Apps.System.Build.Download+ Paths_haskus_system_build+ default-language: Haskell2010+ ghc-options: -Wall -threaded+ build-depends:+ base >=4.9 && <4.12,+ process >=1.4 && <1.7,+ yaml ==0.8.*,+ text ==1.2.*,+ haskus-utils >=0.7 && <1.1,+ optparse-simple >=0.0 && <0.2,+ optparse-applicative >=0.13 && <0.15,+ temporary >=1.2 && <1.4,+ directory >=1.2 && <1.4,+ filepath ==1.4.*,+ hashable ==1.2.*,+ http-conduit >=2.3.2 && <2.4,+ conduit >=1.3.0.3 && <1.4
src/apps/Haskus/Apps/System/Build/CmdLine.hs view
@@ -13,7 +13,6 @@ where import Options.Applicative-import Data.Monoid data InitOptions = InitOptions { initOptTemplate :: String
src/apps/Haskus/Apps/System/Build/Config.hs view
@@ -41,8 +41,8 @@ parseJSON _ = fail "Invalid config file" -readSystemConfig :: FilePath -> IO (Maybe SystemConfig)-readSystemConfig = Yaml.decodeFile+readSystemConfig :: FilePath -> IO (Either ParseException SystemConfig)+readSystemConfig = Yaml.decodeFileEither ------------------------------------------------------------- -- Linux
+ src/apps/Haskus/Apps/System/Build/Download.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE FlexibleContexts #-}++module Haskus.Apps.System.Build.Download+ ( download+ )+where++import Network.HTTP.Simple+import Conduit++download ::+ ( MonadUnliftIO m+ , MonadThrow m+ ) => String -> FilePath -> m ()+download url filepath = do+ req <- parseRequest url+ runResourceT $ httpSink req $ const (sinkFile filepath)
src/apps/Haskus/Apps/System/Build/Main.hs view
@@ -95,8 +95,8 @@ mconfig <- readSystemConfig configFile case mconfig of- Nothing -> failWith $ "Cannot parse \"" ++ configFile ++ "\""- Just c -> return c+ Left e -> failWith $ "Cannot parse \"" ++ configFile ++ "\": " ++ show e+ Right c -> return c buildCommand :: BuildOptions -> IO () buildCommand opts = do
src/apps/Haskus/Apps/System/Build/QEMU.hs view
@@ -38,11 +38,10 @@ qemuExecISO :: SystemConfig -> FilePath -> IO () qemuExecISO config isoPath = do - (args,kargs) <- qemuGetProfileConfig (qemuConfig config)+ (args,_) <- qemuGetProfileConfig (qemuConfig config) let kerRdArgs = concat $ intersperse " " [ "-cdrom", isoPath- , "-append", "\""++kargs++"\"" ] qemuExec (args ++ " " ++ kerRdArgs)@@ -59,18 +58,26 @@ qemuGetProfileConfig :: QEMUConfig -> IO (String,String) qemuGetProfileConfig config = case qemuProfile config of- "vanilla" -> return ("", "")+ "vanilla" -> return ( Text.unpack (qemuOptions config)+ , Text.unpack (qemuKernelArgs config)+ ) "default" -> return $ (concat $ intersperse " " [ "-enable-kvm" , "-machine q35"- , "-soundhw hda" , "-serial stdio" , "-vga std" --, "-show-cursor"- , "-usbdevice tablet"+ , "-usb"+ , "-device usb-ehci,id=ehci"+ , "-device usb-tablet,bus=usb-bus.0"+ , "-device intel-hda -device hda-duplex"+ , Text.unpack (qemuOptions config) ]- , "console=ttyS0 atkbd.softraw=0 quiet"+ , concat $ intersperse " "+ [ "console=ttyS0 atkbd.softraw=0 quiet"+ , Text.unpack (qemuKernelArgs config)+ ] ) p -> failWith $ "Invalid QEMU profile: " ++ Text.unpack p
src/apps/Haskus/Apps/System/Build/Stack.hs view
@@ -29,17 +29,8 @@ stackGetBinPath :: FilePath -> IO FilePath stackGetBinPath x = do- -- read GHC version- ghcVersion <- stackGetGHCVersion-- -- read stack resolver- stackResolver <- stackGetResolver-- return $ ".stack-work/install/x86_64-linux"- </> stackResolver- </> ghcVersion- </> "bin"- </> x+ p <- readProcess "stack" ["path", "--local-install-root"] ""+ return $ init p </> "bin" </> x stackBuild :: IO ()
src/apps/Haskus/Apps/System/Build/Utils.hs view
@@ -22,8 +22,8 @@ import System.Directory import System.FilePath import System.IO.Temp-import qualified Network.HTTP.Client.Conduit.Download as D import Haskus.Utils.Flow+import qualified Haskus.Apps.System.Build.Download as D -- | Execute a command shellWait :: String -> IO ExitCode