source: chapter08/python.xml@ ceebda5

ml-11.0 multilib
Last change on this file since ceebda5 was ceebda5, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

Merge changes from trunk to multilib

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@12176 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.1 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
8<sect1 id="ch-system-Python" role="wrap">
9 <?dbhtml filename="Python.html"?>
10
11 <sect1info condition="script">
12 <productname>Python</productname>
13 <productnumber>&python-version;</productnumber>
14 <address>&python-url;</address>
15 </sect1info>
16
17 <title>Python-&python-version;</title>
18
19 <indexterm zone="ch-system-Python">
20 <primary sortas="a-Python">Python</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Python 3 package contains the Python development environment. It
27 is useful for object-oriented programming, writing scripts, prototyping
28 large programs, or developing entire applications.</para>
29
30 <segmentedlist>
31 <segtitle>&buildtime;</segtitle>
32 <segtitle>&diskspace;</segtitle>
33
34 <seglistitem>
35 <seg>&python-fin-sbu;</seg>
36 <seg>&python-fin-du;</seg>
37 </seglistitem>
38 </segmentedlist>
39
40 </sect2>
41
42 <sect2 role="installation">
43 <title>Installation of Python 3</title>
44
45 <para>First, a header file needs to be fixed:</para>
46
47<screen><userinput remap="pre">sed 's|cpython/||' -i Include/cpython/pystate.h</userinput></screen>
48
49 <para>Prepare Python for compilation:</para>
50
51<screen><userinput remap="configure">./configure --prefix=/usr \
52 --enable-shared \
53 --with-system-expat \
54 --with-system-ffi \
55 --with-ensurepip=yes</userinput></screen>
56
57 <variablelist>
58 <title>The meaning of the configure options:</title>
59
60 <varlistentry>
61 <term><parameter>--with-system-expat</parameter></term>
62 <listitem>
63 <para>This switch enables linking against system version of
64 <application>Expat</application>.</para>
65 </listitem>
66 </varlistentry>
67
68 <varlistentry>
69 <term><parameter>--with-system-ffi</parameter></term>
70 <listitem>
71 <para>This switch enables linking against system version of
72 <application>libffi</application>.</para>
73 </listitem>
74 </varlistentry>
75
76 <varlistentry>
77 <term><parameter>--with-ensurepip=yes</parameter></term>
78 <listitem>
79 <para>This switch enables building <command>pip</command> and
80 <command>setuptools</command> packaging programs.</para>
81 </listitem>
82 </varlistentry>
83
84 </variablelist>
85
86 <para>Compile the package:</para>
87
88<screen><userinput remap="make">make</userinput></screen>
89
90 <para>To test the results, issue:</para>
91
92<screen><userinput remap="test">make test</userinput></screen>
93
94 <para>Some tests requiring a network connection or additional packages are
95 skipped. The test named test_normalization is known to fail. For
96 more comprehensive results, the tests can be rerun when Python 3 is
97 reinstalled in BLFS.</para>
98
99 <para>Install the package:</para>
100
101<screen><userinput remap="install">make install</userinput></screen>
102
103 <para>If desired, install the preformatted documentation:</para>
104
105<screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
106
107tar --strip-components=1 \
108 --no-same-owner \
109 --no-same-permissions \
110 -C /usr/share/doc/python-&python-version;/html \
111 -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
112
113 <variablelist>
114 <title>The meaning of the documentation install commands:</title>
115
116 <varlistentry>
117 <term><option>--no-same-owner</option> and <option>--no-same-permissions</option></term>
118 <listitem>
119 <para>Ensure the installed files have the correct ownership and
120 permissions. Without these options, using <application>tar</application>
121 will install the package files with the upstream creator's values.
122 </para>
123 </listitem>
124 </varlistentry>
125
126 </variablelist>
127
128 </sect2>
129
130 <sect2 id="contents-python" role="content">
131 <title>Contents of Python 3</title>
132
133 <segmentedlist>
134 <segtitle>Installed Programs</segtitle>
135 <segtitle>Installed Library</segtitle>
136 <segtitle>Installed Directories</segtitle>
137
138 <seglistitem>
139 <seg>
140 2to3, idle3, pip3, pydoc3, python3, and python3-config
141 </seg>
142 <seg>
143 libpython&python-minor;.so and libpython3.so
144 </seg>
145 <seg>
146 /usr/include/python&python-minor;,
147 /usr/lib/python3, and
148 /usr/share/doc/python-&python-version;
149 </seg>
150 </seglistitem>
151 </segmentedlist>
152
153 <variablelist>
154 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
155 <?dbfo list-presentation="list"?>
156 <?dbhtml list-presentation="table"?>
157
158 <varlistentry id="python-2to3">
159 <term><command>2to3</command></term>
160 <listitem>
161 <para>
162 is a <application>Python</application> program that reads
163 <application>Python 2.x</application> source code and applies a
164 series of fixes to transform it into
165 valid <application>Python 3.x</application> code
166 </para>
167 <indexterm zone="ch-system-Python">
168 <primary sortas="b-2to3">2to3</primary>
169 </indexterm>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry id="idle3">
174 <term><command>idle3</command></term>
175 <listitem>
176 <para>
177 is a wrapper script that opens a <application>Python</application>
178 aware GUI editor. For this script to run, you must have installed
179 <application>Tk</application> before Python so that the Tkinter
180 Python module is built
181 </para>
182 <indexterm zone="ch-system-Python">
183 <primary sortas="b-idle3">idle3</primary>
184 </indexterm>
185 </listitem>
186 </varlistentry>
187
188 <varlistentry id="pip3">
189 <term><command>pip3</command></term>
190 <listitem>
191 <para>
192 The package installer for Python. You can use pip to install
193 packages from Python Package Index and other indexes
194 </para>
195 <indexterm zone="ch-system-Python">
196 <primary sortas="b-pip3">pip3</primary>
197 </indexterm>
198 </listitem>
199 </varlistentry>
200
201 <varlistentry id="pydoc3">
202 <term><command>pydoc3</command></term>
203 <listitem>
204 <para>
205 is the <application>Python</application> documentation tool
206 </para>
207 <indexterm zone="ch-system-Python">
208 <primary sortas="b-pydoc3">pydoc3</primary>
209 </indexterm>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry id="python3">
214 <term><command>python3</command></term>
215 <listitem>
216 <para>
217 is an interpreted, interactive, object-oriented programming
218 language
219 </para>
220 <indexterm zone="ch-system-Python">
221 <primary sortas="b-python3">python3</primary>
222 </indexterm>
223 </listitem>
224 </varlistentry>
225
226 </variablelist>
227
228 </sect2>
229
230</sect1>
231
Note: See TracBrowser for help on using the repository browser.