Skip to content

Commit 6467449

Browse files
author
Siddhanathan Shanmugam
committed
Update installation instructions
1 parent 92d6f5d commit 6467449

File tree

1 file changed

+77
-55
lines changed

1 file changed

+77
-55
lines changed

pages/installing.md

Lines changed: 77 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,105 +3,125 @@ layout: page
33
title: Installing/hacking Yi
44
---
55

6+
Yi requires GHC 7.8 at minimum and is mainly developed with GHC 7.10.1.
67

7-
Yi requires GHC 7.6.3 at minimum and is mainly developed with GHC 7.8.3.
8+
With the Haskell Platform installed, yi can be installed with cabal-install:
89

9-
With the Haskell Platform installed, yi should be installed with cabal-install:
10+
~~~ bash
11+
$ cabal update
12+
$ cabal install yi
13+
~~~
1014

11-
$ cabal update
12-
$ cabal install yi
15+
On Linux systems, you will need ncurses development headers for
16+
the Vty frontend. For example, Ubuntu requires `libncurses5-dev`
17+
for ncurses support and `libicu-dev` for unicode support.
1318

14-
On Linux systems, you'll probably need ncurses development headers for
15-
the Vty frontend. On Ubuntu, you'll need to install the
16-
`libncurses5-dev` package. Also, `libicu-dev` on Ubuntu would be required for unicode support.
19+
The frontends for yi can be manually specified as follows:
1720

18-
You can specify frontends to compile, also:
19-
20-
$ cabal install yi -fvty -fpango
21+
~~~ bash
22+
$ cabal install yi -fvty -fpango
23+
~~~
2124

2225
Options are `-fvty` and `-fpango`.
2326

24-
You can also install the `yi-contrib` package, which contains some
25-
extra contributed things (like user configs):
27+
Note: If you get a `frontend not found` warning, install yi with the frontend
28+
manually specified by -fvty or -fpango while doing cabal install.
2629

27-
$ cabal install yi-contrib
30+
Note: If you're having weird problems such as your changes not seeming
31+
to take effect, you might have some stale stuff in the cache
32+
directory which you should empty: on my system it's `~/.cache/yi`.
2833

29-
If you're in the source repository, you can install yi from source:
3034

31-
$ cabal update # Still update to get updated dependencies
32-
$ cd yi && cabal install
35+
### Installing Yi from source
3336

34-
And the contrib package:
37+
You can install Yi from source as follows:
3538

36-
$ cd yi-contrib && cabal install
39+
~~~ bash
40+
$ git clone https://github.com/yi-editor/yi
41+
$ cd yi
42+
$ cabal update
43+
$ cabal install
44+
~~~
3745

38-
Please note that if you are looking to get absolutely latest sources,
39-
you should set up the supporting repositories from
40-
[the GitHub project page][ghproject] first.
41-
42-
Note: if you're having weird problems such as your changes not seeming
43-
to take effect, you might have some stale stuff in the cache
44-
directory which you should empty: on my system it's `~/.cache/yi`.
46+
Yi is split into multiple smaller supporting packages (such as yi-rope
47+
and yi-language). If you are looking to get absolutely latest sources,
48+
make sure to install the supporting packages before installing Yi.
49+
Usually these packages are rarely updated and the version on Hackage
50+
is up-to-date. You can set up the supporting repositories from
51+
[the GitHub project page][ghproject].
4552

4653
### Installing inside a Cabal sandbox
4754

48-
Many people want to install Yi inside a cabal sandbox (cabal-install
49-
1.18 feature). This is especially important if you plan on hacking on
50-
Yi itself or on libraries for Yi.
55+
Cabal-install 1.18 and higher support sandboxing which isolates
56+
the Yi installation from the rest of the cabal environment. This
57+
is especially important if you plan on hacking on Yi itself, or on
58+
libraries for Yi.
59+
60+
If your cabal version is lower than 1.20, you can install a newer
61+
version of cabal-install using cabal itself. This is recommended
62+
since newer versions of Cabal have several useful utilities for
63+
sandboxed environments.
64+
65+
~~~ bash
66+
$ cabal update
67+
$ cabal install cabal-install
68+
$ cabal --version
69+
~~~
5170

