.gitignore                                             |    1 
 RepositoryExternal.mk                                  |    2 
 configure.ac                                           |   12 
 download.lst                                           |    4 
 external/openssl/ExternalPackage_openssl.mk            |    8 
 external/python3/ExternalPackage_python3.mk            |  356 ++++++++---------
 external/python3/ExternalProject_python3.mk            |   47 --
 external/python3/UnpackedTarball_python3.mk            |    2 
 external/python3/i100492-freebsd.patch.1               |    6 
 external/python3/internal-zlib.patch.0                 |   22 -
 external/python3/python-3.3.0-clang.patch.1            |   13 
 external/python3/python-3.3.0-darwin.patch.1           |   20 
 external/python3/python-3.3.3-disable-obmalloc.patch.0 |    4 
 external/python3/python-3.3.3-elf-rpath.patch.1        |   12 
 external/python3/python-3.5.4-msvc-disable.patch.1     |    8 
 external/python3/python-3.5.tweak.strip.soabi.patch    |    2 
 external/python3/python-3.7.6-msvc-ssl.patch.1         |    2 
 external/python3/python-3.8-msvc-sdk.patch.1           |  173 ++++++++
 external/python3/ubsan.patch.0                         |   23 +
 instsetoo_native/util/openoffice.lst.in                |    2 
 librelogo/source/LibreLogo/LibreLogo.py                |   34 -
 pyuno/source/loader/pythonloader.py                    |    4 
 scripting/source/pyprov/pythonscript.py                |    8 
 setup_native/source/packinfo/finals_instsetoo.txt      |    1 
 sfx2/UITest_sfx2_doc.mk                                |   12 
 solenv/bin/modules/installer/globals.pm                |    2 
 solenv/bin/modules/installer/windows/admin.pm          |    3 
 solenv/bin/modules/installer/windows/msp.pm            |    2 
 solenv/gdb/boost/util/printing.py                      |    2 
 solenv/gdb/libreoffice/util/printing.py                |    2 
 30 files changed, 477 insertions(+), 312 deletions(-)

New commits:
commit f91334fb949199e403036dc180d331f0c850b041
Author:     Andras Timar <[email protected]>
AuthorDate: Sat Apr 1 19:12:45 2023 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:12:45 2023 +0200

    Bump version to 6.4-66
    
    Change-Id: I5dfb8a7319631a033b2c836148bd73f94f4b8cc7

diff --git a/configure.ac b/configure.ac
index ef7b8aecc51e..6eb735ea7af8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[6.4.10.65],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[6.4.10.66],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard
commit d67c5b867aa0b5be65096450f400a34f5dbae959
Author:     Andras Timar <[email protected]>
AuthorDate: Sat Apr 1 19:10:15 2023 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:10:21 2023 +0200

    Revert "[cp] Enable MSP patching"
    
    This reverts commit ae17170cf3edb45fd2e270e7be83d06b91df0d9e.
    Reason for revert: recent upgrades to OpenSSL and Python changed DLL file 
names,
    and that is not compatible with MSP patching.
    
    Change-Id: Iab962a1d6e391b92ee0934a5a6a75b0a483234ba

diff --git a/.gitignore b/.gitignore
index bffebfaa22de..9dad1d4b26e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,7 +63,6 @@
 /README
 /AUTHORS
 /MAINTAINERS
-/setup_native/source/packinfo/finals_instsetoo.txt
 
 # make id
 /ID
diff --git a/configure.ac b/configure.ac
index 19e6dc321342..ef7b8aecc51e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3387,10 +3387,10 @@ if test "$_os" = "WINNT"; then
         BITNESS_OVERRIDE=64
     fi
 fi
-AC_SUBST(WINDOWS_SDK_ARCH)
-if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
+if test "$_os" = "iOS"; then
     cross_compiling="yes"
 fi
+
 if test "$cross_compiling" = "yes"; then
     export CROSS_COMPILING=TRUE
 else
@@ -4877,7 +4877,6 @@ if test "$cross_compiling" = "yes"; then
         bin/odfvalidator.sh.in \
         bin/officeotron.sh.in \
         instsetoo_native/util/openoffice.lst.in \
