Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/949'
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jun 24, 2024
2 parents c17fafb + e613ea6 commit d6240af
Show file tree
Hide file tree
Showing 32 changed files with 3,258 additions and 1,426 deletions.
1,046 changes: 0 additions & 1,046 deletions app/ghcup/BrickMain.hs

This file was deleted.

3 changes: 2 additions & 1 deletion app/ghcup/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
module Main where

#if defined(BRICK)
import BrickMain ( brickMain )
import GHCup.BrickMain (brickMain)
#endif

import qualified GHCup.GHC as GHC
Expand All @@ -24,6 +24,7 @@ import GHCup.Platform
import GHCup.Types
import GHCup.Types.Optics hiding ( toolRequirements )
import GHCup.Utils
import GHCup.Utils.Parsers (fromVersion)
import GHCup.Prelude
import GHCup.Prelude.Logger
import GHCup.Prelude.String.QQ
Expand Down
62 changes: 55 additions & 7 deletions ghcup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ common app-common-depends
, haskus-utils-variant ^>=3.3
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
, optics ^>=0.4
, optparse-applicative >=0.15.1.0 && <0.18
, pretty ^>=1.1.3.1
, pretty-terminal ^>=0.1.0.0
Expand All @@ -92,6 +93,7 @@ common app-common-depends
, temporary ^>=1.3
, text ^>=2.0
, time >=1.9.3 && <1.12
, transformers ^>=0.5
, unordered-containers ^>=0.2
, uri-bytestring ^>=0.3.2.2
, utf8-string ^>=1.0
Expand All @@ -109,6 +111,7 @@ common app-common-depends
build-depends: libarchive ^>=3.0.3.0

library
import: app-common-depends
exposed-modules:
GHCup
GHCup.Cabal
Expand Down Expand Up @@ -143,6 +146,7 @@ library
GHCup.Utils.Tar
GHCup.Utils.Tar.Types
GHCup.Utils.URI
GHCup.Utils.Parsers
GHCup.Version

hs-source-dirs: lib
Expand Down Expand Up @@ -193,7 +197,6 @@ library
, lzma-static ^>=5.2.5.3
, megaparsec >=8.0.0 && <9.3
, mtl ^>=2.2
, optics ^>=0.4
, os-release ^>=1.0.0
, pretty ^>=1.1.3.1
, pretty-terminal ^>=0.1.0.0
Expand All @@ -208,10 +211,10 @@ library
, temporary ^>=1.3
, text ^>=2.0
, time >=1.9.3 && <1.12
, transformers ^>=0.5
, unliftio-core ^>=0.2.0.1
, unordered-containers ^>=0.2.10.0
, uri-bytestring ^>=0.3.2.2
, utf8-string ^>=1.0
, vector >=0.12 && <0.14
, versions >=6.0.5 && <6.1
, word8 ^>=0.1.3
Expand Down Expand Up @@ -322,6 +325,55 @@ library ghcup-optparse
else
build-depends: unix ^>=2.7 || ^>=2.8

library ghcup-tui
import: app-common-depends
exposed-modules:
GHCup.BrickMain
GHCup.Brick.Widgets.Navigation
GHCup.Brick.Widgets.Tutorial
GHCup.Brick.Widgets.KeyInfo
GHCup.Brick.Widgets.SectionList
GHCup.Brick.Widgets.Menu
GHCup.Brick.Widgets.Menus.Context
GHCup.Brick.Widgets.Menus.AdvanceInstall
GHCup.Brick.Widgets.Menus.CompileGHC
GHCup.Brick.Widgets.Menus.CompileHLS
GHCup.Brick.Actions
GHCup.Brick.App
GHCup.Brick.BrickState
GHCup.Brick.Attributes
GHCup.Brick.Common

hs-source-dirs: lib-tui
default-language: Haskell2010
default-extensions:
LambdaCase
MultiWayIf
NamedFieldPuns
PackageImports
RecordWildCards
ScopedTypeVariables
StrictData
TupleSections

ghc-options:
-Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
-fwarn-incomplete-record-updates

build-depends:
, ghcup
, brick ^>=2.1
, vty ^>=6.0 || ^>=6.1 || ^>=6.2

if !flag(tui)
buildable: False

if os(windows)
cpp-options: -DIS_WINDOWS

else
build-depends: unix ^>=2.7 || ^>=2.8

executable ghcup
import: app-common-depends
main-is: Main.hs
Expand Down Expand Up @@ -351,12 +403,8 @@ executable ghcup

if flag(tui)
cpp-options: -DBRICK
other-modules: BrickMain
build-depends:
, brick ^>=2.1
, transformers ^>=0.5
, vty ^>=6.0 || ^>=6.1 || ^>=6.2
, optics ^>=0.4
, ghcup-tui

if os(windows)
cpp-options: -DIS_WINDOWS
Expand Down
4 changes: 4 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cradle:
cabal:
- component: "ghcup:lib:ghcup"
path: ./lib
- component: "ghcup:lib:ghcup-optparse"
path: ./lib-opt
- component: "ghcup:lib:ghcup-tui"
path: ./lib-tui
- component: "ghcup:exe:ghcup"
path: ./app/ghcup
- component: "ghcup:lib:ghcup-optparse"
Expand Down
2 changes: 1 addition & 1 deletion lib-opt/GHCup/OptParse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import GHCup.OptParse.ToolRequirements
import GHCup.OptParse.Nuke

import GHCup.Types

import GHCup.Utils.Parsers (gpgParser, downloaderParser, keepOnParser, platformParser, parseUrlSource)
#if !MIN_VERSION_base(4,13,0)
import Control.Monad.Fail ( MonadFail )
#endif
Expand Down
Loading

0 comments on commit d6240af

Please sign in to comment.