Browse Source

Remove hard-coded /usr in Chapter 5 Python

Fix a problem when building Python in Chapter 5 where some hosts may
use host dependent headers.

was r11519.
Bruce Dubbs 6 years ago
parent
commit
afc79655ba
4 changed files with 35 additions and 6 deletions
  1. 10 1
      chapter01/changelog.xml
  2. 21 1
      chapter05/python.xml
  3. 1 1
      chapter06/bash.xml
  4. 3 3
      general.ent

+ 10 - 1
chapter01/changelog.xml

@@ -41,6 +41,16 @@
     <listitem revision="sysv"> or <listitem revision="systemd"> as
     appropriate for the entry or if needed the entire day's listitem.
 -->
+    <listitem>
+      <para>2019-02-11</para>
+      <itemizedlist>
+        <listitem>
+          <para>[bdubbs] - 修复某些宿主环境中,在第 5 章中构建 Python 时,
+          可能使用依赖于宿主系统的头文件的问题。</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
     <listitem>
       <para>2019-02-11</para>
       <itemizedlist>
@@ -55,7 +65,6 @@
       </itemizedlist>
     </listitem>
 
-
     <listitem>
       <para>2019-02-08</para>
       <itemizedlist>

+ 21 - 1
chapter05/python.xml

@@ -43,9 +43,29 @@
   <sect2 role="installation">
     <title>安装 Python</title>
 
+    <para>该软件包首先构建 Python 解释器,然后构建一些标准 Python 模块。
+    构建模块使用的主要脚本是用 Python 语言编写的,其中包含指向宿主系统的,
+    硬编码的路径 <filename class="directory">/usr/include</filename> 和
+    <filename class="directory">/usr/lib</filename>。为了避免使用它们,
+    执行命令:</para>
+
+<screen><userinput remap="pre">sed -i '/def add_multiarch_paths/a \        return' setup.py</userinput></screen>
+
     <para>准备编译 Python:</para>
 
-<screen><userinput remap="configure">./configure --prefix=/tools --with-ensurepip=no</userinput></screen>
+<screen><userinput remap="configure">./configure --prefix=/tools --without-ensurepip</userinput></screen>
+
+    <variablelist>
+      <title>配置选项的含义:</title>
+
+      <varlistentry>
+        <term><parameter>--without-ensurepip</parameter></term>
+        <listitem>
+          <para>该选项禁止构建 Python 安装器,它在当前阶段没有必要。</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
 
     <para>编译该软件包:</para>
 

+ 1 - 1
chapter06/bash.xml

@@ -80,7 +80,7 @@
     <para>现在以 <systemitem class="username">nobody</systemitem>
     用户的身份运行测试:</para>
 
-<screen><userinput remap="test">su nobody -s /bin/bash -c "PATH=$PATH make tests"</userinput></screen>
+<screen><userinput remap="test">su nobody -s /bin/bash -c "PATH=$PATH HOME=/home make tests"</userinput></screen>
 
     <para>安装该软件包,并把主要的可执行文件移动到
     <filename class='directory'>/bin</filename>:</para>

+ 3 - 3
general.ent

@@ -1,13 +1,13 @@
-<!ENTITY version         "SVN-20190211">
+<!ENTITY version         "SVN-20190214">
 <!ENTITY short-version   "svn">  <!-- Used below in &blfs-book; 
                                       Change to x.y for release but not -rc releases -->
 <!ENTITY generic-version "development"> <!-- Use "development"  or "x.y[-pre{x}]" -->
 
-<!ENTITY versiond        "20190211-systemd">
+<!ENTITY versiond        "20190214-systemd">
 <!ENTITY short-versiond  "systemd">
 <!ENTITY generic-versiond "systemd"> 
 
-<!ENTITY releasedate     "2019 年 2 月 11 日">
+<!ENTITY releasedate     "2019 年 2 月 14 日">
 
 <!ENTITY copyrightdate   "1999-2019"><!-- jhalfs needs a literal dash, not &ndash; -->
 <!ENTITY milestone       "8.4">