-        setup_native/source/packinfo/finals_instsetoo.txt.in \
         config_host/*.in \
         sysui/desktop/macosx/Info.plist.in) \
     | (cd CONF-FOR-BUILD && tar xf -)
@@ -13119,7 +13118,6 @@ AC_CONFIG_FILES([config_host.mk
                  bin/odfvalidator.sh
                  bin/officeotron.sh
                  instsetoo_native/util/openoffice.lst
-                 setup_native/source/packinfo/finals_instsetoo.txt
                  sysui/desktop/macosx/Info.plist])
 AC_CONFIG_HEADERS([config_host/config_buildid.h])
 AC_CONFIG_HEADERS([config_host/config_clang.h])
diff --git a/instsetoo_native/util/openoffice.lst.in 
b/instsetoo_native/util/openoffice.lst.in
index 4b6191cba3a7..988218ff6992 100644
--- a/instsetoo_native/util/openoffice.lst.in
+++ b/instsetoo_native/util/openoffice.lst.in
@@ -27,7 +27,7 @@ Globals
             REGISTRYLAYERNAME Layers
             SERVICEPACK 1
             UPDATE_DATABASE 1
-            CREATE_MSP_INSTALLSET 1
+            CREATE_MSP_INSTALLSET 0
             UPDATE_DATABASE_LISTNAME finals_instsetoo.txt
             PACKAGEMAP package_names.txt,package_names_ext.txt
             WINDOWSPATCHLEVEL @LIBO_VERSION_PATCH@
diff --git a/setup_native/source/packinfo/finals_instsetoo.txt.in 
b/setup_native/source/packinfo/finals_instsetoo.txt
similarity index 82%
rename from setup_native/source/packinfo/finals_instsetoo.txt.in
rename to setup_native/source/packinfo/finals_instsetoo.txt
index 0804f7e49150..d5a68d369f7b 100644
--- a/setup_native/source/packinfo/finals_instsetoo.txt.in
+++ b/setup_native/source/packinfo/finals_instsetoo.txt
@@ -30,4 +30,3 @@
 # OpenOffice   pro             de                      
\\<server>\<path>\msi\OOO300_m6_native_packed-1_de.9352\openofficeorg30.msi
 # OpenOfficeLanguagePack       pro     es      
\\<server>\<path>\msi\OOO300_m6_native_packed-1_es.9352\openofficeorg30.msi
 # URE                  pro             en-US           
\\<server>\<path>\msi\OOO300_m6_native_packed-1_en-US.9352\ure14.msi
-CollaboraOffice                pro             
en-US,ar,as,ast,bg,bn-IN,br,ca,ca-valencia,cy,cs,da,de,el,en-GB,es,et,eu,fi,fr,ga,gd,gl,gu,he,hi,hr,hu,id,is,it,ja,km,kn,ko,lt,lv,ml,mr,nb,nl,nn,oc,or,pa-IN,pl,pt,pt-BR,ro,ru,sk,sl,sr,sr-Latn,sv,ta,te,tr,uk,vi,zh-CN,zh-TW
           
c:\lo\src\cp-6.4-2-@WINDOWS_SDK_ARCH@\Collabora_Office_6.4-2_Win_@[email protected]
diff --git a/solenv/bin/modules/installer/globals.pm 
b/solenv/bin/modules/installer/globals.pm
index 1938942b0a82..11442ef202a8 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -221,7 +221,7 @@ BEGIN
     $fix_number_of_cab_files = 1;
     $cabfilecompressionlevel = 21; # Using LZX compression, possible values 
are: 15 | 16 | ... | 21 (best compression)
     $number_of_cabfiles = 1;    # only for $fix_number_of_cab_files = 1
-    $include_cab_in_msi = 0;
+    $include_cab_in_msi = 1;
     $msidatabasename = "";
     $prepare_winpatch = 0;
     $previous_idt_dir = "";
diff --git a/solenv/bin/modules/installer/windows/admin.pm 
b/solenv/bin/modules/installer/windows/admin.pm
index 3dfba9e7a8de..f822afe7eaec 100644
--- a/solenv/bin/modules/installer/windows/admin.pm
+++ b/solenv/bin/modules/installer/windows/admin.pm
@@ -287,9 +287,8 @@ sub create_directory_structure
     {
         if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = 
$targetdir; }
     }
-    # FIXME why is this hack needed? ERROR: Did not find full directory path 
for dir: "SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"
+    # FIXME why is this hack needed? ERROR: Did not find full directory path 
for dir: "ystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"
     $fullpathhash{"SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"} 
= $targetdir . $installer::globals::separator . "System";
-    $fullpathhash{"SystemFolder_x86_VC.E281B893_10D7_34CE_BB0E_B69D88E154A5"} 
= $targetdir . $installer::globals::separator . "System";
     
$fullpathhash{"System64Folder_amd64_VC.AF4EABEE_4589_3789_BA0A_C83A71662E1D"} = 
$targetdir . $installer::globals::separator . "System64";
 
     return \%fullpathhash;
diff --git a/solenv/bin/modules/installer/windows/msp.pm 
b/solenv/bin/modules/installer/windows/msp.pm
index 3783634ff395..069b5dfeb0f6 100644
--- a/solenv/bin/modules/installer/windows/msp.pm
+++ b/solenv/bin/modules/installer/windows/msp.pm
@@ -288,7 +288,7 @@ sub set_mspfilename
 {
     my ($allvariables, $mspdir, $languagesarrayref) = @_;
 
-    my $databasename = $allvariables->{'ONEWORDPRODUCTNAME'} . "-" . 
$allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} 
. ".msp";
+    my $databasename = $allvariables->{'PRODUCTNAME'} . "-" . 
$allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} 
. ".msp";
 
     my $fullmspname = $mspdir . $installer::globals::separator . $databasename;
 
commit 908bc38d5e4cf6079fe22686eb7b6e12aa0381fc
Author:     Michael Stahl <[email protected]>
AuthorDate: Fri Dec 9 11:51:22 2022 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:05:33 2023 +0200

    python3: upgrade to release 3.8.16
    
    Fixes CVE-2022-37454 and a few other ones that look less relevant
    including CVE-2022-45061 and CVE-2015-20107.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143849
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 05f55b3898407828bb24347be56247f58803f7bb)
    
    Change-Id: I10fd254f7f0801d47119234bb3436874e98d8c91

diff --git a/configure.ac b/configure.ac
index 24abdc05d074..19e6dc321342 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8978,7 +8978,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.15
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.16
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index d7d7d4008079..cbdcccf7fb55 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
5114fc7918a2a5e20eb5aac696b30c36f412c6ef24b13f5c9eb9e056982d9550
-export PYTHON_TARBALL := Python-3.8.15.tar.xz
+export PYTHON_SHA256SUM := 
d85dbb3774132473d8081dcb158f34a10ccad7a90b96c7e50ea4bb61f5ce4562
+export PYTHON_TARBALL := Python-3.8.16.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
commit e5fb12545a502aa8990467217d66fc51272c8494
Author:     Taichi Haradaguchi <[email protected]>
AuthorDate: Mon Oct 24 00:52:04 2022 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:03:39 2023 +0200

    Python3: update to 3.8.15
    
    * Fixes CVE-2022-40674
    * Removed 0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 
as fixed upstream
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141691
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit ea5843b67f1c2006aa1f68f2d00a991e1d463262)
    
    Change-Id: I8e71f9a6b013ca4c45bf8774b284be98eee71bab

diff --git a/configure.ac b/configure.ac
index 8792306b2145..24abdc05d074 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8978,7 +8978,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.13
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.15
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index 74911444bf7e..d7d7d4008079 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
6f309077012040aa39fe8f0c61db8c0fa1c45136763299d375c9e5756f09cf57
-export PYTHON_TARBALL := Python-3.8.13.tar.xz
+export PYTHON_SHA256SUM := 
5114fc7918a2a5e20eb5aac696b30c36f412c6ef24b13f5c9eb9e056982d9550
+export PYTHON_TARBALL := Python-3.8.15.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
diff --git a/external/python3/i100492-freebsd.patch.1 
b/external/python3/i100492-freebsd.patch.1
index 074e5fc489f8..b2ca1ee7117f 100644
--- a/external/python3/i100492-freebsd.patch.1
+++ b/external/python3/i100492-freebsd.patch.1
@@ -2,7 +2,7 @@ FreeBSD porting fixes, patch by [email protected]
 
 --- Python-3.3.0/Python/thread_pthread.h       2012-11-28 09:00:41.097955124 
+0000
 +++ Python-3.3.0/Python/thread_pthread.h       2012-11-28 09:01:13.018329351 
+0000
-@@ -186,6 +189,9 @@
+@@ -238,6 +238,9 @@
  {
      pthread_t th;
      int status;
@@ -12,7 +12,7 @@ FreeBSD porting fixes, patch by [email protected]
  #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
      pthread_attr_t attrs;
  #endif
-@@ -214,6 +220,10 @@
+@@ -277,6 +280,10 @@
      callback->func = func;
      callback->arg = arg;
  
@@ -23,7 +23,7 @@ FreeBSD porting fixes, patch by [email protected]
      status = pthread_create(&th,
  #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
                               &attrs,
-@@ -225,6 +234,9 @@
+@@ -285,6 +292,9 @@
  #endif
                               pythread_wrapper, callback);
  
diff --git a/external/python3/internal-zlib.patch.0 
b/external/python3/internal-zlib.patch.0
index de68d9e7dec8..27bb737db0c7 100644
--- a/external/python3/internal-zlib.patch.0
+++ b/external/python3/internal-zlib.patch.0
@@ -19,7 +19,7 @@
  
 --- setup.py
 +++ setup.py
-@@ -1362,7 +1362,7 @@
+@@ -1483,7 +1483,7 @@
          #
          # You can upgrade zlib to version 1.1.4 yourself by going to
          # http://www.gzip.org/zlib/
@@ -28,7 +28,7 @@
          have_zlib = False
          if zlib_inc is not None:
              zlib_h = zlib_inc[0] + '/zlib.h'
-@@ -1379,13 +1379,13 @@
+@@ -1500,13 +1500,13 @@
                          version = line.split()[2]
                          break
              if version >= version_req:
@@ -44,7 +44,7 @@
                                         extra_link_args=zlib_extra_link_args))
                      have_zlib = True
                  else:
-@@ -1399,7 +1399,7 @@
+@@ -1520,7 +1520,7 @@
          # crc32 if we have it.  Otherwise binascii uses its own.
          if have_zlib:
              extra_compile_args = ['-DUSE_ZLIB_CRC32']
diff --git a/external/python3/python-3.3.0-darwin.patch.1 
b/external/python3/python-3.3.0-darwin.patch.1
index 27a355e2ad21..39d3c9180a19 100644
--- a/external/python3/python-3.3.0-darwin.patch.1
+++ b/external/python3/python-3.3.0-darwin.patch.1
@@ -5,7 +5,7 @@ LO needs to build both against MacOSX SDK and not produce 
universal binaries.
 diff -ru python3.orig/configure python3/configure
 --- python3.orig/configure     2015-07-26 17:36:11.808497783 +0200
 +++ python3/configure  2015-07-26 17:38:49.016508337 +0200
-@@ -6794,7 +6794,20 @@
+@@ -7385,7 +7385,20 @@
          then
              case "$UNIVERSAL_ARCHS" in
              32-bit)
@@ -30,7 +30,7 @@ diff -ru python3.orig/configure python3/configure
 diff -ru python3.orig/Mac/Makefile.in python3/Mac/Makefile.in
 --- python3.orig/Mac/Makefile.in       2015-07-05 18:50:07.000000000 +0200
 +++ python3/Mac/Makefile.in    2015-07-26 17:40:14.860514100 +0200
-@@ -43,7 +43,7 @@
+@@ -44,7 +44,7 @@
  INSTALL_SCRIPT= @INSTALL_SCRIPT@
  INSTALL_DATA=@INSTALL_DATA@
  LN=@LN@
diff --git a/external/python3/python-3.3.3-disable-obmalloc.patch.0 
b/external/python3/python-3.3.3-disable-obmalloc.patch.0
index 0963a5f1bb1d..c4a1dea61ecf 100644
--- a/external/python3/python-3.3.3-disable-obmalloc.patch.0
+++ b/external/python3/python-3.3.3-disable-obmalloc.patch.0
@@ -1,6 +1,6 @@
 --- Objects/obmalloc.c
 +++ Objects/obmalloc.c
-@@ -413,8 +413,8 @@
+@@ -712,8 +712,8 @@
  
  #ifdef WITH_PYMALLOC
  
@@ -10,7 +10,7 @@
  
  /* If we're using GCC, use __builtin_expect() to reduce overhead of
     the valgrind checks */
-@@ -1181,7 +1181,7 @@
+@@ -1430,7 +1430,7 @@
  
  #ifdef WITH_VALGRIND
      if (UNLIKELY(running_on_valgrind == -1)) {
diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 
b/external/python3/python-3.3.3-elf-rpath.patch.1
index 55546afd9844..a408858f5917 100644
--- a/external/python3/python-3.3.3-elf-rpath.patch.1
+++ b/external/python3/python-3.3.3-elf-rpath.patch.1
@@ -5,7 +5,7 @@ set RPATH (only to be used on ELF platforms)
 diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
 --- python3.orig/Makefile.pre.in       2015-07-26 20:29:07.126194320 +0200
 +++ python3/Makefile.pre.in    2015-07-26 20:37:21.814227530 +0200
-@@ -563,7 +563,7 @@
+@@ -566,7 +566,7 @@
  
  # Build the interpreter
  $(BUILDPYTHON):       Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
@@ -14,7 +14,7 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
  
  platform: $(BUILDPYTHON) pybuilddir.txt
        $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import 
get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' 
>platform
-@@ -625,7 +625,7 @@
+@@ -628,7 +628,7 @@
        fi
  
  libpython3.so:        libpython$(LDVERSION).so
diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 
b/external/python3/python-3.5.4-msvc-disable.patch.1
index 52c007d7d5b6..d5b4e3f6264b 100644
--- a/external/python3/python-3.5.4-msvc-disable.patch.1
+++ b/external/python3/python-3.5.4-msvc-disable.patch.1
@@ -3,7 +3,7 @@ Disable some stuff LO does not need, especially stuff with 
external dependencies
 diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
 --- python3.orig/PCbuild/pcbuild.sln   2017-08-10 00:04:44.359879894 +0200
 +++ python3/PCbuild/pcbuild.sln        2017-08-10 00:13:51.179873748 +0200
-@@ -12,8 +12,6 @@
+@@ -15,8 +15,6 @@
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", 
"pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
  EndProject
@@ -12,7 +12,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln 
python3/PCbuild/pcbuild.sln
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", 
"winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_decimal", 
"_decimal.vcxproj", "{0E9791DB-593A-465F-98BC-681011311617}"
-@@ -28,34 +26,20 @@
+@@ -31,34 +29,20 @@
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", 
"_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}"
  EndProject
@@ -47,7 +47,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln 
python3/PCbuild/pcbuild.sln
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", 
"_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", 
"python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}"
-@@ -75,8 +75,6 @@
+@@ -93,8 +77,6 @@
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", 
"_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}"
  EndProject
diff --git a/external/python3/python-3.5.tweak.strip.soabi.patch 
b/external/python3/python-3.5.tweak.strip.soabi.patch
index 48ac7f82f8be..4c2bb2bb9a29 100644
--- a/external/python3/python-3.5.tweak.strip.soabi.patch
+++ b/external/python3/python-3.5.tweak.strip.soabi.patch
@@ -1,7 +1,7 @@
 diff -ru python3.orig/configure python3/configure
 --- misc/python3.orig/configure        2015-07-26 21:14:31.127377193 +0200
 +++ misc/python3/configure     2015-07-26 21:21:34.975405648 +0200
-@@ -14388,7 +14388,7 @@
+@@ -15229,7 +15229,7 @@
  $as_echo "$ABIFLAGS" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
  $as_echo_n "checking SOABI... " >&6; }
