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