Changeset 5bd4e666


Ignore:
Timestamp:
12/26/2023 06:34:06 PM (5 months ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
12.1, ken/TL2024, lazarus, plabs/newcss, python3.11, rahul/power-profiles-daemon, trunk, xry111/llvm18
Children:
01c1ac6
Parents:
105d06c
Message:

Simplify python3.11 page and firefox page.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • general/prog/python311.xml

    r105d06c r5bd4e666  
    99  <!ENTITY python311-md5sum        "4efe92adf28875c77d3b9b2e8d3bc44a">
    1010  <!ENTITY python311-size          "19 MB">
    11   <!ENTITY python311-buildsize     "301 MB (add 53 MB for tests)">
    12   <!ENTITY python311-time          "1.1 SBU (add 3.9 SBU for tests; both using parallelism=4)">
     11  <!ENTITY python311-buildsize     "301 MB">
     12  <!ENTITY python311-time          "1.1 SBU (Using parallelism=4)">
    1313]>
    1414
    1515<sect1 id="python311" xreflabel="Python-&python311-version;">
    1616  <?dbhtml filename="python311.html" ?>
    17 
    1817
    1918  <title>Python-&python311-version;</title>
     
    2928      The <application>Python 3.11</application> package contains an
    3029      older version of the <application>Python</application> development
    31       environment. This is almost required for building any Mozilla program
    32       (e.g <xref linkend="firefox"/>, <xref linkend="thunderbird"/>, and
    33        <xref linkend="seamonkey"/>) or <xref linkend="qtwebengine"/>)
     30      environment. This is <emphasis role="bold">only</emphasis>needed for
     31      building specific programs in BLFS
     32      that have not updated their build systems to support
     33      <xref linkend="python3"/> (e.g <xref linkend="firefox"/>,
     34      <xref linkend="thunderbird"/>, <xref linkend="seamonkey"/>) and
     35      <xref linkend="qtwebengine"/>)
    3436    </para>
    3537
    3638    <note>
    3739      <para>
    38         It is NOT recommended to install this package if you are
    39         not installing one of the above programs.
     40        Do NOT install this package if you are not installing one of
     41        the above programs.
    4042      </para>
    4143    </note>
     
    7981    </para>
    8082
    81     <bridgehead renderas="sect4">Optional</bridgehead>
    82     <para role="optional">
    83       <xref linkend="bluez"/>,
    84       <xref linkend="gdb"/> (required for some tests),
    85       <xref linkend="valgrind"/>, and
    86       <ulink url="https://www.bytereef.org/mpdecimal/">libmpdec</ulink>
    87     </para>
    88 
    89 
    90     <para condition="html" role="usernotes">Editor Notes:
    91       <ulink url="&blfs-wiki;/Python3"/>
    92     </para>
    9383  </sect2>
    9484
     
    10191    </para>
    10292
    103 <screen><userinput>CXX="/usr/bin/g++"                     \
     93<screen><userinput>
     94CXX="/usr/bin/g++"                     \
    10495./configure --prefix=/opt/python3.11   \
    10596            --disable-shared           \
    106             --with-system-expat  &amp;&amp;
     97            --with-system-expat        &amp;&amp;
    10798make</userinput></screen>
    10899
    109100    <para>
    110       To test the result, issue <command>LC_ALL=en_US.UTF-8
    111       make test</command>.
    112       Some tests may need an Internet connection.
     101      Since this package is only used in very limited situations,
     102      tests are not recommended.
    113103    </para>
    114104
     
    130120
    131121    <para>
    132       <parameter>--prefix=/opt/python3.11</parameter>: This installs python 3.11
    133       into /opt in order to avoid conflicts with the system version of python, and
    134       allow for easy removal/isolation once programs update to python3.12.
     122      <parameter>--prefix=/opt/python3.11</parameter>: This installs python
     123      3.11 into /opt in order to avoid conflicts with the system version of
     124      python, and allows for easy removal/isolation once programs update to
     125      python3.12 or later.
    135126    </para>
    136127
    137128    <para>
    138       <parameter>--disable-shared</parameter>: This switch disables building shared
    139       libraries. Since all the packages that need python-3.11 have built in modules and
    140       don't directly link to python, it is safe to turn off shared library support.
     129      <parameter>--disable-shared</parameter>: This switch disables building
     130      shared libraries. Since all the packages that need python-3.11 have built
     131      in modules and don't directly link to python, it is safe to turn off
     132      shared library support.
    141133    </para>
    142134
     
    145137      against the system version of <application>Expat</application>.
    146138    </para>
    147 
    148 <!--
    149     <para>
    150       <parameter>- -with-ensurepip=yes</parameter> : This switch enables building
    151       the <command>pip</command> and <command>setuptools</command> packaging
    152       programs. <command>setuptools</command> is needed for building some
    153       Python modules.
    154     </para>
    155 -->
    156 
    157 <!--
    158     This was removed from the book
    159     <para>
    160       <option>- -with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
    161       if you want to build the <application>Python</application> DBM Module
    162       against <application>Berkeley DB</application> instead of
    163       <application>GDBM</application>.
    164     </para>
    165 -->
    166 
    167     <para>
    168       <parameter>--enable-optimizations</parameter>: This switch enables
    169       stable, but expensive, optimizations.
    170     </para>
    171 
    172   </sect2>
    173 
    174   <sect2 role="configuration">
    175     <title>Configuring Python 3.11</title>
    176 
    177     <para>
    178       In order to maintain compatibility with programs that look for it,
    179       optionally, create the following versioned symlink to run python3.11,
    180     </para>
    181 
    182 <screen role="root"><userinput>ln -svfn /opt/python3.11/bin/python3.11 /usr/bin/python3.11</userinput></screen>
    183 
    184139
    185140  </sect2>
     
    197152          python3.11
    198153        </seg>
    199         <seg>
     154        <seg>
    200155          libpython3.11.a
    201156        </seg>
     
    211166      <?dbfo list-presentation="list"?>
    212167      <?dbhtml list-presentation="table"?>
    213       <!--
    214       <varlistentry id="2to3">
    215         <term><command>2to3</command></term>
    216         <listitem>
    217           <para>
    218             is designed to assist in the transition between python2 and python3
    219             by automatically converting code to be Python3 compatible.
    220           </para>
    221           <indexterm zone="python3 2to3">
    222             <primary sortas="b-2to3">2to3</primary>
    223           </indexterm>
    224         </listitem>
    225       </varlistentry>
    226       Put here for easy use when removing Python2 -->
    227       <!--
    228       <varlistentry id="easy_install">
    229         <term><command>easy_install</command></term>
    230         <listitem>
    231           <para>
    232             is a frontend to pip3 to make it easier to configure python modules
    233             through the PIP package manager
    234           </para>
    235           <indexterm zone="python3 easy_install">
    236             <primary sortas="python3 easy_install">easy_install</primary>
    237           </indexterm>
    238         </listitem>
    239       </varlistentry>
    240       -->
     168
    241169      <varlistentry id="python311-ver">
    242170        <term><command>python3.11</command></term>
     
    251179        </listitem>
    252180      </varlistentry>
    253       <!--
    254       <varlistentry id="pyvenv">
    255         <term><command>pyvenv</command></term>
    256         <listitem>
    257           <para>
    258             creates virtual <application>Python</application> environments in
    259             one or more target directories.
    260           </para>
    261           <indexterm zone="python3 pyvenv">
    262             <primary
    263             sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
    264           </indexterm>
    265         </listitem>
    266       </varlistentry>
    267       -->
    268181    </variablelist>
    269182
  • xsoft/graphweb/firefox.xml

    r105d06c r5bd4e666  
    192192    <title>Installation of Firefox</title>
    193193
    194 <!--
    195     <para>
    196       The building system ships several internal copies of the Python 3
    197       modules <application>setuptools</application> and
    198       <filename>six.py</filename>.  The shipped copies are too old
    199       to work well with Python 3.12 or later.  Replace them with the
    200       symlinks to the LFS <application>setuptools</application> package and
    201       <xref linkend='six'/> already installed on the system, and adapt the
    202       building system for these updated Python modules.  We also need to
    203       rewrite the code based on the <filename>imp</filename> module removed
    204       in Python 3.12 and later using the <filename>importlib</filename>
    205       module:
    206     </para>
    207 
    208 <screen><userinput>(for i in $(find -name six.py); do
    209    ln -sfv /usr/lib/python&python3-majorver;/site-packages/six.py $i
    210    [ $? = 0 ] || exit $?
    211  done) &amp;&amp;
    212 
    213 sed '/ConfigParser/s/Safe//'                          \
    214     -i testing/mozbase/mozprofile/mozprofile/prefs.py &amp;&amp;
    215 
    216 (for i in setuptools distutils-precedence.pth  \
    217           pkg_resources _distutils_hack; do
    218    rm -rf third_party/python/setuptools/$i     &amp;&amp;
    219    ln -sv /usr/lib/python&python3-majorver;/site-packages/$i \
    220           third_party/python/setuptools
    221    [ $? = 0 ] || exit $?
    222  done) &amp;&amp;
    223 
    224 sed 's/distutils/setuptools._&amp;/'            \
    225     -i python/mozbuild/mozbuild/nodeutil.py &amp;&amp;
    226 
    227 sed -e '/^import/s/imp$/importlib.util/'             \
    228     -e 's/imp.new_module/__import__/'                \
    229     -e "s/imp.load_source\(.*\)/spec =               \
    230         importlib.util.spec_from_file_location\1;    \
    231         mod = importlib.util.module_from_spec(spec); \
    232         spec.loader.exec_module(mod)/" -i python/mach/mach/main.py &amp;&amp;
    233 sed '/import imp/d' -i netwerk/dns/prepare_tlds.py
    234 </userinput></screen>
    235 -->
    236 
    237194    <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1859752
    238195         https://hg.mozilla.org/try/rev/d5f3b0c4f08a -->
     
    421378    </para>
    422379
    423 <screen><userinput>export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &amp;&amp;
     380<screen><userinput>
     381export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &amp;&amp;
    424382export MOZBUILD_STATE_PATH=${PWD}/mozbuild          &amp;&amp;
    425 python3.11 ./mach configure                                    &amp;&amp;
    426 python3.11 ./mach build</userinput></screen>
     383export PYTHON311=/opt/python3.11/bin/python3.11     &amp;&amp;
     384PYTHON311 ./mach configure                          &amp;&amp;
     385PYTHPN311 ./mach build</userinput></screen>
    427386
    428387    <para>
     
    441400    </para>
    442401
    443 <screen role="root"><userinput>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none python3.11 ./mach install</userinput></screen>
     402<screen role="root"><userinput>
     403export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &amp;&amp;
     404export PYTHON311=/opt/python3.11/bin/python3.11     &amp;&amp;
     405PYTHON ./mach install</userinput></screen>
    444406
    445407    <para>
     
    447409    </para>
    448410
    449 <screen><userinput>unset MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE MOZBUILD_STATE_PATH</userinput></screen>
     411<screen><userinput>
     412unset MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE
     413unset MOZBUILD_STATE_PATH
     414unset PYTHON311</userinput></screen>
    450415
    451416  </sect2>
     
    454419    <title>Command Explanations</title>
    455420
    456 <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    457       href="../../xincludes/SIOCGSTAMP.xml"/>-->
    458 
    459421    <para>
    460422      <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
    461       is now supposed to tell you that it intends to create <filename
     423      tells you that it intends to create <filename
    462424      class="directory">~/.mozbuild</filename>, and offer you an option to
    463425      press &lt;ENTER&gt; to accept this, or Ctrl-C to cancel and restart the
     
    468430    <para>
    469431      That directory is used for a (probably random) telemetry identifier.
    470       Creating this in the build directory, and deleting that after the
    471       installation, prevents it being used. If you wish to participate in
    472       telemetry, export MOZBUILD_STATE_PATH to point to its default directory
    473       and remove the entry from the <filename>mozconfig</filename>.
     432      Creating this directory within the build directory and deleting it after the
     433      installation prevents it being used.
    474434    </para>
    475435
     
    477437      <command>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none</command>: Use the
    478438      system python to create a virtual environment for <command>mach</command>
    479       without downloading any python wheels nor using the system python modules.
     439      without downloading any python wheels and without using the system python modules.
    480440      This prevents version mismatches between system modules and bundled ones.
    481441    </para>
Note: See TracChangeset for help on using the changeset viewer.