diff --git a/external/python3/python-3.7.6-msvc-ssl.patch.1 
b/external/python3/python-3.7.6-msvc-ssl.patch.1
index 7c4a6ebc0fb7..17cc440f2204 100644
--- a/external/python3/python-3.7.6-msvc-ssl.patch.1
+++ b/external/python3/python-3.7.6-msvc-ssl.patch.1
@@ -2,7 +2,7 @@ No use for applink.c OPENSSL_Applink, everything is compiled 
with the same MSVC
 
 --- python3/PCbuild/_ssl.vcxproj.orig2 2019-12-23 15:54:19.254298900 +0100
 +++ python3/PCbuild/_ssl.vcxproj       2019-12-23 15:54:24.693251200 +0100
-@@ -67,9 +67,6 @@
+@@ -99,9 +99,6 @@
    </ItemDefinitionGroup>
    <ItemGroup>
      <ClCompile Include="..\Modules\_ssl.c" />
diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 9f458b1e0f95..d44fbe055c86 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -20,7 +20,7 @@
                This is clc or stc, together with the first byte of the jmp.  */
 --- Modules/posixmodule.c
 +++ Modules/posixmodule.c
-@@ -23,6 +23,9 @@
+@@ -13998,6 +13998,9 @@
  };
  
  static int
@@ -32,7 +32,7 @@
  #ifdef F_OK
 --- Objects/listobject.c
 +++ Objects/listobject.c
-@@ -548,7 +548,7 @@
+@@ -554,7 +554,7 @@
          dest[i] = v;
      }
      src = b->ob_item;
commit 8a77bb5c5d76bf7d000553c63ed0b76102d1a742
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Dec 1 14:44:01 2020 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:02:58 2023 +0200

    external/python3: Silence UBSan errors with --with-pydebug
    
    ...that happen when building ExternalProject_python3 itself after
    12142490cd43f8568ab29e0ddfa75b334d6d39d5 "Enable Python Py_DEBUG setting 
when
    built with --enable-dbgutil on Linux":
    
    For one, silence
    
    > Modules/posixmodule.c:14395:9: runtime error: left shift of 34 by 26 
places cannot be represented in type 'int'
    >  #0 in all_ins at 
workdir/UnpackedTarball/python3/./Modules/posixmodule.c:14395:9
    
    where at least my kernel-headers-5.9.9-200.fc33.x86_64
    /usr/include/linux/memfd.h has
    
    > #define MFD_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
    
    and /usr/include/asm-generic/hugetlb_encode.h has
    
    > #define HUGETLB_FLAG_ENCODE_16GB      (34 << HUGETLB_FLAG_ENCODE_SHIFT)
    
    For another (and as predicted in 29d47d22c43e6adc1850b7db5880028dcd07d1b3 
"Fix
    passing --disable-optimized into external/python3": "in a Linux UBsan build,
    making ExternalProject_python3 would have started to cause some 'applying 
zero
    offset to null pointer' failures, but which would have been easy to fix"),
    silence
    
    > Objects/listobject.c:551:24: runtime error: applying zero offset to null 
pointer
    >  #0 in list_concat at 
workdir/UnpackedTarball/python3/Objects/listobject.c:551:24
    
    Change-Id: I0523cd35e393000c8e67629a0522b2db1d8c16f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106984
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 1657639d5e405c6e1e988d51a1f267c378c74b53)

diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 938acc1f1725..9f458b1e0f95 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -18,3 +18,26 @@
  
        /*      Set the carry bit if the function uses any sse registers.
                This is clc or stc, together with the first byte of the jmp.  */
+--- Modules/posixmodule.c
++++ Modules/posixmodule.c
+@@ -23,6 +23,9 @@
+ };
+ 
+ static int
++#if defined __clang__
++__attribute__((no_sanitize("shift-base"))) // MFD_HUGE_16GB in 
/usr/include/linux/memfd.h
++#endif
+ all_ins(PyObject *m)
+ {
+ #ifdef F_OK
+--- Objects/listobject.c
++++ Objects/listobject.c
+@@ -548,7 +548,7 @@
+         dest[i] = v;
+     }
+     src = b->ob_item;
+-    dest = np->ob_item + Py_SIZE(a);
++    dest = Py_SIZE(a) == 0 ? np->ob_item : np->ob_item + Py_SIZE(a);
+     for (i = 0; i < Py_SIZE(b); i++) {
+         PyObject *v = src[i];
+         Py_INCREF(v);
commit 6a59482623c96cc5fea5e1b9ac41c43e81970396
Author:     Taichi Haradaguchi <[email protected]>
AuthorDate: Tue Sep 6 21:10:53 2022 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:02:53 2023 +0200

    python3: upgrade to release 3.8.13
    
    Remove some code in external/python3/darwin.patch.0 as it was fixed 
upstream(https://bugs.python.org/issue45405).
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139493
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit c8fd50f9ec02a131fd4c99e80f7252b49015653a)
    
    Change-Id: Ie6bfb2456f96a63adbf0dbcb9c902dc56f1151ee

diff --git a/configure.ac b/configure.ac
index 33d9fad086d8..8792306b2145 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8978,7 +8978,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.10
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.13
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index 1c27b239c6d3..74911444bf7e 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
6af24a66093dd840bcccf371d4044a3027e655cf24591ce26e48022bc79219d9
-export PYTHON_TARBALL := Python-3.8.10.tar.xz
+export PYTHON_SHA256SUM := 
6f309077012040aa39fe8f0c61db8c0fa1c45136763299d375c9e5756f09cf57
+export PYTHON_TARBALL := Python-3.8.13.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
commit 07f02624cf8df5b1b929b5f330c37c212390cdb4
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Thu Jun 24 08:26:33 2021 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:02:31 2023 +0200

    python3: update to 3.8.10
    
    So we don't build 3.8.8rc1 anymore. I didn't look into 3.9.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117757
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <[email protected]>
    (cherry picked from commit c22fc8e1f60bb98a87d22e7ff9bd3290dbb9fe02)
    
    Change-Id: Ife7d898c913b9b164168b0ef23a055deea55815f

diff --git a/configure.ac b/configure.ac
index a873681724b8..33d9fad086d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8978,7 +8978,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.8
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.10
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index d7f3d155e222..1c27b239c6d3 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
bd746ed1ad9ccfa9b2a8d13736a5c452025c3600913d000078e6ed1df3d767b6
-export PYTHON_TARBALL := Python-3.8.8rc1.tar.xz
+export PYTHON_SHA256SUM := 
6af24a66093dd840bcccf371d4044a3027e655cf24591ce26e48022bc79219d9
+export PYTHON_TARBALL := Python-3.8.10.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
commit 51af7c85e96f5b5d40508655b7954fc149ce4d99
Author:     Michael Stahl <[email protected]>
AuthorDate: Fri Feb 19 11:53:27 2021 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:01:59 2023 +0200

    python3: upgrade to release 3.8.8rc1
    
    Fixes CVE-2021-3177 plus these less important ones:
    CVE-2021-23336 CVE-2020-27619 CVE-2020-26116 CVE-2019-20907
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111208
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit a0c8dc42335764d07c16a017c6b00486ec17ae53)
    
    Change-Id: Idbe072a9db1faf8363b4f7795b9fde71c26969f0

diff --git a/configure.ac b/configure.ac
index 15ea25352455..a873681724b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8978,7 +8978,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=8
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.4
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.8
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index 44bcc08278e2..d7f3d155e222 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
5f41968a95afe9bc12192d7e6861aab31e80a46c46fa59d3d837def6a4cd4d37
-export PYTHON_TARBALL := Python-3.8.4.tar.xz
+export PYTHON_SHA256SUM := 
bd746ed1ad9ccfa9b2a8d13736a5c452025c3600913d000078e6ed1df3d767b6
+export PYTHON_TARBALL := Python-3.8.8rc1.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
commit d2715de5b0a3bd4b5eabe99d8cf1edf52ca5b65f
Author:     Jan-Marek Glogowski <[email protected]>
AuthorDate: Tue Jul 14 23:35:57 2020 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 19:01:29 2023 +0200

    python3: update to 3.8.4
    
    With all the prerequisites in place, LO can be updated to the
    current Python release. Interestingly I found that Cygwin always
    seems to use LC_COLLATE=C, probably because the default collation
    rules are missing.
    
    Then there are the changes introduced in "PEP 587 -- Python
    Initialization Configuration", which appearingly have modified the
    DLL search path behaviour on Windows, so the OpenSLL DLLs aren't
    found anymore in the program directory. As a workaround, the
    OpenSLL and libffi DLLs are now (also) installed into the Python
    lib dir on Windows.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98437
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <[email protected]>
    (cherry picked from commit b4dfba947768834ffecc09056992019878711c8b)
    
    Change-Id: Ib82f7b77213da9c525f8c79a13d128d9eec9ca64

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 3d5989944204..be8cde9442a9 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3199,7 +3199,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
 else
 $(call gb_LinkTarget_add_libs,$(1),\
        -L$(call gb_UnpackedTarball_get_dir,python3) \
-       -lpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
+       -lpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
 )
 endif
 
