hledger/site/download.md

137 lines
6.4 KiB
Markdown
Raw Normal View History

2015-11-04 05:59:12 +03:00
# Download
2017-04-13 18:42:24 +03:00
Choose a method:
2017-04-28 17:38:59 +03:00
<a name="a"></a>
2017-04-13 18:42:24 +03:00
2016-09-15 03:20:07 +03:00
## A. I want to download a packaged version
2015-07-23 17:05:28 +03:00
<style>
tr { vertical-align:top; }
td { padding-bottom:.5em; padding-right:1em; }
2016-09-13 22:08:37 +03:00
td:first-of-type {
/* white-space:nowrap; */
/* width:1%; */
}
a { white-space:nowrap; }
2015-07-23 17:05:28 +03:00
</style>
2016-11-12 20:40:04 +03:00
Packaged versions are the quickest to install, but they sometimes lag behind the
2017-04-13 18:42:24 +03:00
latest release, or provide only some of the hledger tools.
2017-07-11 07:53:29 +03:00
(Can you help?)
|
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Windows: | [Latest development builds](contributing.html#appveyor) from Appveyor CI (no hledger-ui, [please help](https://github.com/jtdaugherty/vty/pull/1#issuecomment-297143444))
| Mac: | **`brew install hledger`** (CLI only, [please help ](https://github.com/simonmichael/hledger/issues/321#issuecomment-179920520))
2017-04-29 02:41:10 +03:00
| Arch Linux: | **`pacaur -S hledger`**
| Debian,&nbsp;Ubuntu: | **`sudo apt install hledger hledger-ui hledger-web`**
| Fedora,&nbsp;RHEL: | **`sudo dnf install hledger`**
| Gentoo: | **`sudo layman -a haskell && sudo emerge hledger hledger-ui hledger-web`**
| Void Linux: | **`xbps-install -S hledger hledger-ui hledger-web hledger-api`**
| NixOS: | **`nix-env -iA nixpkgs.haskellPackages.hledger \`<br>&nbsp;&nbsp;`nixpkgs.haskellPackages.hledger-ui \`<br>&nbsp;&nbsp;`nixpkgs.haskellPackages.hledger-web`**
2017-07-11 07:53:29 +03:00
| Sandstorm: | **[hledger-web Sandstorm app](https://apps.sandstorm.io/app/8x12h6p0x0nrzk73hfq6zh2jxtgyzzcty7qsatkg7jfg2mzw5n90) -> demo** (get a hledger-web server in 3 clicks)
2014-11-13 05:02:40 +03:00
2016-10-30 17:10:35 +03:00
<a name="b"></a>
## B. I want to build the latest release
The latest release (see [release notes](release-notes.html)) is a good choice.
2017-05-23 01:45:44 +03:00
You have to build it, but this is relatively easy:
1. **Install [`stack`](http://haskell-lang.org/get-started)**\
2017-05-23 01:45:44 +03:00
\
On Windows, the 64-bit version is [recommended](https://github.com/simonmichael/hledger/issues/275#issuecomment-123834252).\
2017-01-08 22:12:18 +03:00
On Arch, you [may need to also install GHC manually](https://github.com/simonmichael/hledger/issues/434).\
2017-05-23 01:45:44 +03:00
Avoid really old packaged stack versions (< 1.0) which give ["Invalid package ID" errors](https://github.com/simonmichael/hledger/issues/513);
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:\
`echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc && source ~/.bashrc`
2017-07-01 01:06:50 +03:00
2. **`stack install hledger-lib-1.3 hledger-1.3 [hledger-ui-1.3] [hledger-web-1.3] [hledger-api-1.3]`**\
2017-05-23 01:45:44 +03:00
\
This command installs the latest hledger packages (and the haskell libraries and tools they depend on) from an
[appropriate](https://www.stackage.org/package/hledger-lib)
[stackage](https://www.stackage.org/package/hledger)
[snapshot](https://www.stackage.org/package/hledger-ui)
[and/or](https://www.stackage.org/package/hledger-web)
[hackage](https://www.stackage.org/package/hledger-api),
and will take a while.\
You can add `--dry-run` to see what it plans to do, and kill/restart it without losing progress.\
Don't type the square brackets; they indicate optional packages which you can skip to save time.\
hledger-ui is [not yet available on Windows](https://github.com/jtdaugherty/vty/pull/1#issuecomment-297143444).\
2017-05-23 01:45:44 +03:00
\
If it says you need to run `stack setup`, do that then run the install command again.\
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`
| Fedora, RHEL: | `sudo dnf install ncurses-devel`
2017-05-23 01:45:44 +03:00
([`cabal`](https://www.haskell.org/cabal/) experts, feel free to use that instead of stack.)
2017-05-23 01:45:44 +03:00
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.)-->
<!--
Short version:\
`cabal update && cabal install hledger [hledger-ui] [hledger-web] [hledger-api]`
-->
<!--
If you're brand new to cabal, these steps should work on unix-like systems
(on Windows, adjust commands and paths as needed):
1. Install [GHC](http://haskell.org/ghc) and [cabal](http://haskell.org/cabal/download.html) if needed,
eg from [https://www.haskell.org/downloads](https://www.haskell.org/downloads)
2. Ensure `~/.cabal/bin` or the Windows equivalent is in your `$PATH`,
eg `echo "export PATH=$PATH:~/.cabal/bin" >> ~/.bashrc && source ~/.bashrc`
3. `cabal update`
4. `cabal install alex happy`
5. `mkdir hledger-sandbox`
6. `cd hledger-sandbox`
7. `cabal sandbox init`
2016-10-30 17:10:35 +03:00
8. `cabal install hledger-1.0.1 [hledger-ui-1.0.2] [hledger-web-1.0.1] [hledger-api-1.0]`
9. `mv .cabal-sandbox/bin/hledger* ~/.cabal/bin`
10. `cd ..; rm -rf hledger-sandbox`
-->
2015-07-14 07:56:39 +03:00
<a name="c"></a>
## C. I want to build the development version
2017-07-11 07:53:29 +03:00
The latest [master branch](https://github.com/simonmichael/hledger/commits/master) includes not-yet-released features and is stable enough for daily use.
1. **Install [`stack`](http://haskell-lang.org/get-started) and [git](https://en.wikipedia.org/wiki/Git)**
(see notes in B above)
2. **`git clone http://code.hledger.org hledger`**
3. **`cd hledger`**
4. **`stack install`**
2016-10-30 17:10:35 +03:00
Cabal users can use the `cabal-install.sh` or `cabal.project` files instead.
<a name="d"></a>
2017-04-02 21:43:55 +03:00
## D. I want to install more commands
2017-04-03 02:13:32 +03:00
Additional [add-on commands](/hledger.html#third-party-add-ons)
can be installed. Eg:\
2017-04-02 21:43:55 +03:00
`stack install hledger-iadd-1.2.1` or `stack install --resolver nightly hledger-iadd`.
2017-04-03 02:13:32 +03:00
More, [experimental add-ons](/hledger.html#experimental-add-ons) are
included in the hledger source repo; to install these:
1. **Download the hledger source code** (as in C above)
2017-04-02 21:43:55 +03:00
2. **In the hledger directory, run `bin/compile.sh`** (installs dependencies & compiles for speed)
3. **Add the `hledger/bin/` directory to your `$PATH`** (as in B above)
Now you should be able to run `hledger iadd --version`, `hledger check --help` etc.