|
| 1 | +Using the LuaRocks package manager |
| 2 | +================================== |
| 3 | + |
| 4 | +.. code-block:: bash |
| 5 | +
|
| 6 | + tt rocks [FLAG ...] [VAR=VALUE] COMMAND [ARGUMENT] |
| 7 | +
|
| 8 | +``tt rocks`` provides means to manage Lua modules (rocks) via the |
| 9 | +`LuaRocks <https://luarocks.org/>`_ package manager. `tt` uses its own |
| 10 | +LuaRocks installation connected to the `Tarantool rocks repository <https://www.tarantool.io/en/download/rocks>`_. |
| 11 | + |
| 12 | +Below are lists of supported LuaRocks flags and commands. For detailed information on |
| 13 | +their usage, refer to `LuaRocks documentation <https://github.com/luarocks/luarocks/wiki/Documentation>`_. |
| 14 | + |
| 15 | +Flags |
| 16 | +----- |
| 17 | + |
| 18 | +.. container:: table |
| 19 | + |
| 20 | + .. list-table:: |
| 21 | + :widths: 30 70 |
| 22 | + :header-rows: 0 |
| 23 | + |
| 24 | + * - ``--dev`` |
| 25 | + - Enable the sub-repositories in rocks servers |
| 26 | + for rockspecs of in-development versions |
| 27 | + * - ``--server=<server>`` |
| 28 | + - Fetch rocks/rockspecs from this server |
| 29 | + (takes priority over config file) |
| 30 | + * - ``--only-server=<server>`` |
| 31 | + - Fetch rocks/rockspecs from this server only |
| 32 | + (overrides any entries in the config file) |
| 33 | + * - ``--only-sources=<url>`` |
| 34 | + - Restrict downloads to paths matching the given URL |
| 35 | + * - ``--lua-dir=<prefix>`` |
| 36 | + - Specify which Lua installation to use |
| 37 | + * - ``--lua-version=<ver>`` |
| 38 | + - Specify which Lua version to use |
| 39 | + * - ``--tree=<tree>`` |
| 40 | + - Specify which tree to operate on |
| 41 | + * - ``--local`` |
| 42 | + - Use the tree in the user's home directory. |
| 43 | + Call ``tt rocks help path`` to learn how to enable it |
| 44 | + * - ``--global`` |
| 45 | + - Use the system tree when `local_by_default` is `true` |
| 46 | + * - ``--verbose`` |
| 47 | + - Display verbose output for the command executed |
| 48 | + * - ``--timeout=<seconds>`` |
| 49 | + - Timeout on network operations, in seconds. |
| 50 | + 0 means no timeout (wait forever). Default: 30 |
| 51 | + |
| 52 | +Commands |
| 53 | +-------- |
| 54 | + |
| 55 | +.. container:: table |
| 56 | + |
| 57 | + .. list-table:: |
| 58 | + :widths: 20 80 |
| 59 | + :header-rows: 0 |
| 60 | + |
| 61 | + * - ``build`` |
| 62 | + - Build and compile a rock |
| 63 | + * - ``config`` |
| 64 | + - Query information about the LuaRocks configuration |
| 65 | + * - ``doc`` |
| 66 | + - Show documentation for an installed rock |
| 67 | + * - ``download`` |
| 68 | + - Download a specific rock file from a rocks server |
| 69 | + * - ``help`` |
| 70 | + - Help on commands. Type ``tt rocks help <command>`` for more |
| 71 | + * - ``init`` |
| 72 | + - Initialize a directory for a Lua project using LuaRocks |
| 73 | + * - ``install`` |
| 74 | + - Install a rock |
| 75 | + * - ``lint`` |
| 76 | + - Check syntax of a rockspec |
| 77 | + * - ``list`` |
| 78 | + - List the currently installed rocks |
| 79 | + * - ``make`` |
| 80 | + - Compile package in the current directory using a rockspec |
| 81 | + * - ``make_manifest`` |
| 82 | + - Compile a manifest file for a repository |
| 83 | + * - ``new_version`` |
| 84 | + - Auto-write a rockspec for a new version of a rock |
| 85 | + * - ``pack`` |
| 86 | + - Create a rock, packing sources or binaries |
| 87 | + * - ``purge`` |
| 88 | + - Remove all installed rocks from a tree |
| 89 | + * - ``remove`` |
| 90 | + - Uninstall a rock |
| 91 | + * - ``search`` |
| 92 | + - Query the LuaRocks servers |
| 93 | + * - ``show`` |
| 94 | + - Show information about an installed rock |
| 95 | + * - ``test`` |
| 96 | + - Run the test suite in the current directory |
| 97 | + * - ``unpack`` |
| 98 | + - Unpack the contents of a rock |
| 99 | + * - ``which`` |
| 100 | + - Tell which file corresponds to a given module name |
| 101 | + * - ``write_rockspec`` |
| 102 | + - Write a template for a rockspec file |
| 103 | + |
| 104 | +Examples |
| 105 | +-------- |
| 106 | + |
| 107 | +* Install the rock ``queue`` from the Tarantool rocks repository: |
| 108 | + |
| 109 | + .. code-block:: bash |
| 110 | +
|
| 111 | + tt rocks install queue |
| 112 | +
|
| 113 | +* Search for the rock ``queue`` in **both** the Tarantool rocks repository and |
| 114 | + the `default LuaRocks repository <https://luarocks.org>`_: |
| 115 | + |
| 116 | + .. code-block:: bash |
| 117 | +
|
| 118 | + tt rocks search queue --server='https://luarocks.org' |
| 119 | +
|
| 120 | +* List the documentation files for the installed rock ``queue``: |
| 121 | + |
| 122 | + .. code-block:: bash |
| 123 | +
|
| 124 | + tt rocks doc queue --list |
| 125 | +
|
| 126 | + Without the ``--list`` flag, this command displays documentation in the user's default browser. |
| 127 | + |
| 128 | +* Create a ``*.rock`` file from the installed rock ``queue``: |
| 129 | + |
| 130 | + .. code-block:: bash |
| 131 | +
|
| 132 | + tt rocks pack queue |
| 133 | +
|
| 134 | +* Unpack a ``*.rock`` file: |
| 135 | + |
| 136 | + .. code-block:: bash |
| 137 | +
|
| 138 | + tt rocks unpack queue-scm-1.all.rock |
| 139 | +
|
| 140 | +* Remove the installed rock ``queue``: |
| 141 | + |
| 142 | + .. code-block:: bash |
| 143 | +
|
| 144 | + tt rocks remove queue |
| 145 | + |
0 commit comments