docs/readme.mdwn
author Myhailo Danylenko <isbear@ukrpost.net>
Sat, 05 Mar 2016 18:34:07 +0200
changeset 148 b222f4d111d9
parent 144 690b5524b895
permissions -rw-r--r--
lua: Add support for lua 5.3 (v0.0.4)


# Lua scripting for MCabber

This module creates lua 5.1, 5.2 or 5.3 interpreter environment and puts some
lua functions inside for your code to interact with mcabber.

Module provides mcabber command `/lua5.1`, `/lua5.2` or `/lua5.3` respectively
and adds an alias `/lua` for that command. This command evaluates argument as
lua code in created by module environment.

Note: If you load multiple versions, alial will point to the one, loaded last.

Lua functions, available in environment are described in api reference, built
with `docgen` help. It is also available
[[online|http://www.isbear.org.ua/docs/mcabber-lua/api/]].

In `examples` dir there are some example scripts, that may be used as is or for
reference. See also `README` in `examples` dir. They may be outdated, though.

# Installation

To install it, you need:

 * mcabber headers
 * liblua
 * glib
 * gmodule
 * docgen (optional, for documentation)
 * cmake
 * make
 * c compiler (gcc)
 * linker (binutils)

Then do:

    $ mkdir build
    $ cd build
    $ cmake ..
    $ make edit_cache
    $ make
    # make install

Debian users can instead of make install do:

    $ make package
    # dpkg -i mcabber-mod-lua5.?_*.deb

Users of other distributions can select appropriate package generator,
using cache editor.

# Building options

Through `make edit_cache` action you can adjust module parameters.  Notably:
you can specify needed lua version with `WANT_LUA` variable, though you'll
need to do that from command line at first cache generation
(-DWANT_LUA=LUAX.X), otherwise cmake will not re-discover lua package; you can
disable aliasing `lua` command at module loading time by unsetting
`ENABLE_LUA_ALIAS`; you can adjust mcabber option names to be
version-specific, if you need both versions running simultaneously via
`OPT_MLUA_RC` and `OPT_MLUA_DEBUG`.

# License

This code underlies terms of GNU GPL v2 or later. You can find it in
file COPYING from this distribution or on a GNU web-site
<http://www.gnu.org/licenses/>.

# Contact

I will be happy to get feedback, patches, suggestions, etc.
You can send me email or contact via jabber <isbear@unixzone.org.ua>.

  -- Myhailo Danylenko <risbea@gmail.com>