diff --git a/configure.ac b/configure.ac
index 1b29e4c0f74c..15ea25352455 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8977,8 +8977,8 @@ int main(int argc, char **argv) {
 internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
-    PYTHON_VERSION_MINOR=7
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.10
+    PYTHON_VERSION_MINOR=8
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.4
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index d2ec0f1611aa..44bcc08278e2 100644
--- a/download.lst
+++ b/download.lst
@@ -240,8 +240,8 @@ export POPPLER_SHA256SUM := 
d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb3
 export POPPLER_TARBALL := poppler-22.09.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
 export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
-export PYTHON_SHA256SUM := 
f8d82e7572c86ec9d55c8627aae5040124fd2203af400c383c821b980306ee6b
-export PYTHON_TARBALL := Python-3.7.10.tar.xz
+export PYTHON_SHA256SUM := 
5f41968a95afe9bc12192d7e6861aab31e80a46c46fa59d3d837def6a4cd4d37
+export PYTHON_TARBALL := Python-3.8.4.tar.xz
 export QRCODEGEN_SHA256SUM := 
fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
 export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
diff --git a/external/openssl/ExternalPackage_openssl.mk 
b/external/openssl/ExternalPackage_openssl.mk
index de77f53f33b9..d0c0dbaab975 100644
--- a/external/openssl/ExternalPackage_openssl.mk
+++ b/external/openssl/ExternalPackage_openssl.mk
@@ -16,6 +16,14 @@ $(eval $(call 
gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\
     libcrypto-1_1.dll \
     libssl-1_1.dll \
 ))
+ifneq ($(DISABLE_PYTHON),TRUE)
+ifneq ($(SYSTEM_PYTHON),TRUE)
+$(eval $(call 
gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib,
 \
+    libcrypto-1_1.dll \
+    libssl-1_1.dll \
+))
+endif
+endif
 endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/python3/ExternalPackage_python3.mk 
b/external/python3/ExternalPackage_python3.mk
index 02ba67ffe0dd..f7b8d67f25b2 100644
--- a/external/python3/ExternalPackage_python3.mk
+++ b/external/python3/ExternalPackage_python3.mk
@@ -17,25 +17,22 @@ python_arch_subdir=amd64/
 else
 python_arch_subdir=win32/
 endif
-$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/bin/python.exe,PCbuild/$(python_arch_subdir)python$(if
 $(MSVC_USE_DEBUG_RUNTIME),_d).exe))
+$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/bin/python.exe,PCbuild/$(python_arch_subdir)python$(if
 $(MSVC_USE_DEBUG_RUNTIME),_d).exe))
 $(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if
 
$(MSVC_USE_DEBUG_RUNTIME),_d).dll,PCbuild/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if
 $(MSVC_USE_DEBUG_RUNTIME),_d).dll))
 ifeq ($(MSVC_USE_DEBUG_RUNTIME),)
 $(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR).dll,PCbuild/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR).dll))
 endif
-$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib,\
+$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
        PCbuild/$(python_arch_subdir)_asyncio$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_ctypes$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
-       PCbuild/$(python_arch_subdir)_ctypes_test$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_decimal$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_elementtree$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_msi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd 
\
        PCbuild/$(python_arch_subdir)_multiprocessing$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+       PCbuild/$(python_arch_subdir)_overlapped$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_queue$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_socket$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)_ssl$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd 
\
-       PCbuild/$(python_arch_subdir)_testbuffer$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
-       PCbuild/$(python_arch_subdir)_testcapi$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
-       PCbuild/$(python_arch_subdir)_testconsole$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)pyexpat$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)select$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
        PCbuild/$(python_arch_subdir)unicodedata$(if 
$(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
@@ -44,8 +41,8 @@ $(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor
 else
 $(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python))
 $(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so))
-$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so))
-$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0-gdb.py,Tools/gdb/libpython.py))
+$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so))
+$(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-gdb.py,Tools/gdb/libpython.py))
 
 # Unfortunately the python build system does not allow to explicitly enable or
 # disable these, it just tries to build them and then prints which did not
@@ -55,71 +52,69 @@ $(eval $(call 
gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(
 # that may not be available on baseline systems.
 
 ifneq ($(OS),AIX)
-$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/lib-dynload,\
-       
LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_asyncio.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_blake2.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_contextvars.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       
LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       
LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_ctypes_test.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       
LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       
LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\
+       LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       
LO_lib/_asyncio.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_blake2.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       
LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so
 \
+       
LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_contextvars.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
        $(if $(DISABLE_OPENSSL),, \
-               
LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+               
LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
        ) \
-       
LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       LO_lib/_md5.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
-       
LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_queue.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_sha3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
+       
LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       
LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/_md5.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so
 \
+       
LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so
 \
+       
LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_posixshmem.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so
 \
+       
LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_queue.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       
LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/_sha3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so 
\
+       
LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
        $(if $(DISABLE_OPENSSL),, \
-               
LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+               
LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
        ) \
-       
LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_testbuffer.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_testcapi.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_testimportmultiple.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/_testmultiphase.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
 \
-       
LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       
LO_lib/_xxtestfuzz.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
-       LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so 
\
+       
LO_lib/_statistics.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       
LO_lib/_xxsubinterpreters.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so
 \
+       
LO_lib/_xxtestfuzz.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+       LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
 ))
 endif
 endif
@@ -139,8 +134,8 @@ endif
 # note: python configure overrides config.guess with something that doesn't
 # put -pc in its linux platform triplets, so filter that...
 ifneq ($(OS),WNT)
-$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib,\
-       LO_lib/_sysconfigdata_m_$(python3_MACHDEP)_$(subst i686,i386,$(subst 
-pc,,$(HOST_PLATFORM))).py \
+$(eval $(call 
gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
+       LO_lib/_sysconfigdata__$(python3_MACHDEP)_$(subst i686,i386,$(subst 
-pc,,$(HOST_PLATFORM))).py \
 ))
 endif
 
@@ -150,8 +145,12 @@ endif
 # idlelib, tkinter, turtledemo - need Tk to build the C module
 # test - probably unnecessary? was explicitly removed #i116738#
 # venv - why would we need virtual environments
+#
+# These lists are now sorted with "LC_COLLATE=C sort", by using
+#   find Lib/ -name "*.py" | sort | sed -e 's/^/\t/' -e 's/$/ \\/'
+#
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
        LICENSE \
        Lib/__future__.py \
        Lib/__phello__.foo.py \
@@ -162,6 +161,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/_dummy_thread.py \
        Lib/_markupbase.py \
        Lib/_osx_support.py \
+       Lib/_py_abc.py \
        Lib/_pydecimal.py \
        Lib/_pyio.py \
        Lib/_sitebuiltins.py \
@@ -180,6 +180,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/binhex.py \
        Lib/bisect.py \
        Lib/bz2.py \
+       Lib/cProfile.py \
        Lib/calendar.py \
        Lib/cgi.py \
        Lib/cgitb.py \
@@ -195,7 +196,6 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/contextvars.py \
        Lib/copy.py \
        Lib/copyreg.py \
-       Lib/cProfile.py \
        Lib/crypt.py \
        Lib/csv.py \
        Lib/dataclasses.py \
@@ -232,7 +232,6 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/linecache.py \
        Lib/locale.py \
        Lib/lzma.py \
-       Lib/macpath.py \
        Lib/mailbox.py \
        Lib/mailcap.py \
        Lib/mimetypes.py \
@@ -260,21 +259,20 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/profile.py \
        Lib/pstats.py \
        Lib/pty.py \
-       Lib/pyclbr.py \
-       Lib/_py_abc.py \
        Lib/py_compile.py \
+       Lib/pyclbr.py \
        Lib/pydoc.py \
        Lib/queue.py \
        Lib/quopri.py \
        Lib/random.py \
-       Lib/reprlib.py \
        Lib/re.py \
+       Lib/reprlib.py \
        Lib/rlcompleter.py \
        Lib/runpy.py \
        Lib/sched.py \
        Lib/secrets.py \
-       Lib/shelve.py \
        Lib/selectors.py \
+       Lib/shelve.py \
        Lib/shlex.py \
        Lib/shutil.py \
        Lib/signal.py \
@@ -288,10 +286,10 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/sre_constants.py \
        Lib/sre_parse.py \
        Lib/ssl.py \
-       Lib/statistics.py \
        Lib/stat.py \
-       Lib/stringprep.py \
+       Lib/statistics.py \
        Lib/string.py \
+       Lib/stringprep.py \
        Lib/struct.py \
        Lib/subprocess.py \
        Lib/sunau.py \
@@ -306,10 +304,11 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/this.py \
        Lib/threading.py \
        Lib/timeit.py \
-       Lib/tokenize.py \
        Lib/token.py \
-       Lib/traceback.py \
+       Lib/tokenize.py \
        Lib/trace.py \
+       Lib/traceback.py \
+       Lib/tracemalloc.py \
        Lib/tty.py \
        Lib/turtle.py \
        Lib/types.py \
@@ -321,33 +320,60 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/weakref.py \
        Lib/webbrowser.py \
        Lib/xdrlib.py \
+       Lib/zipapp.py \
        Lib/zipfile.py \
+       Lib/zipimport.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/asyncio,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/asyncio,\
+       Lib/asyncio/__init__.py \
+       Lib/asyncio/__main__.py \
+       Lib/asyncio/base_events.py \
        Lib/asyncio/base_futures.py \
+       Lib/asyncio/base_subprocess.py \
        Lib/asyncio/base_tasks.py \
+       Lib/asyncio/constants.py \
+       Lib/asyncio/coroutines.py \
+       Lib/asyncio/events.py \
+       Lib/asyncio/exceptions.py \
        Lib/asyncio/format_helpers.py \
+       Lib/asyncio/futures.py \
+       Lib/asyncio/locks.py \
+       Lib/asyncio/log.py \
+       Lib/asyncio/proactor_events.py \
+       Lib/asyncio/protocols.py \
+       Lib/asyncio/queues.py \
        Lib/asyncio/runners.py \
-))
-
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/collections,\
+       Lib/asyncio/selector_events.py \
+       Lib/asyncio/sslproto.py \
+       Lib/asyncio/staggered.py \
+       Lib/asyncio/streams.py \
+       Lib/asyncio/subprocess.py \
+       Lib/asyncio/tasks.py \
+       Lib/asyncio/transports.py \
+       Lib/asyncio/trsock.py \
+       Lib/asyncio/unix_events.py \
+       Lib/asyncio/windows_events.py \
+       Lib/asyncio/windows_utils.py \
+))
+
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/collections,\
        Lib/collections/__init__.py \
        Lib/collections/abc.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/concurrent,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/concurrent,\
        Lib/concurrent/__init__.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/concurrent/futures,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/concurrent/futures,\
        Lib/concurrent/futures/__init__.py \
        Lib/concurrent/futures/_base.py \
        Lib/concurrent/futures/process.py \
        Lib/concurrent/futures/thread.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/ctypes,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ctypes,\
        Lib/ctypes/__init__.py \
        Lib/ctypes/_aix.py \
        Lib/ctypes/_endian.py \
