Add Homebrew installation instructions

This commit is contained in:
Dario Vladovic 2020-06-17 01:36:26 +02:00
parent 6f77c06e3e
commit cc61d4d3d8
No known key found for this signature in database
GPG Key ID: 87F43AAF74B61286
2 changed files with 58 additions and 34 deletions

View File

@ -1,11 +1,15 @@
Installing
==========
# Installing
- [Installing from source](#installing-from-source)
- [Installing from a package mananager](#installing-from-a-package-manager)
## Installing from source
The easiest way to install is via the existing generated Scheme code.
The requirements are:
* A Scheme compiler; either Chez Scheme (default), or Racket.
* `bash`, with `realpath`. On Linux, you probably already have this.
- A Scheme compiler; either Chez Scheme (default), or Racket.
- `bash`, with `realpath`. On Linux, you probably already have this.
On a Mac, you can install this with `brew install coreutils`.
On FreeBSD, OpenBSD and NetBSD, you can install `realpath` and `GNU make`
using a package manager. For instance, on OpenBSD you can install all of them
@ -25,29 +29,27 @@ make sure you run `./configure --threads` to build multithreading support in.
**NOTE**: On FreeBSD, OpenBSD and NetBSD you need to use `gmake` command instead
of `make` in the following steps.
1: Set the PREFIX
-----------------
### 1: Set the PREFIX
* Change the `PREFIX` in `config.mk`. The default is to install in
- Change the `PREFIX` in `config.mk`. The default is to install in
`$HOME/.idris2`
If you have an existing Idris 2, go to the alternative Step 2. Otherwise, read on...
Make sure that:
* `$PREFIX/bin` is in your `PATH`
* `$PREFIX/lib` is in your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` if on
- `$PREFIX/bin` is in your `PATH`
- `$PREFIX/lib` is in your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` if on
`macOS` (so that the system knows where to look for library support code)
2: Installing without an existing Idris 2
------------------------------------------
### 2: Installing without an existing Idris 2
If you *don't* have [Idris-2-in-Idris-1](https://github.com/edwinb/Idris2-boot) installed, you can build from pre-built
If you _don't_ have [Idris-2-in-Idris-1](https://github.com/edwinb/Idris2-boot) installed, you can build from pre-built
Chez Scheme source, as long as you have Chez Scheme installed (or,
alternatively, Racket). To do this, enter one of the following:
* `make bootstrap SCHEME=chez`
* `make bootstrap-racket`
- `make bootstrap SCHEME=chez`
- `make bootstrap-racket`
`chez` is the executable name of the Chez Scheme compiler. You may need to
replace this with the executable for Chez Scheme on your system. This could be
@ -61,45 +63,50 @@ the tests.
If all is well, to install, type:
* `make install`
- `make install`
(Alternative 2: Installing with an existing Idris 2)
----------------------------------------------------
### (Alternative 2: Installing with an existing Idris 2)
If you have [Idris-2-in-Idris-1](https://github.com/edwinb/Idris2-boot)
installed:
* `make all IDRIS2_BOOT=idris2boot`
* `make install IDRIS2_BOOT=idris2boot`
- `make all IDRIS2_BOOT=idris2boot`
- `make install IDRIS2_BOOT=idris2boot`
If you have an earlier version of this Idris 2 installer
* `make all`
* `make install`
- `make all`
- `make install`
3: (Optional) Self-hosting step
-------------------------------
### 3: (Optional) Self-hosting step
As a final step, you can rebuild from the newly installed Idris 2 to verify
that everything has worked correctly. Assuming that `idris2` is in your
`PATH`.
* `make clean` -- to make sure you're building everything with the new version
* `make all && make install`
- `make clean` -- to make sure you're building everything with the new version
- `make all && make install`
4: Running tests
----------------
### 4: Running tests
After `make all`, type `make test` to check everything works. This uses the
executable in `./build/exec`.
5: (Optional) Installing the Idris 2 API
----------------------------------------
### 5: (Optional) Installing the Idris 2 API
You'll only need this if you're developing support tools, such as an external
code generator. To do so, once everything is successfully installed, type:
* `make install-api`
- `make install-api`
The API will only work if you've completed the self-hosting step, step 3, since
the intermediate code versions need to be consistent throughout.
## Installing from a package manager
### Installing using Homebrew
If you are Homebrew user you can install Idris 2 together with all the requirements
by running following command:
brew install idris2

View File

@ -4,8 +4,11 @@
Getting Started
***************
Installing from Source
======================
Prerequisites
=============
-------------
Idris 2 is implemented in Idris 2 itself, so to bootstrap it you can build from
generated Scheme sources. To do this, you need either Chez Scheme (default, and
@ -22,7 +25,7 @@ distributions.
you run ``./configure --threads`` to build multithreading support in.
Downloading and Installing
==========================
--------------------------
You can download the Idris 2 source from the `Idris web site
<https://www.idris-lang.org/pages/download.html>`_ or get the latest
@ -48,6 +51,20 @@ install with the command ``make install``. This will, by default, install into
PREFIX ?= /usr/local
Installing from a Package Manager
=================================
Installing Using Homebrew
----------------------
If you are Homebrew user you can install Idris 2 together with all the requirements
by running following command:
brew install idris2
Checking Installation
=====================
To check that installation has succeeded, and to write your first
Idris program, create a file called ``hello.idr`` containing the
following text: