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