[c1a0390] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY lua-download-http "http://www.lua.org/ftp/lua-&lua-version;.tar.gz">
|
---|
| 8 | <!ENTITY lua-download-ftp " ">
|
---|
[69d690f] | 9 | <!ENTITY lua-md5sum "4f4b4f323fd3514a68e0ab3da8ce3455">
|
---|
[198f4b92] | 10 | <!ENTITY lua-size "300 KB">
|
---|
[69d690f] | 11 | <!ENTITY lua-buildsize "4.5 MB (with Basic tests)">
|
---|
[c8229af] | 12 | <!ENTITY lua-time "less than 0.1 SBU (with Basic tests)">
|
---|
| 13 |
|
---|
[69d690f] | 14 | <!-- Note for editors - the soname and test suite versions did not change, so I
|
---|
| 15 | Had to hardcode them. -renodr -->
|
---|
| 16 | <!ENTITY lua-tests-download-http "http://www.lua.org/tests/lua-5.3.4-tests.tar.gz">
|
---|
[c8229af] | 17 | <!ENTITY lua-tests-download-ftp " ">
|
---|
[198f4b92] | 18 | <!ENTITY lua-tests-md5sum "b14fe3748c1cb2d74e3acd1943629ba3">
|
---|
[0cd81836] | 19 | <!ENTITY lua-tests-size "104 KB">
|
---|
[c1a0390] | 20 | ]>
|
---|
| 21 |
|
---|
| 22 | <sect1 id="lua" xreflabel="Lua-&lua-version;">
|
---|
| 23 | <?dbhtml filename="lua.html"?>
|
---|
| 24 |
|
---|
| 25 | <sect1info>
|
---|
| 26 | <othername>$LastChangedBy$</othername>
|
---|
| 27 | <date>$Date$</date>
|
---|
| 28 | </sect1info>
|
---|
| 29 |
|
---|
| 30 | <title>Lua-&lua-version;</title>
|
---|
| 31 |
|
---|
| 32 | <indexterm zone="lua">
|
---|
| 33 | <primary sortas="a-Lua">Lua</primary>
|
---|
| 34 | </indexterm>
|
---|
| 35 |
|
---|
| 36 | <sect2 role="package">
|
---|
| 37 | <title>Introduction to Lua</title>
|
---|
| 38 |
|
---|
| 39 | <para>
|
---|
| 40 | <application>Lua</application> is a powerful light-weight programming
|
---|
| 41 | language designed for extending applications. It is also frequently used
|
---|
| 42 | as a general-purpose, stand-alone language. <application>Lua</application>
|
---|
[32d4980] | 43 | is implemented as a small library of C functions, written in ANSI C, and
|
---|
| 44 | compiles unmodified in all known platforms. The implementation goals are
|
---|
| 45 | simplicity, efficiency, portability, and low embedding cost. The result is
|
---|
| 46 | a fast language engine with small footprint, making it ideal in embedded
|
---|
| 47 | systems too.
|
---|
[c1a0390] | 48 | </para>
|
---|
| 49 |
|
---|
[5380ca3] | 50 | &lfs91_checked;
|
---|
[c1a0390] | 51 |
|
---|
| 52 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 53 | <itemizedlist spacing="compact">
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>
|
---|
| 56 | Download (HTTP): <ulink url="&lua-download-http;"/>
|
---|
| 57 | </para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>
|
---|
| 61 | Download (FTP): <ulink url="&lua-download-ftp;"/>
|
---|
| 62 | </para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>
|
---|
| 66 | Download MD5 sum: &lua-md5sum;
|
---|
| 67 | </para>
|
---|
| 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>
|
---|
| 71 | Download size: &lua-size;
|
---|
| 72 | </para>
|
---|
| 73 | </listitem>
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>
|
---|
| 76 | Estimated disk space required: &lua-buildsize;
|
---|
| 77 | </para>
|
---|
| 78 | </listitem>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>
|
---|
| 81 | Estimated build time: &lua-time;
|
---|
| 82 | </para>
|
---|
| 83 | </listitem>
|
---|
| 84 | </itemizedlist>
|
---|
| 85 |
|
---|
[ef47d83f] | 86 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 87 | <itemizedlist spacing="compact">
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>
|
---|
| 90 | Required patch:
|
---|
[5b63ae51] | 91 | <ulink url="&patch-root;/lua-&lua-version;-shared_library-1.patch"/>
|
---|
[ef47d83f] | 92 | </para>
|
---|
| 93 | </listitem>
|
---|
[c8229af] | 94 | <listitem>
|
---|
| 95 | <para>
|
---|
| 96 | Optional Test Suite Download (HTTP): <ulink url="&lua-tests-download-http;"/>
|
---|
| 97 | </para>
|
---|
| 98 | </listitem>
|
---|
| 99 | <listitem>
|
---|
| 100 | <para>
|
---|
| 101 | Optional Test Suite Download (FTP): <ulink url="&lua-tests-download-ftp;"/>
|
---|
| 102 | </para>
|
---|
| 103 | </listitem>
|
---|
| 104 | <listitem>
|
---|
| 105 | <para>
|
---|
| 106 | Optional Test Suite Download MD5 sum: &lua-tests-md5sum;
|
---|
| 107 | </para>
|
---|
| 108 | </listitem>
|
---|
| 109 | <listitem>
|
---|
| 110 | <para>
|
---|
| 111 | Optional Test Suite Download size: &lua-tests-size;
|
---|
| 112 | </para>
|
---|
| 113 | </listitem>
|
---|
[ef47d83f] | 114 | </itemizedlist>
|
---|
| 115 |
|
---|
[c1a0390] | 116 | <para condition="html" role="usernotes">User Notes:
|
---|
| 117 | <ulink url="&blfs-wiki;/lua"/>
|
---|
| 118 | </para>
|
---|
| 119 | </sect2>
|
---|
| 120 |
|
---|
| 121 | <sect2 role="installation">
|
---|
| 122 | <title>Installation of Lua</title>
|
---|
| 123 |
|
---|
[de33b2a] | 124 | <para>
|
---|
| 125 | Some packages check for the <application>pkg-config</application> file
|
---|
| 126 | for <application>Lua</application>, which is created with:
|
---|
| 127 | </para>
|
---|
[ae5a7024] | 128 |
|
---|
[34525b48] | 129 | <screen><userinput>cat > lua.pc << "EOF"
|
---|
[ae5a7024] | 130 | <literal>V=5.3
|
---|
| 131 | R=&lua-version;
|
---|
| 132 |
|
---|
| 133 | prefix=/usr
|
---|
| 134 | INSTALL_BIN=${prefix}/bin
|
---|
| 135 | INSTALL_INC=${prefix}/include
|
---|
| 136 | INSTALL_LIB=${prefix}/lib
|
---|
| 137 | INSTALL_MAN=${prefix}/share/man/man1
|
---|
| 138 | INSTALL_LMOD=${prefix}/share/lua/${V}
|
---|
| 139 | INSTALL_CMOD=${prefix}/lib/lua/${V}
|
---|
| 140 | exec_prefix=${prefix}
|
---|
| 141 | libdir=${exec_prefix}/lib
|
---|
| 142 | includedir=${prefix}/include
|
---|
| 143 |
|
---|
| 144 | Name: Lua
|
---|
| 145 | Description: An Extensible Extension Language
|
---|
| 146 | Version: ${R}
|
---|
| 147 | Requires:
|
---|
[5f3018f8] | 148 | Libs: -L${libdir} -llua -lm -ldl
|
---|
[ae5a7024] | 149 | Cflags: -I${includedir}</literal>
|
---|
| 150 | EOF</userinput></screen>
|
---|
| 151 |
|
---|
[c1a0390] | 152 | <para>
|
---|
| 153 | Install <application>Lua</application> by running the following
|
---|
| 154 | commands:
|
---|
| 155 | </para>
|
---|
| 156 |
|
---|
[5b63ae51] | 157 | <screen><userinput>patch -Np1 -i ../lua-&lua-version;-shared_library-1.patch &&
|
---|
[123114f8] | 158 | sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h &&
|
---|
[c8229af] | 159 |
|
---|
[ae5a7024] | 160 | make MYCFLAGS="-DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" linux</userinput></screen>
|
---|
[c1a0390] | 161 |
|
---|
| 162 | <para>
|
---|
| 163 | To test the results, issue: <command>make test</command>.
|
---|
[c8229af] | 164 | <quote>This will run the interpreter and print its version.</quote>.
|
---|
| 165 | More comprehensive tests can be performed if you downloaded the "Test
|
---|
| 166 | suite" tarball. Those tests need to be executed after the package is
|
---|
[0cd81836] | 167 | installed, thus we defer to the description below.
|
---|
[c1a0390] | 168 | </para>
|
---|
| 169 |
|
---|
| 170 | <para>
|
---|
| 171 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 172 | </para>
|
---|
| 173 |
|
---|
[198f4b92] | 174 | <screen role="root"><userinput>make INSTALL_TOP=/usr \
|
---|
| 175 | INSTALL_DATA="cp -d" \
|
---|
| 176 | INSTALL_MAN=/usr/share/man/man1 \
|
---|
[69d690f] | 177 | TO_LIB="liblua.so liblua.so.5.3 liblua.so.5.3.4" \
|
---|
[198f4b92] | 178 | install &&
|
---|
[69d690f] | 179 | <!-- As stated above, we have to hardcode 5.3.4. -->
|
---|
[c8229af] | 180 |
|
---|
[198f4b92] | 181 | mkdir -pv /usr/share/doc/lua-&lua-version; &&
|
---|
[ae5a7024] | 182 | cp -v doc/*.{html,css,gif,png} /usr/share/doc/lua-&lua-version; &&
|
---|
[c1a0390] | 183 |
|
---|
[ae5a7024] | 184 | install -v -m644 -D lua.pc /usr/lib/pkgconfig/lua.pc</userinput></screen>
|
---|
[ef47d83f] | 185 |
|
---|
[c8229af] | 186 | <para>
|
---|
[0cd81836] | 187 | Here we describe only the "Basic tests". Untar the tarball and
|
---|
[c8229af] | 188 | change to the
|
---|
[0a954655] | 189 | <filename class="directory">lua-5.3.4-tests</filename> directory,
|
---|
[c8229af] | 190 | then issue
|
---|
[0cd81836] | 191 | <command>lua -e "_U=true" all.lua</command>. If the tests finish without
|
---|
| 192 | error, you will see a message containing the string "final OK".
|
---|
[c8229af] | 193 | </para>
|
---|
| 194 |
|
---|
[c1a0390] | 195 | </sect2>
|
---|
| 196 |
|
---|
[123114f8] | 197 | <sect2 role="commands">
|
---|
| 198 | <title>Command Explanations</title>
|
---|
| 199 |
|
---|
| 200 | <para>
|
---|
[0cd81836] | 201 | <command>sed -i ... src/luaconf.h</command>: This command changes the
|
---|
| 202 | <application>Lua</application> search path to match the install path.
|
---|
[123114f8] | 203 | </para>
|
---|
| 204 |
|
---|
[d76c6b9] | 205 | <para>
|
---|
[ae5a7024] | 206 | <envar>MYCFLAGS="-DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1"</envar>: This
|
---|
| 207 | environment variable includes compatibility layers with Lua 5.1 and 5.2
|
---|
| 208 | in the build.
|
---|
[d76c6b9] | 209 | </para>
|
---|
| 210 |
|
---|
[123114f8] | 211 | </sect2>
|
---|
| 212 |
|
---|
[c1a0390] | 213 | <sect2 role="content">
|
---|
| 214 | <title>Contents</title>
|
---|
| 215 |
|
---|
| 216 | <segmentedlist>
|
---|
| 217 | <segtitle>Installed Programs</segtitle>
|
---|
[9b29b78] | 218 | <segtitle>Installed Library</segtitle>
|
---|
[c1a0390] | 219 | <segtitle>Installed Directories</segtitle>
|
---|
| 220 |
|
---|
| 221 | <seglistitem>
|
---|
| 222 | <seg>
|
---|
| 223 | lua and luac
|
---|
| 224 | </seg>
|
---|
| 225 | <seg>
|
---|
[ef47d83f] | 226 | liblua.so
|
---|
[c1a0390] | 227 | </seg>
|
---|
| 228 | <seg>
|
---|
[c8229af] | 229 | /usr/{lib,share}/lua and
|
---|
[c1a0390] | 230 | /usr/share/doc/lua-&lua-version;
|
---|
| 231 | </seg>
|
---|
| 232 | </seglistitem>
|
---|
| 233 | </segmentedlist>
|
---|
| 234 |
|
---|
| 235 | <variablelist>
|
---|
| 236 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 237 | <?dbfo list-presentation="list"?>
|
---|
| 238 | <?dbhtml list-presentation="table"?>
|
---|
| 239 |
|
---|
| 240 | <varlistentry id="lua-prog">
|
---|
| 241 | <term><command>lua</command></term>
|
---|
| 242 | <listitem>
|
---|
| 243 | <para>
|
---|
| 244 | is the standalone Lua interpreter.
|
---|
| 245 | </para>
|
---|
| 246 | <indexterm zone="lua lua-prog">
|
---|
| 247 | <primary sortas="b-lua">lua</primary>
|
---|
| 248 | </indexterm>
|
---|
| 249 | </listitem>
|
---|
| 250 | </varlistentry>
|
---|
| 251 |
|
---|
| 252 | <varlistentry id="luac">
|
---|
| 253 | <term><command>luac</command></term>
|
---|
| 254 | <listitem>
|
---|
| 255 | <para>
|
---|
| 256 | is the Lua compiler.
|
---|
| 257 | </para>
|
---|
| 258 | <indexterm zone="lua luac">
|
---|
| 259 | <primary sortas="b-luac">luac</primary>
|
---|
| 260 | </indexterm>
|
---|
| 261 | </listitem>
|
---|
| 262 | </varlistentry>
|
---|
| 263 |
|
---|
[ef47d83f] | 264 | <varlistentry id="liblua">
|
---|
| 265 | <term><filename class="libraryfile">liblua.so</filename></term>
|
---|
| 266 | <listitem>
|
---|
| 267 | <para>
|
---|
| 268 | contains the <application>Lua</application> API functions.
|
---|
| 269 | </para>
|
---|
| 270 | <indexterm zone="lua liblua">
|
---|
[9297e31] | 271 | <primary sortas="c-liblua">liblua.so</primary>
|
---|
[ef47d83f] | 272 | </indexterm>
|
---|
| 273 | </listitem>
|
---|
| 274 | </varlistentry>
|
---|
| 275 |
|
---|
[c1a0390] | 276 | </variablelist>
|
---|
| 277 |
|
---|
| 278 | </sect2>
|
---|
| 279 |
|
---|
| 280 | </sect1>
|
---|