site: download: refine B instructions

This commit is contained in:
Simon Michael 2017-05-22 15:45:44 -07:00
parent f403b1e709
commit f9b89b391e

View File

@ -37,42 +37,46 @@ latest release, or provide only some of the hledger tools.
## B. I want to build the latest release ## B. I want to build the latest release
The latest release (see [release notes](release-notes.html)) is a good choice. The latest release (see [release notes](release-notes.html)) is a good choice.
You have to build it, but normally that should be quite easy: You have to build it, but this is relatively easy:
1. **Install [`stack`](http://haskell-lang.org/get-started)**\ 1. **Install [`stack`](http://haskell-lang.org/get-started)**\
Note some packaged versions of stack are too old and will give ["Invalid package ID"](https://github.com/simonmichael/hledger/issues/513) in step 2 \
(and their builtin "upgrade" command will be slow); in this case consider downloading the binary instead.\
On Windows, the 64-bit version is [recommended](https://github.com/simonmichael/hledger/issues/275#issuecomment-123834252).\ On Windows, the 64-bit version is [recommended](https://github.com/simonmichael/hledger/issues/275#issuecomment-123834252).\
On Arch, you [may need to also install GHC manually](https://github.com/simonmichael/hledger/issues/434).\ On Arch, you [may need to also install GHC manually](https://github.com/simonmichael/hledger/issues/434).\
You should also add [~/.local/bin (or Windows equivalent)](https://docs.haskellstack.org/en/stable/install_and_upgrade/#path) Avoid really old packaged stack versions (< 1.0) which give ["Invalid package ID" errors](https://github.com/simonmichael/hledger/issues/513);
to your \$PATH so that you can easily run stack-installed tools. consider downloading the latest stack binary instead.\
\
As part of stack installation you should also [add `~/.local/bin` (or Windows equivalent) to \$PATH](https://docs.haskellstack.org/en/stable/install_and_upgrade/#path).
Eg if you're a bash user:\ Eg if you're a bash user:\
`echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc && source ~/.bashrc` `echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc && source ~/.bashrc`
2. **`stack install hledger-lib-1.2 hledger-1.2 [hledger-ui-1.2] [hledger-web-1.2] [hledger-api-1.2]`**\ 2. **`stack install hledger-lib-1.2 hledger-1.2 [hledger-ui-1.2] [hledger-web-1.2] [hledger-api-1.2]`**\
Note specifying the version as above forces stack to select exactly this version, \
which is sometimes necessary just after a release; This command installs the latest hledger packages (and the haskell libraries and tools they depend on) from an
at other times the following command may be preferable [appropriate](https://www.stackage.org/package/hledger-lib)
[to](https://www.stackage.org/package/hledger-lib) [stackage](https://www.stackage.org/package/hledger)
[get](https://www.stackage.org/package/hledger) [snapshot](https://www.stackage.org/package/hledger-ui)
[any](https://www.stackage.org/package/hledger-ui) [and/or](https://www.stackage.org/package/hledger-web)
[newer](https://www.stackage.org/package/hledger-web) [hackage](https://www.stackage.org/package/hledger-api),
[versions](https://www.stackage.org/package/hledger-api):\ and will take a while.\
`stack install --resolver=nightly hledger [hledger-ui] [hledger-web] [hledger-api]`\ You can add `--dry-run` to see what it plans to do, and kill/restart it without losing progress.\
If stack says you need to run `stack setup`, do that first.\ Don't type the square brackets; they indicate optional packages which you can skip to save time.\
Don't type the square brackets; they mean that hledger-ui etc. are optional.\ hledger-ui is [not yet available on Windows](https://github.com/coreyoconnor/vty/pull/1).\
On Windows, hledger-ui is [not yet available](https://github.com/coreyoconnor/vty/pull/1).\ \
If required C libraries (like curses or terminfo) are not installed, you might need to install those manually and try again. If it says you need to run `stack setup`, do that then run the install command again.\
Eg: If it gives "Invalid package ID" errors, get a more up-to-date version of stack (see step 1).\
If it gives errors due to missing C libraries (like curses or terminfo), install those manually, eg like so:
| |
|-----------------|----------------------------------- |-----------------|-----------------------------------
| Debian, Ubuntu: | `sudo apt install libncurses5-dev` | Debian, Ubuntu: | `sudo apt install libncurses5-dev`
| Fedora, RHEL: | `sudo dnf install ncurses-devel` | Fedora, RHEL: | `sudo dnf install ncurses-devel`
If you're a [`cabal`](https://www.haskell.org/cabal/) expert, feel free to use that instead of stack, adapting these instructions appropriately. ([`cabal`](https://www.haskell.org/cabal/) experts, feel free to use that instead of stack.)
Now you should be able to run `hledger --version`, `hledger-ui --version` etc. Now you should be able to run `hledger --version`
(and `hledger-ui --version`, `hledger-web --version` if you installed those),
and see versions similar to those above.
<!--(The exact steps depend on your OS, cabal version and expertise.)--> <!--(The exact steps depend on your OS, cabal version and expertise.)-->