Skip to content

Commit

Permalink
Move to vty 6.0+
Browse files Browse the repository at this point in the history
vty moved to separate different platform specific functionality to
different package. We want vty-unix.

iAlso move to brick 2.1.1 that now supports vty 6.0.
  • Loading branch information
u-quark committed Nov 12, 2023
1 parent 42bbaa0 commit a4a4bfe
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 8 deletions.
49 changes: 42 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
url = "github:u-quark/vty?ref=gg";
flake = false;
};
vty-unix = {
url = "github:u-quark/vty-unix?ref=gg";
flake = false;
};
vty-crossplatform = {
url = "github:jtdaugherty/vty-crossplatform";
flake = false;
};
brick = {
url = "github:jtdaugherty/brick";
flake = false;
Expand Down
3 changes: 3 additions & 0 deletions nix/gg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
http-client,
brick,
vty,
vty-unix,
lens,
generic-lens,
vector,
Expand Down Expand Up @@ -59,13 +60,15 @@ mkDerivation {
http-client
brick
vty
vty-unix
lens
generic-lens
vector
process
bytestring
MissingH
wreq
colour
# C deps
libgit2
];
Expand Down
9 changes: 9 additions & 0 deletions nix/haskell-pkgs-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ let modifyPkg = pkg: dontHaddock (disableExecutableProfiling (disableLibraryProf
self: super:
rec {
vty = modifyPkg (callCabal2nix "vty" inputs.vty {});
vty-unix = modifyPkg (callCabal2nix "vty-unix" inputs.vty-unix {
vty = vty;
});
vty-crossplatform = modifyPkg (callCabal2nix "vty-crossplatform" inputs.vty-crossplatform {
vty = vty;
vty-unix = vty-unix;
});
brick = modifyPkg (callCabal2nix "brick" inputs.brick {
vty = vty;
vty-unix = vty-unix;
vty-crossplatform = vty-crossplatform;
});
}
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies:
- time
- brick
- vty
- vty-unix
- lens
- generic-lens
- vector
Expand Down
4 changes: 3 additions & 1 deletion src/GG/UI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import qualified GG.UI.Attrs as Attr
import GG.UI.Theme (getAttrMap)
import GG.Utils (uncurry3)
import qualified Graphics.Vty as V
import Graphics.Vty.Platform.Unix
(mkVty)
import qualified Libgit2 as G
import Prelude hiding (head)
import System.Environment (lookupEnv, setEnv)
Expand Down Expand Up @@ -772,7 +774,7 @@ easeOut t =

buildVty :: IO V.Vty
buildVty = do
vty <- V.mkVty V.defaultConfig
vty <- mkVty V.defaultConfig
let output_interface = V.outputIface vty
when (V.supportsMode output_interface V.Mouse) $
liftIO $ V.setMode output_interface V.Mouse True
Expand Down

0 comments on commit a4a4bfe

Please sign in to comment.