Changeset f56feddc


Ignore:
Timestamp:
11/07/2023 03:35:17 PM (7 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
12.1, ken/TL2024, ken/tuningfonts, lazarus, plabs/newcss, python3.11, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/llvm18
Children:
7be485e
Parents:
248d350
git-author:
Xi Ruoyao <xry111@…> (11/07/2023 03:32:50 PM)
git-committer:
Xi Ruoyao <xry111@…> (11/07/2023 03:35:17 PM)
Message:

seamonkey: Add Python-3.12 workaround

Bonus task: may we avoid the additional download? I couldn't figure out
a solution w/o it.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages.ent

    r248d350 rf56feddc  
    994994<!ENTITY firefox-version              "115.4.0">
    995995<!ENTITY seamonkey-version            "2.53.17.1">
     996<!ENTITY setuptools-version           "68.2.2"> <!-- for seamonkey -->
    996997
    997998<!-- Chapter 41 -->
  • xsoft/graphweb/seamonkey.xml

    r248d350 rf56feddc  
    8383        </para>
    8484      </listitem>
     85      <listitem>
     86        <para>
     87          Required Python module:
     88          <ulink url="&pymodules-dl;/s/setuptools/setuptools-&setuptools-version;.tar.gz"/>
     89        </para>
     90        <para>
     91          This module has already been installed in LFS, but now we need
     92          to rebuild its wheel package for SeaMonkey building system.
     93        </para>
     94      </listitem>
    8595    </itemizedlist>
    8696
     
    101111      <xref linkend="gtk3"/>,
    102112      <xref linkend="nodejs"/>,
     113      <xref linkend="six"/>,
    103114      <xref linkend="unzip"/>,
    104115      <xref linkend="yasm"/>, and
     
    270281<screen><userinput>patch -Np1 -i ../seamonkey-&seamonkey-version;-consolidated_fixes-1.patch</userinput></screen>
    271282
    272 <!--
    273     <para>
    274       Next, work around a problem in the Python virtual environment:
    275     </para>
    276 
    277 <screen><userinput>sed -i "/if sys.executable !=/i\    open(join(bin_dir, 'pyvenv.cfg'), 'w').close()" \
    278     third_party/python/virtualenv/virtualenv.py</userinput></screen>
    279 -->
     283    <para>
     284      The building system ships several internal copies of the Python 3
     285      module <filename>six.py</filename> and wheel packages for
     286      <filename>pip</filename> and <filename>setuptools</filename> modules.
     287      Theses shipped modules are too old to work well with Python 3.12 or
     288      later.  Replace the shipped <filename>six.py</filename> copies with
     289      the symlinks to <xref linkend='six'/> already installed on the system,
     290      link the updated <filename>pip</filename> wheel package shipped
     291      as a part of Python 3 in LFS into the building system, and build an
     292      updated <filename>setuptools</filename> wheel package.  Then adapt
     293      the building system for the updated modules.  We also need to rewrite
     294      the code based on the <filename>imp</filename> module removed in
     295      Python 3.12 and later using the <filename>importlib</filename> module:
     296    </para>
     297
     298    <screen><userinput>(for i in $(find -name six.py); do
     299   ln -sfv /usr/lib/python3.12/site-packages/six.py $i
     300   [ $? = 0 ] || exit $?
     301 done) &amp;&amp;
     302
     303ln -sv /usr/lib/python&python3-majorver;/ensurepip/_bundled/pip-*.whl \
     304       third_party/python/virtualenv/virtualenv_support &amp;&amp;
     305
     306tar xf ../setuptools-&setuptools-version;.tar.gz                             &amp;&amp;
     307pip3 wheel --no-build-isolation --no-deps --no-cache-dir       \
     308           $PWD/setuptools-&setuptools-version;                              \
     309           -w third_party/python/virtualenv/virtualenv_support &amp;&amp;
     310
     311sed '/ConfigParser/s/Safe//'                          \
     312    -i testing/mozbase/mozprofile/mozprofile/prefs.py &amp;&amp;
     313
     314sed 's/distutils/setuptools._&amp;/'            \
     315    -i python/mozbuild/mozbuild/nodeutil.py &amp;&amp;
     316
     317sed 's/readfp/read_file/' -i ipc/ipdl/ipdl.py &amp;&amp;
     318
     319sed -e '/^import/s/imp$/importlib.util/'             \
     320    -e 's/imp.new_module/__import__/'                \
     321    -e "s/imp.load_source\(.*\)/spec =               \
     322        importlib.util.spec_from_file_location\1;    \
     323        mod = importlib.util.module_from_spec(spec); \
     324        spec.loader.exec_module(mod)/" -i python/mach/mach/main.py &amp;&amp;
     325
     326sed -e '/^import/s/imp$/importlib.util/'                          \
     327    -e '/imp.PY_SOURCE/d'                                         \
     328    -e "s/\([a-z_]*\) = imp.load_module([^,]*,[^,]*,\(.*\)/spec = \
     329        importlib.util.spec_from_file_location('script', \2);     \
     330        \1 = importlib.util.module_from_spec(spec);               \
     331        spec.loader.exec_module(\1)/"                             \
     332    -i netwerk/dns/prepare_tlds.py                                \
     333       python/mozbuild/mozbuild/action/file_generate.py</userinput></screen>
    280334
    281335    <para>
Note: See TracChangeset for help on using the changeset viewer.