@@ -355,7 +381,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/ctypes/wintypes.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/ctypes/macholib,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ctypes/macholib,\
        Lib/ctypes/macholib/README.ctypes \
        Lib/ctypes/macholib/fetch_macholib \
        Lib/ctypes/macholib/fetch_macholib.bat \
@@ -365,7 +391,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/ctypes/macholib/framework.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/distutils,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils,\
        Lib/distutils/README \
        Lib/distutils/__init__.py \
        Lib/distutils/_msvccompiler.py \
@@ -383,8 +409,8 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/distutils/errors.py \
        Lib/distutils/extension.py \
        Lib/distutils/fancy_getopt.py \
-       Lib/distutils/filelist.py \
        Lib/distutils/file_util.py \
+       Lib/distutils/filelist.py \
        Lib/distutils/log.py \
        Lib/distutils/msvc9compiler.py \
        Lib/distutils/msvccompiler.py \
@@ -393,47 +419,47 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/distutils/text_file.py \
        Lib/distutils/unixccompiler.py \
        Lib/distutils/util.py \
-       Lib/distutils/versionpredicate.py \
        Lib/distutils/version.py \
+       Lib/distutils/versionpredicate.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/distutils/command,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils/command,\
        Lib/distutils/command/__init__.py \
+       Lib/distutils/command/bdist.py \
        Lib/distutils/command/bdist_dumb.py \
        Lib/distutils/command/bdist_msi.py \
-       Lib/distutils/command/bdist.py \
        Lib/distutils/command/bdist_rpm.py \
        Lib/distutils/command/bdist_wininst.py \
+       Lib/distutils/command/build.py \
        Lib/distutils/command/build_clib.py \
        Lib/distutils/command/build_ext.py \
-       Lib/distutils/command/build.py \
        Lib/distutils/command/build_py.py \
        Lib/distutils/command/build_scripts.py \
        Lib/distutils/command/check.py \
        Lib/distutils/command/clean.py \
        Lib/distutils/command/command_template \
        Lib/distutils/command/config.py \
+       Lib/distutils/command/install.py \
        Lib/distutils/command/install_data.py \
        Lib/distutils/command/install_egg_info.py \
        Lib/distutils/command/install_headers.py \
        Lib/distutils/command/install_lib.py \
-       Lib/distutils/command/install.py \
        Lib/distutils/command/install_scripts.py \
        Lib/distutils/command/register.py \
        Lib/distutils/command/sdist.py \
        Lib/distutils/command/upload.py \
-       Lib/distutils/command/wininst-10.0-amd64.exe \
        Lib/distutils/command/wininst-10.0.exe \
-       Lib/distutils/command/wininst-14.0-amd64.exe \
+       Lib/distutils/command/wininst-10.0-amd64.exe \
        Lib/distutils/command/wininst-14.0.exe \
+       Lib/distutils/command/wininst-14.0-amd64.exe \
        Lib/distutils/command/wininst-6.0.exe \
        Lib/distutils/command/wininst-7.1.exe \
        Lib/distutils/command/wininst-8.0.exe \
-       Lib/distutils/command/wininst-9.0-amd64.exe \
        Lib/distutils/command/wininst-9.0.exe \
+       Lib/distutils/command/wininst-9.0-amd64.exe \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/email,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email,\
        Lib/email/__init__.py \
        Lib/email/_encoded_words.py \
        Lib/email/_header_value_parser.py \
@@ -457,7 +483,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/email/utils.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/email/mime,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email/mime,\
        Lib/email/mime/__init__.py \
        Lib/email/mime/application.py \
        Lib/email/mime/audio.py \
@@ -469,13 +495,13 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/email/mime/text.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/encodings,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/encodings,\
        Lib/encodings/__init__.py \
        Lib/encodings/aliases.py \
        Lib/encodings/ascii.py \
        Lib/encodings/base64_codec.py \
-       Lib/encodings/big5hkscs.py \
        Lib/encodings/big5.py \
+       Lib/encodings/big5hkscs.py \
        Lib/encodings/bz2_codec.py \
        Lib/encodings/charmap.py \
        Lib/encodings/cp037.py \
@@ -492,10 +518,10 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/encodings/cp1256.py \
        Lib/encodings/cp1257.py \
        Lib/encodings/cp1258.py \
+       Lib/encodings/cp273.py \
        Lib/encodings/cp424.py \
        Lib/encodings/cp437.py \
        Lib/encodings/cp500.py \
-       Lib/encodings/cp65001.py \
        Lib/encodings/cp720.py \
        Lib/encodings/cp737.py \
        Lib/encodings/cp775.py \
@@ -529,20 +555,20 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/encodings/hp_roman8.py \
        Lib/encodings/hz.py \
        Lib/encodings/idna.py \
+       Lib/encodings/iso2022_jp.py \
        Lib/encodings/iso2022_jp_1.py \
-       Lib/encodings/iso2022_jp_2004.py \
        Lib/encodings/iso2022_jp_2.py \
+       Lib/encodings/iso2022_jp_2004.py \
        Lib/encodings/iso2022_jp_3.py \
        Lib/encodings/iso2022_jp_ext.py \
-       Lib/encodings/iso2022_jp.py \
        Lib/encodings/iso2022_kr.py \
+       Lib/encodings/iso8859_1.py \
        Lib/encodings/iso8859_10.py \
        Lib/encodings/iso8859_11.py \
        Lib/encodings/iso8859_13.py \
        Lib/encodings/iso8859_14.py \
        Lib/encodings/iso8859_15.py \
        Lib/encodings/iso8859_16.py \
-       Lib/encodings/iso8859_1.py \
        Lib/encodings/iso8859_2.py \
        Lib/encodings/iso8859_3.py \
        Lib/encodings/iso8859_4.py \
@@ -565,8 +591,8 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/encodings/mac_greek.py \
        Lib/encodings/mac_iceland.py \
        Lib/encodings/mac_latin2.py \
-       Lib/encodings/mac_romanian.py \
        Lib/encodings/mac_roman.py \
+       Lib/encodings/mac_romanian.py \
        Lib/encodings/mac_turkish.py \
        Lib/encodings/mbcs.py \
        Lib/encodings/oem.py \
@@ -576,19 +602,18 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/encodings/quopri_codec.py \
        Lib/encodings/raw_unicode_escape.py \
        Lib/encodings/rot_13.py \
-       Lib/encodings/shift_jis_2004.py \
        Lib/encodings/shift_jis.py \
+       Lib/encodings/shift_jis_2004.py \
        Lib/encodings/shift_jisx0213.py \
        Lib/encodings/tis_620.py \
        Lib/encodings/undefined.py \
        Lib/encodings/unicode_escape.py \
-       Lib/encodings/unicode_internal.py \
+       Lib/encodings/utf_16.py \
        Lib/encodings/utf_16_be.py \
        Lib/encodings/utf_16_le.py \
-       Lib/encodings/utf_16.py \
+       Lib/encodings/utf_32.py \
        Lib/encodings/utf_32_be.py \
        Lib/encodings/utf_32_le.py \
-       Lib/encodings/utf_32.py \
        Lib/encodings/utf_7.py \
        Lib/encodings/utf_8.py \
        Lib/encodings/utf_8_sig.py \
@@ -596,13 +621,13 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/encodings/zlib_codec.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/html,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/html,\
        Lib/html/__init__.py \
        Lib/html/entities.py \
        Lib/html/parser.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/http,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/http,\
        Lib/http/__init__.py \
        Lib/http/client.py \
        Lib/http/cookiejar.py \
@@ -610,17 +635,18 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/http/server.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/importlib,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib,\
        Lib/importlib/__init__.py \
        Lib/importlib/_bootstrap.py \
        Lib/importlib/_bootstrap_external.py \
        Lib/importlib/abc.py \
        Lib/importlib/machinery.py \
+       Lib/importlib/metadata.py \
        Lib/importlib/resources.py \
        Lib/importlib/util.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/json,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/json,\
        Lib/json/__init__.py \
        Lib/json/decoder.py \
        Lib/json/encoder.py \
@@ -628,7 +654,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/json/tool.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/lib2to3,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib2to3,\
        Lib/lib2to3/__init__.py \
        Lib/lib2to3/__main__.py \
        Lib/lib2to3/Grammar.txt \
@@ -644,7 +670,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/lib2to3/refactor.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/lib2to3/fixes,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib2to3/fixes,\
        Lib/lib2to3/fixes/__init__.py \
        Lib/lib2to3/fixes/fix_apply.py \
        Lib/lib2to3/fixes/fix_asserts.py \
@@ -652,8 +678,8 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/lib2to3/fixes/fix_buffer.py \
        Lib/lib2to3/fixes/fix_dict.py \
        Lib/lib2to3/fixes/fix_except.py \
-       Lib/lib2to3/fixes/fix_execfile.py \
        Lib/lib2to3/fixes/fix_exec.py \
+       Lib/lib2to3/fixes/fix_execfile.py \
        Lib/lib2to3/fixes/fix_exitfunc.py \
        Lib/lib2to3/fixes/fix_filter.py \
        Lib/lib2to3/fixes/fix_funcattrs.py \
@@ -662,13 +688,13 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/lib2to3/fixes/fix_has_key.py \
        Lib/lib2to3/fixes/fix_idioms.py \
        Lib/lib2to3/fixes/fix_import.py \
-       Lib/lib2to3/fixes/fix_imports2.py \
        Lib/lib2to3/fixes/fix_imports.py \
+       Lib/lib2to3/fixes/fix_imports2.py \
        Lib/lib2to3/fixes/fix_input.py \
        Lib/lib2to3/fixes/fix_intern.py \
        Lib/lib2to3/fixes/fix_isinstance.py \
-       Lib/lib2to3/fixes/fix_itertools_imports.py \
        Lib/lib2to3/fixes/fix_itertools.py \
