source: general/prog/python3.xml@ 7d65f30

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.0 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 7d65f30 was 6030130, checked in by Douglas R. Reno <renodr@…>, 5 years ago

Update to git-2.23.0
Tag the rest of the packages I normally build before Xorg

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@21991 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.0 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 python3-download-http
8 "https://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
9 <!ENTITY python3-download-ftp " ">
10 <!ENTITY python3-md5sum "d33e4aae66097051c2eca45ee3604803">
11 <!ENTITY python3-size "16 MB">
12 <!ENTITY python3-buildsize "180 MB (add 22 MB for tests)">
13 <!ENTITY python3-time "1.0 SBU (add 1.1 SBU for tests)">
14 <!--
15
16 Note: Size does not reflect docs that were install in LFS.
17
18 <!ENTITY python3htmldoc-download-http
19 "https://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2"> -->
20]>
21
22<sect1 id="python3" xreflabel="Python-&python3-version;">
23 <?dbhtml filename="python3.html" ?>
24
25 <sect1info>
26 <othername>$LastChangedBy$</othername>
27 <date>$Date$</date>
28 </sect1info>
29
30 <title>Python-&python3-version;</title>
31
32 <indexterm zone="python3">
33 <primary sortas="a-Python3">Python3</primary>
34 </indexterm>
35
36 <sect2 role="package">
37 <title>Introduction to Python 3</title>
38
39 <para>
40 The <application>Python 3</application> package contains the
41 <application>Python</application> development environment.
42 This is useful for object-oriented programming, writing scripts,
43 prototyping large programs or developing entire applications.
44 </para>
45
46 <note><para><application>Python 3</application> was installed in LFS.
47 The only reason to rebuild it here is if optional modules
48 are needed.</para></note>
49
50 &lfs90_checked;
51
52 <bridgehead renderas="sect3">Package Information</bridgehead>
53 <itemizedlist spacing="compact">
54 <listitem>
55 <para>
56 Download (HTTP): <ulink url="&python3-download-http;"/>
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download (FTP): <ulink url="&python3-download-ftp;"/>
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download MD5 sum: &python3-md5sum;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Download size: &python3-size;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Estimated disk space required: &python3-buildsize;
77 </para>
78 </listitem>
79 <listitem>
80 <para>
81 Estimated build time: &python3-time;
82 </para>
83 </listitem>
84 </itemizedlist>
85
86 <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
87
88 <bridgehead renderas="sect4">Optional</bridgehead>
89 <para role="optional">
90 <xref linkend="bluez"/>,
91 <xref linkend="gdb"/> (required for some tests),
92 <xref linkend="valgrind"/>, and
93 <ulink url="http://www.bytereef.org/mpdecimal">libmpcdec</ulink>
94 </para>
95
96 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
97 <para role="optional">
98 <xref linkend="db"/>,
99 <xref linkend="sqlite"/>, and
100 <xref linkend="tk"/>
101 </para>
102
103 <para condition="html" role="usernotes">User Notes:
104 <ulink url="&blfs-wiki;/Python3"/>
105 </para>
106 </sect2>
107
108 <sect2 role="installation">
109 <title>Installation of Python 3</title>
110
111 <para>
112 Install <application>Python 3</application> by running the following
113 commands:
114 </para>
115
116<screen><userinput>CXX="/usr/bin/g++" \
117./configure --prefix=/usr \
118 --enable-shared \
119 --with-system-expat \
120 --with-system-ffi \
121 --with-ensurepip=yes &amp;&amp;
122make</userinput></screen>
123
124 <para>
125 The test suite must be run separately, using an X terminal (see below).
126 </para>
127
128 <para>
129 Now, as the <systemitem class="username">root</systemitem> user:
130 </para>
131
132<screen role="root"><userinput>make install &amp;&amp;
133chmod -v 755 /usr/lib/libpython&python3-majorver;m.so &amp;&amp;
134chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
135
136 <para>
137 The test suite must be run separately from the build, either before or
138 after the package is built and installed. Do not run
139 <command>make install</command> after running the test suite. To build
140 and install the package, you need to start with a fresh or clean source
141 tree. For the tests, you also need a clean source code, so either start by
142 removing the source code directory and starting over, by uncompressing
143 the source tarball or by running <command>make clean</command>. Then
144 configure again, adding <quote>--with-pydebug</quote> to the
145 <command>configure</command> switches above, run <command>make</command>,
146 then <command>make test</command>. Remember that tests must be executed
147 using an X terminal.
148 The test SBU highly depends on the speed of the internet connection.
149 </para>
150
151 </sect2>
152
153 <sect2 role="commands">
154 <title>Command Explanations</title>
155
156 <para>
157 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
158 message during configuration.
159 </para>
160
161 <para>
162 <parameter>--with-system-expat</parameter>: This switch enables linking
163 against the system version of <application>Expat</application>.
164 </para>
165
166 <para>
167 <parameter>--with-system-ffi</parameter>: This switch enables linking
168 against system version of <application>libffi</application>.
169 </para>
170
171 <para>
172 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
173 <command>pip</command> and <command>setuptools</command> packaging programs.
174 <command>setuptools</command> is needed for building some Python modules.
175 </para>
176
177 <para>
178 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
179 if you want to build <application>Python</application> DBM Module
180 against <application>Berkeley DB</application> instead of
181 <application>GDBM</application>.
182 </para>
183
184 <para>
185 <option>--enable-optimization</option>: Use this switch
186 if you want to enable <emphasis>expensive</emphasis> optimizations (i.e.
187 Profile Guided Optimizations). This adds around 20 SBU, but can
188 <emphasis>slightly</emphasis> speed up some uses, such as using
189 <application>Sphinx</application> for creating documentation, or use of
190 <application>Python3</application> scripts.
191 </para>
192
193 <para>
194 <option>--with-lto</option>: This optional switch enables thick Link
195 Time Optimization. Unusually, it creates a much larger <filename
196 class="libraryfile">/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.a</filename>
197 with a small increase in the time to compile
198 <application>Python</application>. Run-time results do not appear to show
199 any benefit from doing this.
200 </para>
201
202 <para>
203 <command>chmod ...</command>: Fix permissions for shared libraries to be
204 consistent with other libraries.
205 </para>
206
207 </sect2>
208
209 <sect2 role="configuration">
210 <title>Configuring Python 3</title>
211
212 <para>
213 In order for <command>python3</command> to find the installed
214 documentation, create the following version independent symlink:
215 </para>
216
217<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
218
219 <para>
220 and add the following environment variable to the individual user's or
221 system's profile:
222 </para>
223
224<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
225
226 </sect2>
227
228 <sect2 role="content">
229 <title>Contents</title>
230
231 <segmentedlist>
232 <segtitle>Installed Programs</segtitle>
233 <segtitle>Installed Libraries</segtitle>
234 <segtitle>Installed Directories</segtitle>
235
236 <seglistitem>
237 <seg>
238 2to3 (symlink),
239 2to3-&python3-majorver;,
240
241 idle3 (symlink), and
242 idle&python3-majorver;
243
244 pydoc3 (symlink),
245 pydoc&python3-majorver;,
246
247 python3 (symlink);
248 python&python3-majorver; and python&python3-majorver;m (hardlinked);
249
250 python3-config (symlink),
251 python&python3-majorver;-config (symlink),
252 python&python3-majorver;m-config,
253
254 pyvenv (symlink),
255 pyvenv-&python3-majorver;,
256 </seg>
257 <seg>
258 libpython&python3-majorver;m.so and libpython3.so
259 </seg>
260 <seg>
261 /usr/include/python&python3-majorver;m,
262 /usr/lib/python&python3-majorver;, and
263 /usr/share/doc/python-&python3-version;
264 </seg>
265 </seglistitem>
266 </segmentedlist>
267
268 <variablelist>
269 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
270 <?dbfo list-presentation="list"?>
271 <?dbhtml list-presentation="table"?>
272
273 <varlistentry id="idle3">
274 <term><command>idle3</command></term>
275 <listitem>
276 <para>
277 is a wrapper script that opens a <application>Python</application>
278 aware GUI editor. For this script to run, you must have installed
279 <application>Tk</application> before Python so that the Tkinter
280 Python module is built.
281 </para>
282 <indexterm zone="python3 idle3">
283 <primary sortas="b-idle3">idle3</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry id="pydoc3">
289 <term><command>pydoc3</command></term>
290 <listitem>
291 <para>
292 is the <application>Python</application> documentation
293 tool.
294 </para>
295 <indexterm zone="python3 pydoc3">
296 <primary sortas="b-pydoc3">pydo3c</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="python3-prog">
302 <term><command>python3</command></term>
303 <listitem>
304 <para>
305 is an interpreted, interactive, object-oriented programming
306 language.
307 </para>
308 <indexterm zone="python3 python3-prog">
309 <primary sortas="b-python3">python3</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="python-ver">
315 <term><command>python&python3-majorver;</command></term>
316 <listitem>
317 <para>
318 is a version-specific name for the <command>python</command>
319 program.
320 </para>
321 <indexterm zone="python3 python-ver">
322 <primary
323 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
324 </indexterm>
325 </listitem>
326 </varlistentry>
327
328 <varlistentry id="pyvenv">
329 <term><command>pyvenv</command></term>
330 <listitem>
331 <para>
332 creates virtual <application>Python</application> environments in
333 one or more target directories.
334 </para>
335 <indexterm zone="python3 pyvenv">
336 <primary
337 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 </variablelist>
343
344 </sect2>
345
346</sect1>
Note: See TracBrowser for help on using the repository browser.