source: general/prog/lua52.xml@ 282a0eb

12.0 12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since 282a0eb was 282a0eb, checked in by Bruce Dubbs <bdubbs@…>, 9 months ago

Tag most of Chapter 13

  • Property mode set to 100644
File size: 7.7 KB
Line 
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 "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 </para>
43
44 &lfs120_checked;
45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>
50 Download (HTTP): <ulink url="&lua-download-http;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download (FTP): <ulink url="&lua-download-ftp;"/>
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download MD5 sum: &lua-md5sum;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Download size: &lua-size;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated disk space required: &lua-buildsize;
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 Estimated build time: &lua-time;
76 </para>
77 </listitem>
78 </itemizedlist>
79
80 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
81 <itemizedlist spacing="compact">
82 <listitem>
83 <para>
84 Required patch:
85 <ulink url="&patch-root;/lua-&lua52-version;-shared_library-1.patch"/>
86 </para>
87 </listitem>
88 </itemizedlist>
89
90 </sect2>
91
92 <sect2 role="installation">
93 <title>Installation of Lua 5.2</title>
94
95 <para>
96 Some packages check for the <application>pkg-config</application> file
97 for <application>Lua</application>, which is created with:
98 </para>
99
100<screen><userinput>cat &gt; lua.pc &lt;&lt; "EOF"
101<literal>V=5.2
102R=&lua52-version;
103
104prefix=/usr
105INSTALL_BIN=${prefix}/bin
106INSTALL_INC=${prefix}/include/lua5.2
107INSTALL_LIB=${prefix}/lib
108INSTALL_MAN=${prefix}/share/man/man1
109INSTALL_LMOD=${prefix}/share/lua/${V}
110INSTALL_CMOD=${prefix}/lib/lua/${V}
111exec_prefix=${prefix}
112libdir=${exec_prefix}/lib
113includedir=${prefix}/include/lua5.2
114
115Name: Lua
116Description: An Extensible Extension Language
117Version: ${R}
118Requires:
119Libs: -L${libdir} -llua5.2 -lm -ldl
120Cflags: -I${includedir}</literal>
121EOF</userinput></screen>
122
123 <para>
124 Install <application>Lua</application> by running the following
125 commands:
126 </para>
127
128<screen><userinput>patch -Np1 -i ../lua-&lua52-version;-shared_library-1.patch &amp;&amp;
129
130sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h &amp;&amp;
131
132sed -r -e '/^LUA_(SO|A|T)=/ s/lua/lua5.2/' \
133 -e '/^LUAC_T=/ s/luac/luac5.2/' \
134 -i src/Makefile &amp;&amp;
135
136make MYCFLAGS="-fPIC" linux</userinput></screen>
137<!--
138 <para>
139 To test the results, issue: <command>make test</command>.
140 <quote>This will run the interpreter and print its version.</quote>.
141 More comprehensive tests can be performed if you downloaded the "Test
142 suite" tarball. Those tests need to be executed after the package is
143 installed, thus we defer to the description below.
144 </para>
145-->
146 <para>
147 The installation of this package is complex, so we will use
148 the DESTDIR method of installation:
149 </para>
150
151<screen><userinput>make TO_BIN='lua5.2 luac5.2' \
152 TO_LIB="liblua5.2.so liblua5.2.so.5.2 liblua5.2.so.&lua52-version;" \
153 INSTALL_DATA="cp -d" \
154 INSTALL_TOP=$PWD/install/usr \
155 INSTALL_INC=$PWD/install/usr/include/lua5.2 \
156 INSTALL_MAN=$PWD/install/usr/share/man/man1 \
157 install &amp;&amp;
158
159install -Dm644 lua.pc install/usr/lib/pkgconfig/lua52.pc &amp;&amp;
160
161mkdir -pv install/usr/share/doc/lua-&lua52-version; &amp;&amp;
162cp -v doc/*.{html,css,gif,png} install/usr/share/doc/lua-&lua52-version; &amp;&amp;
163
164ln -s liblua5.2.so install/usr/lib/liblua.so.5.2 &amp;&amp;
165ln -s liblua5.2.so install/usr/lib/liblua.so.&lua52-version; &amp;&amp;
166
167mv install/usr/share/man/man1/{lua.1,lua5.2.1} &amp;&amp;
168mv install/usr/share/man/man1/{luac.1,luac5.2.1}</userinput></screen>
169
170 <para>
171 Now, as the <systemitem class="username">root</systemitem> user:
172 </para>
173
174<screen role="root"><userinput>chown -R root:root install &amp;&amp;
175cp -a install/* /</userinput></screen>
176
177 </sect2>
178
179 <sect2 role="commands">
180 <title>Command Explanations</title>
181
182 <para>
183 <command>sed -i ... src/luaconf.h</command>: This command changes the
184 <application>Lua</application> search path to match the install path.
185 </para>
186
187 <para>
188 <command>sed -i ... src/Makefile</command>: This command deconflicts
189 this installation with the latest version of lua.
190 </para>
191
192 </sect2>
193
194 <sect2 role="content">
195 <title>Contents</title>
196
197 <segmentedlist>
198 <segtitle>Installed Programs</segtitle>
199 <segtitle>Installed Library</segtitle>
200 <segtitle>Installed Directories</segtitle>
201
202 <seglistitem>
203 <seg>
204 lua5.2 and luac5.2
205 </seg>
206 <seg>
207 liblua5.2.so
208 </seg>
209 <seg>
210 /usr/include/lua5.2,
211 /usr/lib/lua/5.2,
212 /usr/share/doc/lua-&lua52-version;, and
213 /usr/share/lua/5.2
214 </seg>
215 </seglistitem>
216 </segmentedlist>
217
218 <variablelist>
219 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
220 <?dbfo list-presentation="list"?>
221 <?dbhtml list-presentation="table"?>
222
223 <varlistentry id="lua52-prog">
224 <term><command>lua5.2</command></term>
225 <listitem>
226 <para>
227 is the standalone Lua version 5.2 interpreter
228 </para>
229 <indexterm zone="lua52 lua-prog">
230 <primary sortas="b-lua52">lua5.2</primary>
231 </indexterm>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry id="luac52">
236 <term><command>luac5.2</command></term>
237 <listitem>
238 <para>
239 is the Lua version 5.2 compiler
240 </para>
241 <indexterm zone="lua52 luac52">
242 <primary sortas="b-luac52">luac5.2</primary>
243 </indexterm>
244 </listitem>
245 </varlistentry>
246
247 <varlistentry id="liblua52">
248 <term><filename class="libraryfile">liblua5.2.so</filename></term>
249 <listitem>
250 <para>
251 contains the <application>Lua</application> version 5.2 API functions
252 </para>
253 <indexterm zone="lua52 liblua52">
254 <primary sortas="c-liblua52">liblua5.2.so</primary>
255 </indexterm>
256 </listitem>
257 </varlistentry>
258
259 </variablelist>
260
261 </sect2>
262
263</sect1>
Note: See TracBrowser for help on using the repository browser.