+       Lib/lib2to3/fixes/fix_itertools_imports.py \
        Lib/lib2to3/fixes/fix_long.py \
        Lib/lib2to3/fixes/fix_map.py \
        Lib/lib2to3/fixes/fix_metaclass.py \
@@ -700,7 +726,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/lib2to3/fixes/fix_zip.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/pgen2,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/pgen2,\
        Lib/lib2to3/pgen2/__init__.py \
        Lib/lib2to3/pgen2/conv.py \
        Lib/lib2to3/pgen2/driver.py \
@@ -708,23 +734,35 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/lib2to3/pgen2/literals.py \
        Lib/lib2to3/pgen2/parse.py \
        Lib/lib2to3/pgen2/pgen.py \
-       Lib/lib2to3/pgen2/tokenize.py \
        Lib/lib2to3/pgen2/token.py \
+       Lib/lib2to3/pgen2/tokenize.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/logging,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/logging,\
        Lib/logging/__init__.py \
        Lib/logging/config.py \
        Lib/logging/handlers.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/multiprocessing,\
+ifeq (WNT,$(OS))
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/msilib,\
+       Lib/msilib/__init__.py \
+       Lib/msilib/schema.py \
+       Lib/msilib/sequence.py \
+       Lib/msilib/text.py \
+))
+endif
+
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing,\
        Lib/multiprocessing/__init__.py \
        Lib/multiprocessing/connection.py \
        Lib/multiprocessing/context.py \
+       Lib/multiprocessing/dummy/__init__.py \
+       Lib/multiprocessing/dummy/connection.py \
        Lib/multiprocessing/forkserver.py \
        Lib/multiprocessing/heap.py \
        Lib/multiprocessing/managers.py \
+       Lib/multiprocessing/pool.py \
        Lib/multiprocessing/popen_fork.py \
        Lib/multiprocessing/popen_forkserver.py \
        Lib/multiprocessing/popen_spawn_posix.py \
@@ -733,27 +771,29 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/multiprocessing/queues.py \
        Lib/multiprocessing/reduction.py \
        Lib/multiprocessing/resource_sharer.py \
-       Lib/multiprocessing/semaphore_tracker.py \
+       Lib/multiprocessing/resource_tracker.py \
+       Lib/multiprocessing/shared_memory.py \
        Lib/multiprocessing/sharedctypes.py \
        Lib/multiprocessing/spawn.py \
        Lib/multiprocessing/synchronize.py \
        Lib/multiprocessing/util.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/multiprocessing/dummy,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing/dummy,\
        Lib/multiprocessing/dummy/__init__.py \
        Lib/multiprocessing/dummy/connection.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/pydoc_data,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/pydoc_data,\
        Lib/pydoc_data/__init__.py \
        Lib/pydoc_data/_pydoc.css \
        Lib/pydoc_data/topics.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/unittest,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest,\
        Lib/unittest/__init__.py \
        Lib/unittest/__main__.py \
+       Lib/unittest/async_case.py \
        Lib/unittest/case.py \
        Lib/unittest/loader.py \
        Lib/unittest/main.py \
@@ -765,41 +805,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/unittest/util.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/unittest/test,\
-       Lib/unittest/test/__init__.py \
-       Lib/unittest/test/__main__.py \
-       Lib/unittest/test/_test_warnings.py \
-       Lib/unittest/test/dummy.py \
-       Lib/unittest/test/support.py \
-       Lib/unittest/test/test_assertions.py \
-       Lib/unittest/test/test_break.py \
-       Lib/unittest/test/test_case.py \
-       Lib/unittest/test/test_discovery.py \
-       Lib/unittest/test/test_functiontestcase.py \
-       Lib/unittest/test/test_loader.py \
-       Lib/unittest/test/test_program.py \
-       Lib/unittest/test/test_result.py \
-       Lib/unittest/test/test_runner.py \
-       Lib/unittest/test/test_setups.py \
-       Lib/unittest/test/test_skipping.py \
-       Lib/unittest/test/test_suite.py \
-))
-
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/unittest/test/testmock,\
-       Lib/unittest/test/testmock/__init__.py \
-       Lib/unittest/test/testmock/__main__.py \
-       Lib/unittest/test/testmock/support.py \
-       Lib/unittest/test/testmock/testcallable.py \
-       Lib/unittest/test/testmock/testhelpers.py \
-       Lib/unittest/test/testmock/testmagicmethods.py \
-       Lib/unittest/test/testmock/testmock.py \
-       Lib/unittest/test/testmock/testpatch.py \
-       Lib/unittest/test/testmock/testsealable.py \
-       Lib/unittest/test/testmock/testsentinel.py \
-       Lib/unittest/test/testmock/testwith.py \
-))
-
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/urllib,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/urllib,\
        Lib/urllib/__init__.py \
        Lib/urllib/error.py \
        Lib/urllib/parse.py \
@@ -808,7 +814,7 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/urllib/robotparser.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/wsgiref,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/wsgiref,\
        Lib/wsgiref/__init__.py \
        Lib/wsgiref/handlers.py \
        Lib/wsgiref/headers.py \
@@ -817,35 +823,35 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/wsgiref/validate.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xml,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml,\
        Lib/xml/__init__.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xml/dom,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/dom,\
        Lib/xml/dom/__init__.py \
-       Lib/xml/dom/NodeFilter.py \
        Lib/xml/dom/domreg.py \
        Lib/xml/dom/expatbuilder.py \
        Lib/xml/dom/minicompat.py \
        Lib/xml/dom/minidom.py \
+       Lib/xml/dom/NodeFilter.py \
        Lib/xml/dom/pulldom.py \
        Lib/xml/dom/xmlbuilder.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xml/etree,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/etree,\
        Lib/xml/etree/__init__.py \
+       Lib/xml/etree/cElementTree.py \
        Lib/xml/etree/ElementInclude.py \
        Lib/xml/etree/ElementPath.py \
        Lib/xml/etree/ElementTree.py \
-       Lib/xml/etree/cElementTree.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xml/parsers,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/parsers,\
        Lib/xml/parsers/__init__.py \
        Lib/xml/parsers/expat.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xml/sax,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/sax,\
        Lib/xml/sax/__init__.py \
        Lib/xml/sax/_exceptions.py \
        Lib/xml/sax/expatreader.py \
@@ -854,13 +860,13 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/xml/sax/xmlreader.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/xmlrpc,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xmlrpc,\
        Lib/xmlrpc/__init__.py \
        Lib/xmlrpc/client.py \
        Lib/xmlrpc/server.py \
 ))
 
-$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-3.7.7/lib/site-packages,\
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/site-packages,\
        Lib/site-packages/README.txt \
 ))
 
diff --git a/external/python3/ExternalProject_python3.mk 
b/external/python3/ExternalProject_python3.mk
index 015341f8450f..1ff06a2382ed 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -1,4 +1,4 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 
100 -*-
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
 #
 # This file is part of the LibreOffice project.
 #
@@ -11,7 +11,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,python3))
 
 $(eval $(call gb_ExternalProject_use_externals,python3,\
        expat \
-       $(if $(filter LINUX,$(OS)),libffi) \
+       $(if $(filter WNT LINUX,$(OS)),libffi) \
        openssl \
        zlib \
 ))
@@ -30,16 +30,24 @@ ifeq ($(OS),WNT)
 
 # TODO: using Debug configuration and related mangling of pyconfig.h
 
