|
18 | 18 | [haskell]: https://haskell.org |
19 | 19 | [show]: http://hackage.haskell.org/package/base/docs/Prelude.html#t:Show |
20 | 20 | [display]: https://hackage.haskell.org/package/hyper/docs/Hyper.html#t:Display |
| 21 | + [cabal]: https://www.haskell.org/cabal/ |
21 | 22 | [ghc]: https://www.haskell.org/ghc/ |
22 | 23 | [electron]: http://electron.atom.io/ |
23 | 24 | [stack]: https://www.haskellstack.org |
@@ -63,35 +64,56 @@ Installation from the binary distribution follows the structure explained above. |
63 | 64 |
|
64 | 65 | 2. Install the back-end server |
65 | 66 |
|
66 | | - 1. Make sure that you have a working installation of the [GHC][] Haskell compiler. |
| 67 | + 1. Make sure that you have a working installation of |
| 68 | + |
| 69 | + * the [Glasgow Haskell compiler (GHC)][ghc]. |
| 70 | + * with [Cabal][] version **3.10** or higher. |
67 | 71 |
|
68 | 72 | 2. Install the back-end with Cabal by executing |
69 | 73 |
|
70 | | - cabal install hyper hyper-haskell-server |
| 74 | + > cabal install hyper-haskell-server |
| 75 | + |
| 76 | + 3. Tell `hyper-haskell-server` about the Haskell packages that are in scope. |
| 77 | + |
| 78 | + The `hyper-haskell-server` program will pick up the packages in scope from a [.ghc.environment][ghc-env] file. We follow the same logic as `ghci` on which file we pick up, where the current directory is the directory of the worksheet file. |
| 79 | + |
| 80 | + There are two main ways to create a [.ghc.environment][ghc-env] file: |
| 81 | + |
| 82 | + * Create a global environment file using `cabal install --lib`. |
| 83 | + * Create a local environment file for a given `.cabal` package using the `--write-ghc-environment-files=always` flag with `cabal configure`. |
| 84 | + |
| 85 | + In both cases, the compilation of the `hyper` package in the environment file must match the compilation of the `hyper` package in `hyper-haskell-server` — this means identical versions of compiler and all dependencies! |
| 86 | + |
| 87 | + In the short-term, it's easiest to work with the global environment file. Execute |
| 88 | + ``` |
| 89 | + > cabal install --lib diagrams diagrams-svg diagrams-lib hyper hyper-extra |
| 90 | + ``` |
71 | 91 |
|
72 | | - It is also recommended (but not necessary) that you install the additional support for other popular Haskell packages, e.g. the [Diagrams][] library by additionally executing |
| 92 | + in order to install the `hyper` package, as well as additional support for graphics via `hyper-extra` and [Diagrams][]. |
73 | 93 |
|
74 | | - cabal install hyper-extra |
| 94 | + In the long-term, you may want to work with multiple local package environments. In this case, again, you have to make sure that `hyper-haskell-server` was compiled using `hyper` from this package environment. |
75 | 95 |
|
76 | | - 3. Now you can start the front-end application and create a new worksheet, or open an existing one. Make sure that the "Interpreter Back-end" in the "Settings" section of the worksheet is set to "cabal". (The path field does not matter in this case.) |
| 96 | + 4. Now you can start the front-end application and create a new worksheet, or open an existing one. Make sure that the "Interpreter Back-end" in the "Settings" section of the worksheet is set to "cabal". (The path field does not matter in this case.) |
77 | 97 |
|
78 | 98 |  |
79 | 99 |
|
80 | | - It is also possible to use [Stack][] by using `stack install`, but that is not fully explained here, only to some extent below. |
| 100 | + It is also possible to use [Stack][] or [nix][nix], but that is not documented here. |
81 | 101 |
|
82 | 102 | That's it! Happy hyper! |
83 | 103 |
|
84 | 104 | [diagrams]: https://github.com/diagrams |
| 105 | + [ghc-env]: https://downloads.haskell.org/ghc/latest/docs/users_guide/packages.html#package-environments |
| 106 | + [nix]: https://nixos.org/download/ |
85 | 107 |
|
86 | 108 | ## Run from source |
87 | 109 |
|
88 | 110 | When developing HyperHaskell itself, it is also possible to run it from source. Follow these steps: |
89 | 111 |
|
90 | 112 | 1. [Download and install Electron](http://electron.atom.io/releases/) |
91 | 113 |
|
92 | | - The whole thing is currently developed and tested with Electron version 10.1.5. |
| 114 | + The whole thing is currently developed and tested with Electron version 38.2.2. |
93 | 115 | |
94 | | - (If you use the [npm][] package manager, you can install it in your home directory with `cd ~ && npm install electron@10.5.1`. |
| 116 | + (If you use the [npm][] package manager, you can install it in your home directory with `cd ~ && npm install electron@38.2.2`. |
95 | 117 | On Debian-based Linux distributions, Electron [currently](https://github.com/electron-userland/electron-prebuilt/issues/70#issuecomment-192520913) requires the `nodejs-legacy` package.) |
96 | 118 |
|
97 | 119 | 2. Make sure that you have a working installation of |
@@ -139,19 +161,19 @@ We use the [`electron-packager`][pkg] utility. To install it, you need to use th |
139 | 161 |
|
140 | 162 | cd ~ |
141 | 163 | npm install electron-packager |
142 | | - npm install electron@10.1.5 --save-dev |
| 164 | + npm install electron@38.2.2 --save-dev |
143 | 165 |
|
144 | 166 | To create an application bundle and compress it in a zip-file, use the following commands: |
145 | 167 |
|
146 | 168 | * On macOS: |
147 | 169 |
|
148 | | - make pkg-darwin |
149 | | - make zip-darwin |
| 170 | + just pkg-darwin |
| 171 | + just zip-darwin |
150 | 172 |
|
151 | 173 | * On Windows: You need the [7zip](https://www.7-zip.org) utility in your path. |
152 | 174 |
|
153 | | - make pkg-win32 |
154 | | - nake zip-win32 |
| 175 | + just pkg-win32 |
| 176 | + just zip-win32 |
155 | 177 |
|
156 | 178 | * On Linux: not implemented yet |
157 | 179 |
|
|
0 commit comments