5271
As Yi compiles your config file once you start it, the config needs to
5372
know where to look for any of its dependencies, such as Yi itself! If
5473
these are inside of the sandbox, it doesn't know where to look and
5574
you'll get config compilation errors due to missing modules.
5675

5776
To sandbox, navigate to your source yi directory. For me it's
58-
`~/programming/yi/yi`.
77+
`~/programming/yi/`.
5978

6079
We then setup a cabal sandbox:
6180

62-
```
81+
~~~ bash
82+
$ cd ~/programming/yi
6383
$ cabal sandbox init
6484
$ cabal install --only-dependencies
6585
$ cabal install
66-
```
86+
~~~
6787

6888
From cabal-install 1.20, Yi can be launched in an environment using the
6989
sandbox's package DB using `cabal exec ./dist/build/yi/yi`. It may be useful
7090
to create an alias or small script for this, along the lines of:
7191

72-
```
92+
~~~ bash
7393
#!/usr/bin/env bash
7494
YI_DIR=$HOME/programming/yi/yi
7595
env CABAL_SANDBOX_CONFIG=$YI_DIR/cabal.sandbox.config cabal exec $YI_DIR/dist/build/yi/yi -- "$@"
76-
```
96+
~~~
7797

78-
The `"$@"` part means that all the
79-
arguments we pass to this script are passed on to the Yi binary which
80-
means we can still use all the regular flags, such as `runyi
81-
--as=emacs`. Of course, you'll need to adjust the paths used to match
82-
your sandbox and package directories.
98+
The `"$@"` part means that all the arguments we pass to this script
99+
are passed on to the Yi binary which means we can still use all the
100+
regular flags, such as `yi --as=emacs`. Of course, you'll need to
101+
adjust the paths used to match your sandbox and package directories.
83102

84-
There's one more thing to mention in this section and that is config
103+
There's one more thing to mention in this section, and that is config
85104
dependencies. One of the great things about Yi is that we have access
86105
to the wealth of existing Haskell libraries and we can take advantage
87106
of this in our config file. There are two scenarios:
88107

89-
If the package your config depends on is on Hackage and you want to
90-
use that, just use `cabal install` in the sandboxed Yi directory. So
91-
if your config depends on `semigroups`, you'd run `cabal install
92-
semigroups`. After doing this, `semigroups` should now be visible when
93-
your config is getting compiled.
94-
95-
If the package your config depends on is local, for example when
96-
you're developing the library that you want to use or if you need a
97-
patched version, you'll have to use `cabal sandbox add-source`
98-
command. As an example, I'm developing a `yi-haskell-utils` package
99-
and my config depends on it. To accommodate for this, I ran `cabal
100-
sandbox add-source ~/programming/yi-haskell-utils`.
101-
You can then `cabal install yi-haskell-utils` to add the package to
102-
the sandbox. You should call `cabal build` in the sandbox directory
103-
after you modify a local package so that the sandbox has an up-to-date
104-
version of the package.
108+
* If the package your config depends on is on Hackage and you want to
109+
use that, just use `cabal install` in the sandboxed Yi directory. So
110+
if your config depends on `semigroups`, you'd run `cabal install
111+
semigroups`. After doing this, `semigroups` should now be visible when
112+
your config is getting compiled.
113+
114+
* If the package your config depends on is local, for example when
115+
you're developing the library that you want to use or if you need a
116+
patched version, you'll have to use `cabal sandbox add-source`
117+
command. As an example, I'm developing a `yi-haskell-utils` package
118+
and my config depends on it. To accommodate for this, I ran `cabal
119+
sandbox add-source ~/programming/yi-haskell-utils`.
120+
You can then `cabal install yi-haskell-utils` to add the package to
121+
the sandbox. You should call `cabal build` in the sandbox directory
122+
after you modify a local package so that the sandbox has an up-to-date
123+
version of the package.
124+
105125

106126
I suspect that it'd be perfectly possible to make your config file
107127
into a cabal project and manage the dependencies that way but I have
@@ -288,4 +308,6 @@ get clobbered so it's mostly only useful for the repositories which
288308
will most likely not get many extra dependencies but are likely to
289309
change versions often.
290310

311+
291312
[ghproject]: https://github.com/yi-editor
313+

0 commit comments

Comments
 (0)