+python3_WIN_PLATFORM_MSBUILD := $(strip \
+       $(if $(filter INTEL,$(CPUNAME)),Win32) \
+       $(if $(filter X86_64,$(CPUNAME)),x64) \
+       $(if $(filter ARM64,$(CPUNAME)),arm64) \
+       )
+
 # at least for MSVC 2008 it is necessary to clear MAKEFLAGS because
 # nmake is invoked
 $(call gb_ExternalProject_get_state_target,python3,build) :
        $(call gb_ExternalProject_run,build,\
                MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build \
                        /p:Configuration=$(if 
$(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
-                       /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
+                       /p:Platform=$(python3_WIN_PLATFORM_MSBUILD) \
                        /p:opensslIncludeDir=$(call 
gb_UnpackedTarball_get_dir,openssl)/include \
                        /p:opensslOutDir=$(call 
gb_UnpackedTarball_get_dir,openssl) \
                        /p:zlibDir=$(call gb_UnpackedTarball_get_dir,zlib) \
+                       /p:libffiOutDir=$(call 
gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs \
+                       /p:libffiIncludeDir=$(call 
gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/include \
                        /maxcpucount \
                        $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 
/p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
                        $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 
/p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
@@ -128,14 +136,14 @@ python3_fw_prefix=$(call 
gb_UnpackedTarball_get_dir,python3)/python-inst/@______
 $(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call 
gb_ExternalProject_get_state_target,python3,build)
        $(call gb_Output_announce,python3 - remove reference to installroot 
from scripts,build,CUS,5)
        $(COMMAND_ECHO)for file in \
-                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3
 \
                        
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 \
+                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/easy_install-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 \
                        
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/idle$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 \
+                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR)
 \
+                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 \
                        
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 \
                        
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config
 \
-                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m-config
 \
-                       
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pyvenv-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
 ; do \
-       { rm "$$file" && $(gb_AWK) '\
+       ; do { rm "$$file" && $(gb_AWK) '\
                BEGIN {print "#!/bin/bash\n\
 origpath=$$(pwd)\n\
 bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\
@@ -157,37 +165,18 @@ $(call 
gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_
                @loader_path/../../../LibreOfficePython $$file ; done
        touch $@
 
-# also delete binaries that are symlinked in scp2
 $(call gb_ExternalProject_get_state_target,python3,executables) : $(call 
gb_ExternalProject_get_state_target,python3,build)
        cd 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin
 ; \
-       for file in python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
-                   python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m ; do 
\
        $(INSTALL_NAME_TOOL) -change \
                
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython
 \
-               @executable_path/../LibreOfficePython $$file ; done
+               @executable_path/../LibreOfficePython 
python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
        touch $@
 
-# Remove modules (both Python and binary bits) of questionable usefulness that 
we don't ship on
-# other platforms either. See the "packages not shipped" comment in 
ExternalPackage_python3.mk.
-
+# also delete binaries that are symlinked in scp2
 $(call gb_ExternalProject_get_state_target,python3,removeunnecessarystuff) : 
$(call gb_ExternalProject_get_state_target,python3,build)
        $(call gb_Output_announce,python3 - remove the stuff we don't need to 
ship,build,CUS,5)
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/dbm
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/sqlite3
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/curses
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/idlelib
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/tkinter
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/turtledemo
        rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/test
-       rm -rf 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/venv
-       # Then the binary libraries
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_dbm.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_sqlite3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses_panel.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_idlelib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_tkinter.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
-       rm -f 
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_test*.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
+
 endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/python3/UnpackedTarball_python3.mk 
b/external/python3/UnpackedTarball_python3.mk
index e4063bed0696..26a6a419af79 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -21,7 +21,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
        external/python3/python-3.8-msvc-sdk.patch.1 \
        external/python3/python-3.7.6-msvc-ssl.patch.1 \
        external/python3/python-3.5.4-msvc-disable.patch.1 \
-       external/python3/python-3.3.0-clang.patch.1 \
        external/python3/ubsan.patch.0 \
        external/python3/python-3.5.tweak.strip.soabi.patch \
        external/python3/darwin.patch.0 \
diff --git a/external/python3/internal-zlib.patch.0 
b/external/python3/internal-zlib.patch.0
index abe2630bd2e7..de68d9e7dec8 100644
--- a/external/python3/internal-zlib.patch.0
+++ b/external/python3/internal-zlib.patch.0
@@ -23,7 +23,7 @@
          #
          # You can upgrade zlib to version 1.1.4 yourself by going to
          # http://www.gzip.org/zlib/
--        zlib_inc = find_file('zlib.h', [], inc_dirs)
+-        zlib_inc = find_file('zlib.h', [], self.inc_dirs)
 +        zlib_inc = [os.environ.get('ZLIB_INCDIR')]
          have_zlib = False
          if zlib_inc is not None:
@@ -32,16 +32,16 @@
                          version = line.split()[2]
                          break
              if version >= version_req:
--                if (self.compiler.find_library_file(lib_dirs, 'z')):
-+                if (self.compiler.find_library_file(lib_dirs, 'zlib')):
-                     if host_platform == "darwin":
+-                if (self.compiler.find_library_file(self.lib_dirs, 'z')):
++                if (self.compiler.find_library_file(self.lib_dirs, 'zlib')):
+                     if MACOS:
                          zlib_extra_link_args = ('-Wl,-search_paths_first',)
                      else:
                          zlib_extra_link_args = ()
-                     exts.append( Extension('zlib', ['zlibmodule.c'],
--                                           libraries = ['z'],
-+                                           libraries = ['zlib'],
-                                            extra_link_args = 
zlib_extra_link_args))
+                     self.add(Extension('zlib', ['zlibmodule.c'],
+-                                       libraries=['z'],
++                                       libraries=['zlib'],
+                                        extra_link_args=zlib_extra_link_args))
                      have_zlib = True
                  else:
 @@ -1399,7 +1399,7 @@
diff --git a/external/python3/python-3.3.0-clang.patch.1 
b/external/python3/python-3.3.0-clang.patch.1
deleted file mode 100644
index 9001110fbed4..000000000000
--- a/external/python3/python-3.3.0-clang.patch.1
+++ /dev/null
@@ -1,13 +0,0 @@
--*- Mode: diff -*-
-
---- python3/setup.py
-+++ python3/setup.py
-@@ -436,7 +436,7 @@
-             if ret >> 8 == 0:
-                 with open(tmpfile) as fp:
-                     for line in fp.readlines():
--                        if line.startswith("gcc version"):
-+                        if line.startswith("gcc version") or 
line.startswith("clang -cc1 version"):
-                             is_gcc = True
-                         elif line.startswith("#include <...>"):
-                             in_incdirs = True
diff --git a/external/python3/python-3.3.0-darwin.patch.1 
b/external/python3/python-3.3.0-darwin.patch.1
index 10a696aa6e93..27a355e2ad21 100644
--- a/external/python3/python-3.3.0-darwin.patch.1
+++ b/external/python3/python-3.3.0-darwin.patch.1
@@ -63,19 +63,3 @@ diff -ru python3.orig/Mac/Resources/framework/Info.plist.in 
python3/Mac/Resource
        <key>CFBundleGetInfoString</key>
        <string>Python Runtime and Library</string>
        <key>CFBundleIdentifier</key>
-diff -ru python3.orig/setup.py python3/setup.py
---- python3.orig/setup.py      2015-07-26 17:36:11.804497783 +0200
-+++ python3/setup.py   2015-07-26 17:39:48.599512337 +0200
-@@ -468,11 +468,11 @@
-         # Ensure that /usr/local is always used, but the local build
-         # directories (i.e. '.' and 'Include') must be first.  See issue
-         # 10520.
--        if not cross_compiling:
-+        if not cross_compiling and host_platform != 'darwin':
-             add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-         # only change this for cross builds for 3.3, issues on Mageia
--        if cross_compiling:
-+        if cross_compiling or host_platform == 'darwin':
-             self.add_gcc_paths()
-         self.add_multiarch_paths()
diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 
b/external/python3/python-3.3.3-elf-rpath.patch.1
index 0dfa16c8c247..55546afd9844 100644
--- a/external/python3/python-3.3.3-elf-rpath.patch.1
+++ b/external/python3/python-3.3.3-elf-rpath.patch.1
@@ -5,18 +5,16 @@ set RPATH (only to be used on ELF platforms)
 diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
 --- python3.orig/Makefile.pre.in       2015-07-26 20:29:07.126194320 +0200
 +++ python3/Makefile.pre.in    2015-07-26 20:37:21.814227530 +0200
-@@ -550,7 +550,7 @@
+@@ -563,7 +563,7 @@
  
  # Build the interpreter
  $(BUILDPYTHON):       Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
--      $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o 
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-+      $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o 
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -Wl,-rpath,\$$ORIGIN
+-      $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o 
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
++      $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o 
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN
  
  platform: $(BUILDPYTHON) pybuilddir.txt
        $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import 
get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' 
>platform
---- python3.orig/Makefile.pre.in       2015-07-05 18:50:07.000000000 +0200
-+++ python3/Makefile.pre.in    2015-07-26 17:34:00.386488960 +0200
-@@ -607,7 +607,7 @@
+@@ -625,7 +625,7 @@
        fi
  
  libpython3.so:        libpython$(LDVERSION).so
@@ -24,4 +22,4 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
 +      $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ -Wl,-rpath,\$$ORIGIN
  
  libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
-        $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined 
dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib 
-Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ 
$(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+        $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined 
dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib 
-Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ 
$(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 
b/external/python3/python-3.5.4-msvc-disable.patch.1
index 416ab2c7b15b..52c007d7d5b6 100644
--- a/external/python3/python-3.5.4-msvc-disable.patch.1
+++ b/external/python3/python-3.5.4-msvc-disable.patch.1
@@ -12,7 +12,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln 
python3/PCbuild/pcbuild.sln
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", 
"winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_decimal", 
"_decimal.vcxproj", "{0E9791DB-593A-465F-98BC-681011311617}"
-@@ -28,32 +26,18 @@
+@@ -28,34 +26,20 @@
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", 
"_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}"
  EndProject
@@ -22,6 +22,8 @@ diff -ru python3.orig/PCbuild/pcbuild.sln 
python3/PCbuild/pcbuild.sln
  EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", 
"_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"
  EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testinternalcapi", 
"_testinternalcapi.vcxproj", "{900342D7-516A-4469-B1AD-59A66E49A25F}"
+ EndProject
  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", 
"_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
  EndProject
 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", 
"_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
diff --git a/sfx2/UITest_sfx2_doc.mk b/sfx2/UITest_sfx2_doc.mk
index b5e3ef8cebde..61b0a1ca460c 100644
--- a/sfx2/UITest_sfx2_doc.mk
+++ b/sfx2/UITest_sfx2_doc.mk
@@ -7,14 +7,14 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_UITest_UITest,sfx2_doc))
+$(eval $(call gb_ExternalPackage_ExternalPackage,libffi,libffi))
 
-$(eval $(call gb_UITest_add_modules,sfx2_doc,$(SRCDIR)/sfx2/qa/uitest,\
-       doc/ \
-))
+$(eval $(call gb_ExternalPackage_use_external_project,libffi,libffi))
 
-$(eval $(call gb_UITest_set_defs,sfx2_doc, \
-    TDOC="$(SRCDIR)/sfx2/qa/uitest/doc/data" \
+ifeq ($(COM),MSC)
+$(eval $(call 
gb_ExternalPackage_add_files,libffi,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib,
 \
+    $(HOST_PLATFORM)/.libs/libffi-7.dll \
 ))
+endif
 
 # vim: set noet sw=4 ts=4:
commit 862fca25e274620d2051c269e93e7ad59b0f3a14
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed May 20 11:35:09 2020 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 18:59:35 2023 +0200

    fix some more python 3.8 deprecation warnings
    
    Change-Id: I8bdbf05f1357aea83a3cdda2f06d63c7d04de8f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94561
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit 0a3d414fb0ac27292320d99f802722a8a9670240)

diff --git a/pyuno/source/loader/pythonloader.py 
b/pyuno/source/loader/pythonloader.py
index 268cb168fe3c..0ecbf5d848a6 100644
--- a/pyuno/source/loader/pythonloader.py
+++ b/pyuno/source/loader/pythonloader.py
@@ -19,7 +19,7 @@
 import uno
 import unohelper
 import sys
-import imp
+import types
 import os
 from com.sun.star.uno import Exception,RuntimeException
 from com.sun.star.loader import XImplementationLoader
@@ -82,7 +82,7 @@ class Loader( XImplementationLoader, XServiceInfo, 
unohelper.Base ):
                 # did we load the module already ?
                 mod = g_loadedComponents.get( url )
                 if not mod:
-                    mod = imp.new_module("uno_component")
+                    mod = types.ModuleType("uno_component")
 
                     # check for pythonpath.zip beside .py files
                     checkForPythonPathBesideComponent( url[0:url.rfind('/')] )
commit a78c3973e17080187cff0c2c031715ebc6ba59fa
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu May 14 12:56:56 2020 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Apr 1 18:59:35 2023 +0200

    fix python 3.8 deprecation warnings
    
    the logo changes were caused by
    
    > Support of nested sets and set operations as in Unicode Technical Standard
    > #18 might be added in the future. This would change the syntax, so to 
facilitate
    > this change a FutureWarning will be raised in ambiguous cases for the 
time being.
    > That includes sets starting with a literal '[' or containing literal 
character
    > sequences '--', '&&', '~~', and '||'.
    > To avoid a warning escape them with a backslash.
    
    Change-Id: I4d48be3df2eaadf03a9d1f5750c0c94b3abbf674
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94191
    Tested-by: Noel Grandin <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit b5fcdc3c07efb2c1175503b9c70e6d7336aa1452)

diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index 2fa16ed81822..57ce696d288e 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -401,7 +401,7 @@ def __translate__(arg = None):
     text = selection.getString()
     # remove comments and strings
     text = re.sub(r"[ ]*;[^\n]*", "", 
re.sub(r"['„“‘«»「][^\n'”“‘’«»」]*['”“‘’«»」]", "", re.sub(r"^[ \t]*[;#][^\n]*", 
"", text)))
-    text = " ".join(set(re.findall("(?u)\w+", text)) - 
set(re.findall("(?u)\w*\d+\w*", text))).lower()  # only words
+    text = " ".join(set(re.findall(r"(?u)\w+", text)) - 
set(re.findall(r"(?u)\w*\d+\w*", text))).lower()  # only words
     ctx = uno.getComponentContext()
     guess = 
ctx.ServiceManager.createInstanceWithContext("com.sun.star.linguistic2.LanguageGuessing",
 ctx)
     guess.disableLanguages(guess.getEnabledLanguages())
@@ -424,7 +424,7 @@ def __translate__(arg = None):
 
     text = re.sub(r"^(([ \t]*[;#][^\n]*))", __encodecomment__, text)
     text = re.sub("(?u)([%s])((?:[^\n%s]|\\\\[%s])*)(?<!\\\\)[%s]" % (lq, rq, 
rq, rq), __encodestring__, selection.getString())
-    text = re.sub('(?u)(?<![0-9])(")(~?\w*)', __encodestring__, text)
+    text = re.sub(r'(?u)(?<![0-9])(")(~?\w*)', __encodestring__, text)
     text = re.sub(r";(([^\n]*))", __encodecomment__, text)
 
     # translate the program to the language of the document FIXME space/tab
@@ -433,12 +433,12 @@ def __translate__(arg = None):
     in2 = __l12n__(_.lng)['IN'].split("|")[0].upper()
     if in1[0] == '-' and in2[0] != '-': # "for x y-in" -> "for x in y"
         exception += ['IN']
-        text = re.sub(r"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[[] 
|[[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text)
-        text = re.sub(r"(?ui)(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" 
% in2, text)
+        text = re.sub(r"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[\[] 
|[\[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text)
+        text = re.sub(r"(?ui)(:?\b\w+|[\[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" 
% in2, text)
     elif in1[0] != '-' and in2[0] == '-': # "for x in y" -> "for x y-in"
         exception += ['IN']
-        text = re.sub(r"(?ui)(?<=\n)((?:%s)\b +:?\w+) +(?:%s) +([^\n]+?) 
+(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 \\2%s " % in2, text)
-        text = re.sub(r"(?ui)(?<!:)\b(?:%s) +(:?\b\w+|[[][^[\n]*])\b" % in1, 
"\\1%s" % in2, text)
+        text = re.sub(r"(?ui)(?<=\n)((?:%s)\b +:?\w+) +(?:%s) +([^\n]+?) 
+(?=[\[] |[\[]\n)" % (lang['FOR'], in1), "\\1 \\2%s " % in2, text)
+        text = re.sub(r"(?ui)(?<!:)\b(?:%s) +(:?\b\w+|[\[][^[\n]*])\b" % in1, 
"\\1%s" % in2, text)
     for i in set(lang) - set(exception):
         text = re.sub(r'(?ui)(?<!:)\b(%s)\b' % lang[i], 
__l12n__(_.lng)[i].split("|")[0].upper(), text)
     text = re.sub(r"(?<=\d)[%s](?=\d)" % lang['DECIMAL'], 
__l12n__(_.lng)['DECIMAL'], text)
@@ -554,9 +554,9 @@ class LogoProgram(threading.Thread):
                         MessageBox(parent, __l12n__(_.lng)['ERR_ARGUMENTS'] % 
(__locname__('REPEAT'), 1, 0), caption, "errorbox")
                     else:
                         MessageBox(parent, __l12n__(_.lng)['ERR_NAME'] % \
-                            to_unicode(re.search("(?<=name ')[\w_]*(?=')", 
message).group(0)), caption, "errorbox")
+                            to_unicode(re.search(r"(?<=name ')[\w_]*(?=')", 
message).group(0)), caption, "errorbox")
                 elif "TypeError" in message and "argument" in message and 
"given" in message:
-                    r = re.search("([\w_]*)[(][)][^\n]* (\w+) arguments? 
[(](\d+)", message) # XXX later: handle 'no arguments' + plural
+                    r = re.search(r"([\w_]*)[(][)][^\n]* (\w+) arguments? 
[(](\d+)", message) # XXX later: handle 'no arguments' + plural
                     MessageBox(parent, __l12n__(_.lng)['ERR_ARGUMENTS'] % 
(__locname__(r.group(1)), r.group(2), r.group(3)), caption, "errorbox")
                 else:
                     origline = __compiled__.split("\n")[line-1]
@@ -1541,7 +1541,7 @@ def create_svg_animation(m):
 def create_valid_svg_file(filename):
     with open(filename, "r") as f:
         s = f.read()
-    s = re.sub('(?s)(<g\\sid="[^"]*)\(([^"]*)\)', '\\1\\2', s) # bad "(", ")" 
in xml:id
+    s = re.sub(r'(?s)(<g\sid="[^"]*)\(([^"]*)\)', '\\1\\2', s) # bad "(", ")" 
in xml:id
     s = re.sub('(?s)<g\\sooo:[^>]*>', '', s) # remove non standard attributes
     s = re.sub('(?s)<defs class="EmbeddedBulletChars">.*(?=<defs 
class="TextEmbeddedBitmaps")', '', s) # remove unused parts
     s = re.sub('(?s)(<path stroke-width="[^"]*"[^<]*)stroke-width="[^"]*"', 
'\\1', s) # double stroke-width
@@ -1676,7 +1676,7 @@ def __loadlang__(lang, a):
     [r"(?<!:)\b(?:%s)\b" % a['OUTPUT'], "\nreturn"],
     [r"\n(if|while|return) [^\n]*", lambda r: re.sub("(?<![=!<>])=(?!=)", 
"==", r.group(0))], # = -> ==, XXX x = y = 1?
     [r"(?<=\n)(for\b :?\w+) ([^\n]+)(?<=\w|]|}|\))(?=-|:)(?:%s)\b" % a['IN'], 
"\\1 in \\2"], # "for x y-in" -> "for x in y"
-    [r"(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> "x 
in y"
+    [r"(:?\b\w+|[\[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> 
"x in y"
     [r"(?<!:)\b(?:%s)\b" % a['IN'], "in"],
     [r"(?<!:)\b(?:%s)\b[ \t]+(:?\w+)\b(?! in\b)" % a['FOR'], "\nfor \\1 in"],
     [r"(?<=\n)__repeat__ :\n", "while True:\n"], # infinite loop
@@ -1755,7 +1755,7 @@ def __loadlang__(lang, a):
     [r"(?<!:)\b(?:%s)\b ?\(" % a['RESUB'], "re.sub('(?u)'+"],
     [r"(?<!:)\b(?:%s)\b ?\(" % a['REFINDALL'], "re.findall('(?u)'+"],
     [r"(?<!:)\b(?:%s)\b" % a['ANY'], "u'any'"],
-    [r"(?<!:)\b(?:%s) (\w+|[[][^\]]*])\b" % a['INPUT'], " Input(\\1)"],
+    [r"(?<!:)\b(?:%s) (\w+|[\[][^\]]*])\b" % a['INPUT'], " Input(\\1)"],
     [r"(?<!:)\b(?:%s)\b" % a['PRINT'], "\nPrint"],
     [r"(?<!:)\b(?:%s)\b" % a['TURNLEFT'], "\n)turnleft("],
     [r"\b([0-9]+([,.][0-9]+)?)(%s)\b" % a['PT'], "\\1"],
@@ -1904,7 +1904,7 @@ def __compil__(s):
     rq = '\'' + __l12n__(_.lng)['RIGHTSTRING'].replace("|", "")
     __strings__ = []
     s = re.sub("(?u)([%s])((?:[^\n%s]|\\\\[%s])*)(?<!\\\\)[%s]" % (lq, rq, rq, 
rq), __encodestring__, s)
-    s = re.sub('(?u)(?<![0-9])(")(~?\w*)', __encodestring__, s)
+    s = re.sub(r'(?u)(?<![0-9])(")(~?\w*)', __encodestring__, s)
 
     # remove extra spaces
     s = chsp.sub(" ", s)
@@ -1918,7 +1918,7 @@ def __compil__(s):
     # replace procedure names
     s = re.sub(r"(?i)^[ ]*(%s)[ ]+" % __l12n__(_.lng)['TO'], "__def__ ", s)
     s = re.sub(r"(?i)\n[ ]*(%s)[ ]+" % __l12n__(_.lng)['TO'], "\n__def__ ", s)
-    subnames = re.findall(u"(?iu)(?<=__def__ )\w+", s)
+    subnames = re.findall(r"(?iu)(?<=__def__ )\w+", s)
     globs = ""

... etc. - the rest is truncated

Reply via email to