@@ -3,105 +3,125 @@ layout: page
3
3
title : Installing/hacking Yi
4
4
---
5
5
6
+ Yi requires GHC 7.8 at minimum and is mainly developed with GHC 7.10.1.
6
7
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:
8
9
9
- With the Haskell Platform installed, yi should be installed with cabal-install:
10
+ ~~~ bash
11
+ $ cabal update
12
+ $ cabal install yi
13
+ ~~~
10
14
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.
13
18
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:
17
20
18
- You can specify frontends to compile, also:
19
-
20
- $ cabal install yi -fvty -fpango
21
+ ~~~ bash
22
+ $ cabal install yi -fvty -fpango
23
+ ~~~
21
24
22
25
Options are ` -fvty ` and ` -fpango ` .
23
26
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.
26
29
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 ` .
28
33
29
- If you're in the source repository, you can install yi from source:
30
34
31
- $ cabal update # Still update to get updated dependencies
32
- $ cd yi && cabal install
35
+ ### Installing Yi from source
33
36
34
- And the contrib package :
37
+ You can install Yi from source as follows :
35
38
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
+ ~~~
37
45
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 ] .
45
52
46
53
### Installing inside a Cabal sandbox
47
54
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
+ ~~~
51
70
52
71
As Yi compiles your config file once you start it, the config needs to
53
72
know where to look for any of its dependencies, such as Yi itself! If
54
73
these are inside of the sandbox, it doesn't know where to look and
55
74
you'll get config compilation errors due to missing modules.
56
75
57
76
To sandbox, navigate to your source yi directory. For me it's
58
- ` ~/programming/yi/yi ` .
77
+ ` ~/programming/yi/ ` .
59
78
60
79
We then setup a cabal sandbox:
61
80
62
- ```
81
+ ~~~ bash
82
+ $ cd ~ /programming/yi
63
83
$ cabal sandbox init
64
84
$ cabal install --only-dependencies
65
85
$ cabal install
66
- ```
86
+ ~~~
67
87
68
88
From cabal-install 1.20, Yi can be launched in an environment using the
69
89
sandbox's package DB using ` cabal exec ./dist/build/yi/yi ` . It may be useful
70
90
to create an alias or small script for this, along the lines of:
71
91
72
- ```
92
+ ~~~ bash
73
93
#! /usr/bin/env bash
74
94
YI_DIR=$HOME /programming/yi/yi
75
95
env CABAL_SANDBOX_CONFIG=$YI_DIR /cabal.sandbox.config cabal exec $YI_DIR /dist/build/yi/yi -- " $@ "
76
- ```
96
+ ~~~
77
97
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.
83
102
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
85
104
dependencies. One of the great things about Yi is that we have access
86
105
to the wealth of existing Haskell libraries and we can take advantage
87
106
of this in our config file. There are two scenarios:
88
107
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
+
105
125
106
126
I suspect that it'd be perfectly possible to make your config file
107
127
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
288
308
will most likely not get many extra dependencies but are likely to
289
309
change versions often.
290
310
311
+
291
312
[ ghproject ] : https://github.com/yi-editor
313
+
0 commit comments