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