|
1 | 1 | Installation
|
2 | 2 | ============
|
3 | 3 |
|
4 |
| -TODO: Installation instructions |
| 4 | +In this guide, we will get Links installed. |
| 5 | +We recommend Links can be installed using the Opam_ tool, which is used to distribute OCaml |
| 6 | +packages. |
| 7 | + |
| 8 | +Installing OPAM |
| 9 | +--------------- |
| 10 | + |
| 11 | +We recommend installing OPAM using the script referred to on the `OPAM installation pages`_. |
| 12 | +OPAM installations on Linux distribution repositories tend to be out of date, |
| 13 | +and Links requires at least OPAM 2. |
| 14 | + |
| 15 | +An OPAM "switch" refers to an environment for a particular compiler. |
| 16 | + |
| 17 | +Once OPAM is installed, be sure to execute ``opam init``. |
| 18 | + |
| 19 | +A note on ``bubblewrap`` |
| 20 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 21 | + |
| 22 | +A dependency of OPAM 2 is the `bubblewrap` sandboxing tool. |
| 23 | +If you are on Ubuntu 16.04, unfortunately this is not available from the default |
| 24 | +repositories. You can, however, add a `custom repository`_. |
| 25 | + |
| 26 | + |
| 27 | +Installing System Dependencies |
| 28 | +------------------------------ |
| 29 | + |
| 30 | +You will need the ``m4`` package, and ``gcc``. |
| 31 | + |
| 32 | +Installing Links |
| 33 | +---------------- |
| 34 | + |
| 35 | +Once the system dependencies are installed, you can install Links from OPAM by |
| 36 | +writing:: |
| 37 | + |
| 38 | + opam install links |
| 39 | + |
| 40 | +This will install Links and its files into your OPAM switch. The |
| 41 | +environment variable ``$OPAM_SWITCH_PREFIX`` points to your current |
| 42 | +active switch. Links files install to several locations inside an OPAM |
| 43 | +switch: |
| 44 | + |
| 45 | +* The executable is called ``linx`` and goes into ``$OPAM_SWITCH_PREFIX/bin`` |
| 46 | +* The Links prelude and JavaScript libraries go into ``$OPAM_SWITCH_PREFIX/lib/links`` |
| 47 | +* The example Links programs go into ``$OPAM_SWITCH_PREFIX/share/links`` |
| 48 | +* Links configuration file goes into ``$OPAM_SWITCH_PREFIX/etc/links`` |
| 49 | + |
| 50 | +If your ``opam`` switch is set up correctly, you should be able to get to the |
| 51 | +Links REPL by typing ``linx`` at a command line. If not, writing ``eval $(opam |
| 52 | +env)`` should set the system path correctly. |
| 53 | + |
| 54 | +Installing the Links Database Drivers |
| 55 | +------------------------------------- |
| 56 | + |
| 57 | +Links supports interfacing with databases. The database drivers are not |
| 58 | +installed by default. |
| 59 | + |
| 60 | +PostgreSQL |
| 61 | +~~~~~~~~~~ |
| 62 | + |
| 63 | +Running:: |
| 64 | + opam install links-postgresql |
| 65 | + |
| 66 | +will install the ``postgresql`` library, the required Links PostgreSQL driver, |
| 67 | +and recompile ``links`` to allow it to use the driver. |
| 68 | + |
| 69 | +Running |
| 70 | + |
| 71 | +.. _Opam: https://opam.ocaml.org |
| 72 | +.. _OPAM installation pages: https://opam.ocaml.org/doc/Install.html |
| 73 | +.. _custom repository: https://launchpad.net/~ansible/+archive/ubuntu/bubblewrap |
0 commit comments