5771c13320e364b14a1a3806b39400f403aae9da — Zach Smith 3 months ago 1a95606
Update README with installation
1 files changed, 71 insertions(+), 0 deletions(-)

M README.md => README.md +71 -0
@@ 100,3 100,74 @@ $ cp build/ec <somewhere on your path>

[Janet]: https://janet-lang.org

# Installing

EC is built using the [Janet][janet] language and needs Janet to
be compiled. You will use the Janet package manager, `jpm`, to install

## Getting Janet 

Install the Janet language. You can download the release here: <https://github.com/janet-lang/janet/releases>

It's available on Homebrew: <https://formulae.brew.sh/formula/janet>

And on AUR: <https://aur.archlinux.org/packages/janet-lang/>

You can read the [Janet docs][docs]for more information. 

[janet]: https://janet-lang.org
[docs]: https://janet-lang.org/docs/index.html

Once you install Janet, you'll have access to the `jpm` command. 

## Installing EC 

The EC source is available at <https://git.sr.ht/~subsetpark/ec>.

You can use `jpm` to install it, or get it from AUR.

## AUR

On Linux systems that use the AUR (Arch User Repository), you can install `ec`:

`yay -S ec`

## JPM

### Installing with `jpm` and `sudo`

You can also use the `jpm` package manager. EC requires `janet-rl`,
which uses the `libedit` library and `pkg-config` program. Make sure
both of those are installed on your system.

Run the following command:

`sudo jpm install https://git.sr.ht/~subsetpark/ec`

This will download and the EC library with all its dependencies,
then compile the `ec` application and install it. (on my machine, it
installs it to `/sbin/ec`).

### Installing with `jpm` and without `sudo`

Clone EC to a working directory and then build it. By default,
`jpm` will install things globally, but you can easily specify a local
directory. Here's an example:

code-src/ec [master !] ⊕ JANET_PATH=janet_modules jpm load-lockfile
<all the deps get downloaded and compiled...>
code-src/ec [master !] ⊕ JANET_PATH=janet_modules/ jpm build       
generating executable c source...
found native janet_modules/_jmod_posix_spawn.so...
found native janet_modules/_sh.so...
found native janet_modules/json.so...
found native janet_modules/moondown.so...
compiling build/ec.c to build/build___ec.o...
linking build/ec...

The `ec` executable is now in the `./build` directory. You move it
wherever you like (I move mine to `~/bin/`).