diff options
Diffstat (limited to '')
20 files changed, 1635 insertions, 0 deletions
diff --git a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 new file mode 100644 index 000000000..489e5d0e8 --- /dev/null +++ b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 @@ -0,0 +1,59 @@ +From 582d188e6e3487180891f1fc457a80dec8be26a8 Mon Sep 17 00:00:00 2001 +From: Christian Heimes <christian@python.org> +Date: Mon, 24 Sep 2018 14:38:31 +0200 +Subject: [PATCH] [3.6] bpo-17239: Disable external entities in SAX parser + (GH-9217) (GH-9512) + +The SAX parser no longer processes general external entities by default +to increase security. Before, the parser created network connections +to fetch remote files or loaded local files from the file system for DTD +and entities. + +Signed-off-by: Christian Heimes <christian@python.org> + +https://bugs.python.org/issue17239. +(cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45) + +Co-authored-by: Christian Heimes <christian@python.org> + + + +https://bugs.python.org/issue17239 +--- + Doc/library/xml.dom.pulldom.rst | 14 +++++ + Doc/library/xml.rst | 6 +- + Doc/library/xml.sax.rst | 8 +++ + Doc/whatsnew/3.6.rst | 18 +++++- + Lib/test/test_pulldom.py | 7 +++ + Lib/test/test_sax.py | 60 ++++++++++++++++++- + Lib/test/test_xml_etree.py | 13 ++++ + Lib/xml/sax/expatreader.py | 2 +- + .../2018-09-11-18-30-55.bpo-17239.kOpwK2.rst | 3 + + 9 files changed, 125 insertions(+), 6 deletions(-) + create mode 100644 Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst + +diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py +index 421358fa5b..5066ffc2fa 100644 +--- a/Lib/xml/sax/expatreader.py ++++ b/Lib/xml/sax/expatreader.py +@@ -95,7 +95,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): + self._lex_handler_prop = None + self._parsing = 0 + self._entity_stack = [] +- self._external_ges = 1 ++ self._external_ges = 0 + self._interning = None + + # XMLReader methods +diff --git a/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst +new file mode 100644 +index 0000000000..8dd0fe8c1b +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst +@@ -0,0 +1,3 @@ ++The xml.sax and xml.dom.minidom parsers no longer processes external ++entities by default. External DTD and ENTITY declarations no longer ++load files or create network connections. +-- +2.20.1 + diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk new file mode 100644 index 000000000..4dfc3b196 --- /dev/null +++ b/external/python3/ExternalPackage_python3.mk @@ -0,0 +1,867 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,python3,python3)) + +$(eval $(call gb_ExternalPackage_use_external_project,python3,python3)) + +ifeq ($(OS),WNT) +ifeq ($(CPUNAME),X86_64) +python_arch_subdir=amd64/ +else +python_arch_subdir=win32/ +endif +$(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-$(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)_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 \ + PCbuild/$(python_arch_subdir)winsound$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ +)) +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)) + +# 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 +# build successfully without stopping; so the build will break on delivering if +# one of these failed to build. +# Obviously this list should not contain stuff with external dependencies +# that may not be available on baseline systems. + +ifneq ($(OS),AIX) +$(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)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 \ + $(if $(DISABLE_OPENSSL),, \ + LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.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 \ + $(if $(DISABLE_OPENSSL),, \ + LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.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 \ +)) +endif +endif + +# headers are not delivered, but used from unpacked dir Include/ +# (+ toplevel for pyconfig.h) + +ifeq ($(OS),LINUX) +python3_MACHDEP=linux +else +ifeq ($(OS),MACOSX) +python3_MACHDEP=darwin +endif +endif + +# that one is generated... +# 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-$(PYTHON_VERSION)/lib,\ + LO_lib/_sysconfigdata_m_$(python3_MACHDEP)_$(subst i686,i386,$(subst -pc,,$(HOST_PLATFORM))).py \ +)) +endif + +# packages not shipped: +# dbm, sqlite3 - need some database stuff +# curses - need curses to build the C module +# idlelib, tkinter, turtledemo - need Tk to build the C module +# test - probably unnecessary? was explicitly removed #i116738# +# venv - why would we need virtual environments + +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ + LICENSE \ + Lib/__future__.py \ + Lib/__phello__.foo.py \ + Lib/_bootlocale.py \ + Lib/_collections_abc.py \ + Lib/_compat_pickle.py \ + Lib/_compression.py \ + Lib/_dummy_thread.py \ + Lib/_markupbase.py \ + Lib/_osx_support.py \ + Lib/_pydecimal.py \ + Lib/_pyio.py \ + Lib/_sitebuiltins.py \ + Lib/_strptime.py \ + Lib/_threading_local.py \ + Lib/_weakrefset.py \ + Lib/abc.py \ + Lib/aifc.py \ + Lib/antigravity.py \ + Lib/argparse.py \ + Lib/ast.py \ + Lib/asynchat.py \ + Lib/asyncore.py \ + Lib/base64.py \ + Lib/bdb.py \ + Lib/binhex.py \ + Lib/bisect.py \ + Lib/bz2.py \ + Lib/calendar.py \ + Lib/cgi.py \ + Lib/cgitb.py \ + Lib/chunk.py \ + Lib/cmd.py \ + Lib/code.py \ + Lib/codecs.py \ + Lib/codeop.py \ + Lib/colorsys.py \ + Lib/compileall.py \ + Lib/configparser.py \ + Lib/contextlib.py \ + Lib/contextvars.py \ + Lib/copy.py \ + Lib/copyreg.py \ + Lib/cProfile.py \ + Lib/crypt.py \ + Lib/csv.py \ + Lib/dataclasses.py \ + Lib/datetime.py \ + Lib/decimal.py \ + Lib/difflib.py \ + Lib/dis.py \ + Lib/doctest.py \ + Lib/dummy_threading.py \ + Lib/enum.py \ + Lib/filecmp.py \ + Lib/fileinput.py \ + Lib/fnmatch.py \ + Lib/formatter.py \ + Lib/fractions.py \ + Lib/ftplib.py \ + Lib/functools.py \ + Lib/genericpath.py \ + Lib/getopt.py \ + Lib/getpass.py \ + Lib/gettext.py \ + Lib/glob.py \ + Lib/gzip.py \ + Lib/hashlib.py \ + Lib/heapq.py \ + Lib/hmac.py \ + Lib/imaplib.py \ + Lib/imghdr.py \ + Lib/imp.py \ + Lib/inspect.py \ + Lib/io.py \ + Lib/ipaddress.py \ + Lib/keyword.py \ + Lib/linecache.py \ + Lib/locale.py \ + Lib/lzma.py \ + Lib/macpath.py \ + Lib/mailbox.py \ + Lib/mailcap.py \ + Lib/mimetypes.py \ + Lib/modulefinder.py \ + Lib/netrc.py \ + Lib/nntplib.py \ + Lib/ntpath.py \ + Lib/nturl2path.py \ + Lib/numbers.py \ + Lib/opcode.py \ + Lib/operator.py \ + Lib/optparse.py \ + Lib/os.py \ + Lib/pathlib.py \ + Lib/pdb.py \ + Lib/pickle.py \ + Lib/pickletools.py \ + Lib/pipes.py \ + Lib/pkgutil.py \ + Lib/platform.py \ + Lib/plistlib.py \ + Lib/poplib.py \ + Lib/posixpath.py \ + Lib/pprint.py \ + Lib/profile.py \ + Lib/pstats.py \ + Lib/pty.py \ + Lib/pyclbr.py \ + Lib/_py_abc.py \ + Lib/py_compile.py \ + Lib/pydoc.py \ + Lib/queue.py \ + Lib/quopri.py \ + Lib/random.py \ + Lib/reprlib.py \ + Lib/re.py \ + Lib/rlcompleter.py \ + Lib/runpy.py \ + Lib/sched.py \ + Lib/secrets.py \ + Lib/shelve.py \ + Lib/selectors.py \ + Lib/shlex.py \ + Lib/shutil.py \ + Lib/signal.py \ + Lib/site.py \ + Lib/smtpd.py \ + Lib/smtplib.py \ + Lib/sndhdr.py \ + Lib/socket.py \ + Lib/socketserver.py \ + Lib/sre_compile.py \ + Lib/sre_constants.py \ + Lib/sre_parse.py \ + Lib/ssl.py \ + Lib/statistics.py \ + Lib/stat.py \ + Lib/stringprep.py \ + Lib/string.py \ + Lib/struct.py \ + Lib/subprocess.py \ + Lib/sunau.py \ + Lib/symbol.py \ + Lib/symtable.py \ + Lib/sysconfig.py \ + Lib/tabnanny.py \ + Lib/tarfile.py \ + Lib/telnetlib.py \ + Lib/tempfile.py \ + Lib/textwrap.py \ + Lib/this.py \ + Lib/threading.py \ + Lib/timeit.py \ + Lib/tokenize.py \ + Lib/token.py \ + Lib/traceback.py \ + Lib/trace.py \ + Lib/tty.py \ + Lib/turtle.py \ + Lib/types.py \ + Lib/typing.py \ + Lib/uu.py \ + Lib/uuid.py \ + Lib/warnings.py \ + Lib/wave.py \ + Lib/weakref.py \ + Lib/webbrowser.py \ + Lib/xdrlib.py \ + Lib/zipfile.py \ +)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/asyncio,\ + Lib/asyncio/base_futures.py \ + Lib/asyncio/base_tasks.py \ + Lib/asyncio/format_helpers.py \ + Lib/asyncio/runners.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-$(PYTHON_VERSION)/lib/concurrent,\ + Lib/concurrent/__init__.py \ +)) + +$(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-$(PYTHON_VERSION)/lib/ctypes,\ + Lib/ctypes/__init__.py \ + Lib/ctypes/_aix.py \ + Lib/ctypes/_endian.py \ + Lib/ctypes/util.py \ + Lib/ctypes/wintypes.py \ +)) + +$(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 \ + Lib/ctypes/macholib/__init__.py \ + Lib/ctypes/macholib/dyld.py \ + Lib/ctypes/macholib/dylib.py \ + Lib/ctypes/macholib/framework.py \ +)) + +$(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 \ + Lib/distutils/archive_util.py \ + Lib/distutils/bcppcompiler.py \ + Lib/distutils/ccompiler.py \ + Lib/distutils/cmd.py \ + Lib/distutils/config.py \ + Lib/distutils/core.py \ + Lib/distutils/cygwinccompiler.py \ + Lib/distutils/debug.py \ + Lib/distutils/dep_util.py \ + Lib/distutils/dir_util.py \ + Lib/distutils/dist.py \ + Lib/distutils/errors.py \ + Lib/distutils/extension.py \ + Lib/distutils/fancy_getopt.py \ + Lib/distutils/filelist.py \ + Lib/distutils/file_util.py \ + Lib/distutils/log.py \ + Lib/distutils/msvc9compiler.py \ + Lib/distutils/msvccompiler.py \ + Lib/distutils/spawn.py \ + Lib/distutils/sysconfig.py \ + Lib/distutils/text_file.py \ + Lib/distutils/unixccompiler.py \ + Lib/distutils/util.py \ + Lib/distutils/versionpredicate.py \ + Lib/distutils/version.py \ +)) + +$(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_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_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_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-14.0.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 \ +)) + +$(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 \ + Lib/email/_parseaddr.py \ + Lib/email/_policybase.py \ + Lib/email/architecture.rst \ + Lib/email/base64mime.py \ + Lib/email/charset.py \ + Lib/email/contentmanager.py \ + Lib/email/encoders.py \ + Lib/email/errors.py \ + Lib/email/feedparser.py \ + Lib/email/generator.py \ + Lib/email/header.py \ + Lib/email/headerregistry.py \ + Lib/email/iterators.py \ + Lib/email/message.py \ + Lib/email/parser.py \ + Lib/email/policy.py \ + Lib/email/quoprimime.py \ + Lib/email/utils.py \ +)) + +$(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 \ + Lib/email/mime/base.py \ + Lib/email/mime/image.py \ + Lib/email/mime/message.py \ + Lib/email/mime/multipart.py \ + Lib/email/mime/nonmultipart.py \ + Lib/email/mime/text.py \ +)) + +$(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/bz2_codec.py \ + Lib/encodings/charmap.py \ + Lib/encodings/cp037.py \ + Lib/encodings/cp1006.py \ + Lib/encodings/cp1026.py \ + Lib/encodings/cp1125.py \ + Lib/encodings/cp1140.py \ + Lib/encodings/cp1250.py \ + Lib/encodings/cp1251.py \ + Lib/encodings/cp1252.py \ + Lib/encodings/cp1253.py \ + Lib/encodings/cp1254.py \ + Lib/encodings/cp1255.py \ + Lib/encodings/cp1256.py \ + Lib/encodings/cp1257.py \ + Lib/encodings/cp1258.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 \ + Lib/encodings/cp850.py \ + Lib/encodings/cp852.py \ + Lib/encodings/cp855.py \ + Lib/encodings/cp856.py \ + Lib/encodings/cp857.py \ + Lib/encodings/cp858.py \ + Lib/encodings/cp860.py \ + Lib/encodings/cp861.py \ + Lib/encodings/cp862.py \ + Lib/encodings/cp863.py \ + Lib/encodings/cp864.py \ + Lib/encodings/cp865.py \ + Lib/encodings/cp866.py \ + Lib/encodings/cp869.py \ + Lib/encodings/cp874.py \ + Lib/encodings/cp875.py \ + Lib/encodings/cp932.py \ + Lib/encodings/cp949.py \ + Lib/encodings/cp950.py \ + Lib/encodings/euc_jis_2004.py \ + Lib/encodings/euc_jisx0213.py \ + Lib/encodings/euc_jp.py \ + Lib/encodings/euc_kr.py \ + Lib/encodings/gb18030.py \ + Lib/encodings/gb2312.py \ + Lib/encodings/gbk.py \ + Lib/encodings/hex_codec.py \ + Lib/encodings/hp_roman8.py \ + Lib/encodings/hz.py \ + Lib/encodings/idna.py \ + Lib/encodings/iso2022_jp_1.py \ + Lib/encodings/iso2022_jp_2004.py \ + Lib/encodings/iso2022_jp_2.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_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 \ + Lib/encodings/iso8859_5.py \ + Lib/encodings/iso8859_6.py \ + Lib/encodings/iso8859_7.py \ + Lib/encodings/iso8859_8.py \ + Lib/encodings/iso8859_9.py \ + Lib/encodings/johab.py \ + Lib/encodings/koi8_r.py \ + Lib/encodings/koi8_t.py \ + Lib/encodings/koi8_u.py \ + Lib/encodings/kz1048.py \ + Lib/encodings/latin_1.py \ + Lib/encodings/mac_arabic.py \ + Lib/encodings/mac_centeuro.py \ + Lib/encodings/mac_croatian.py \ + Lib/encodings/mac_cyrillic.py \ + Lib/encodings/mac_farsi.py \ + 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_turkish.py \ + Lib/encodings/mbcs.py \ + Lib/encodings/oem.py \ + Lib/encodings/palmos.py \ + Lib/encodings/ptcp154.py \ + Lib/encodings/punycode.py \ + 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_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_be.py \ + Lib/encodings/utf_16_le.py \ + Lib/encodings/utf_16.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 \ + Lib/encodings/uu_codec.py \ + Lib/encodings/zlib_codec.py \ +)) + +$(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-$(PYTHON_VERSION)/lib/http,\ + Lib/http/__init__.py \ + Lib/http/client.py \ + Lib/http/cookiejar.py \ + Lib/http/cookies.py \ + Lib/http/server.py \ +)) + +$(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/resources.py \ + Lib/importlib/util.py \ +)) + +$(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 \ + Lib/json/scanner.py \ + Lib/json/tool.py \ +)) + +$(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 \ + Lib/lib2to3/PatternGrammar.txt \ + Lib/lib2to3/btm_matcher.py \ + Lib/lib2to3/btm_utils.py \ + Lib/lib2to3/fixer_base.py \ + Lib/lib2to3/fixer_util.py \ + Lib/lib2to3/main.py \ + Lib/lib2to3/patcomp.py \ + Lib/lib2to3/pygram.py \ + Lib/lib2to3/pytree.py \ + Lib/lib2to3/refactor.py \ +)) + +$(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 \ + Lib/lib2to3/fixes/fix_basestring.py \ + 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_exitfunc.py \ + Lib/lib2to3/fixes/fix_filter.py \ + Lib/lib2to3/fixes/fix_funcattrs.py \ + Lib/lib2to3/fixes/fix_future.py \ + Lib/lib2to3/fixes/fix_getcwdu.py \ + 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_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_long.py \ + Lib/lib2to3/fixes/fix_map.py \ + Lib/lib2to3/fixes/fix_metaclass.py \ + Lib/lib2to3/fixes/fix_methodattrs.py \ + Lib/lib2to3/fixes/fix_ne.py \ + Lib/lib2to3/fixes/fix_next.py \ + Lib/lib2to3/fixes/fix_nonzero.py \ + Lib/lib2to3/fixes/fix_numliterals.py \ + Lib/lib2to3/fixes/fix_operator.py \ + Lib/lib2to3/fixes/fix_paren.py \ + Lib/lib2to3/fixes/fix_print.py \ + Lib/lib2to3/fixes/fix_raise.py \ + Lib/lib2to3/fixes/fix_raw_input.py \ + Lib/lib2to3/fixes/fix_reduce.py \ + Lib/lib2to3/fixes/fix_reload.py \ + Lib/lib2to3/fixes/fix_renames.py \ + Lib/lib2to3/fixes/fix_repr.py \ + Lib/lib2to3/fixes/fix_set_literal.py \ + Lib/lib2to3/fixes/fix_standarderror.py \ + Lib/lib2to3/fixes/fix_sys_exc.py \ + Lib/lib2to3/fixes/fix_throw.py \ + Lib/lib2to3/fixes/fix_tuple_params.py \ + Lib/lib2to3/fixes/fix_types.py \ + Lib/lib2to3/fixes/fix_unicode.py \ + Lib/lib2to3/fixes/fix_urllib.py \ + Lib/lib2to3/fixes/fix_ws_comma.py \ + Lib/lib2to3/fixes/fix_xrange.py \ + Lib/lib2to3/fixes/fix_xreadlines.py \ + Lib/lib2to3/fixes/fix_zip.py \ +)) + +$(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 \ + Lib/lib2to3/pgen2/grammar.py \ + 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 \ +)) + +$(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-$(PYTHON_VERSION)/lib/multiprocessing,\ + Lib/multiprocessing/__init__.py \ + Lib/multiprocessing/connection.py \ + Lib/multiprocessing/context.py \ + Lib/multiprocessing/forkserver.py \ + Lib/multiprocessing/heap.py \ + Lib/multiprocessing/managers.py \ + Lib/multiprocessing/popen_fork.py \ + Lib/multiprocessing/popen_forkserver.py \ + Lib/multiprocessing/popen_spawn_posix.py \ + Lib/multiprocessing/popen_spawn_win32.py \ + Lib/multiprocessing/process.py \ + Lib/multiprocessing/queues.py \ + Lib/multiprocessing/reduction.py \ + Lib/multiprocessing/resource_sharer.py \ + Lib/multiprocessing/semaphore_tracker.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-$(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-$(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-$(PYTHON_VERSION)/lib/unittest,\ + Lib/unittest/__init__.py \ + Lib/unittest/__main__.py \ + Lib/unittest/case.py \ + Lib/unittest/loader.py \ + Lib/unittest/main.py \ + Lib/unittest/mock.py \ + Lib/unittest/result.py \ + Lib/unittest/runner.py \ + Lib/unittest/signals.py \ + Lib/unittest/suite.py \ + Lib/unittest/util.py \ +)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/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-$(PYTHON_VERSION)/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-$(PYTHON_VERSION)/lib/urllib,\ + Lib/urllib/__init__.py \ + Lib/urllib/error.py \ + Lib/urllib/parse.py \ + Lib/urllib/request.py \ + Lib/urllib/response.py \ + Lib/urllib/robotparser.py \ +)) + +$(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 \ + Lib/wsgiref/simple_server.py \ + Lib/wsgiref/util.py \ + Lib/wsgiref/validate.py \ +)) + +$(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-$(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/pulldom.py \ + Lib/xml/dom/xmlbuilder.py \ +)) + +$(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/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-$(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-$(PYTHON_VERSION)/lib/xml/sax,\ + Lib/xml/sax/__init__.py \ + Lib/xml/sax/_exceptions.py \ + Lib/xml/sax/expatreader.py \ + Lib/xml/sax/handler.py \ + Lib/xml/sax/saxutils.py \ + Lib/xml/sax/xmlreader.py \ +)) + +$(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-$(PYTHON_VERSION)/lib/site-packages,\ + Lib/site-packages/README.txt \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk new file mode 100644 index 000000000..91c6c1948 --- /dev/null +++ b/external/python3/ExternalProject_python3.mk @@ -0,0 +1,184 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,python3)) + +$(eval $(call gb_ExternalProject_use_externals,python3,\ + expat \ + $(if $(filter LINUX,$(OS)),libffi) \ + openssl \ + zlib \ +)) + +$(eval $(call gb_ExternalProject_register_targets,python3,\ + build \ + $(if $(filter MACOSX,$(OS)),\ + fixscripts \ + fixinstallnames \ + executables \ + removeunnecessarystuff \ + ) \ +)) + +ifeq ($(OS),WNT) + +# TODO: using Debug configuration and related mangling of pyconfig.h + +# 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_Trace_StartRange,python3,EXTERNAL) + $(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:opensslIncludeDir=$(call gb_UnpackedTarball_get_dir,openssl)/include \ + /p:opensslOutDir=$(call gb_UnpackedTarball_get_dir,openssl)/out32dll \ + /p:zlibDir=$(call gb_UnpackedTarball_get_dir,zlib) \ + /maxcpucount \ + $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + ,PCBuild) + $(call gb_Trace_EndRange,python3,EXTERNAL) + +else + +# --with-system-expat: this should find the one in the workdir (or system) + +# OPENSSL_INCLUDES OPENSSL_LDFLAGS OPENSSL_LIBS cannot be set via commandline! +# use --with-openssl instead, which requires include/ and lib/ subdirs. + +# libffi is not all that stable, with 3 different SONAMEs currently, so we +# have to bundle it; --without-system-ffi does not work any more on Linux. +# Unfortuantely (as of 3.7) pkg-config is used to locate libffi so we do some +# hacks to find the libffi.pc in workdir by overriding PKG_CONFIG_LIBDIR. +# Also, pkg-config is only used to find the headers, the libdir needs to be +# passed extra. + +# create a symlink "LO_lib" because the .so are in a directory with platform +# specific name like build/lib.linux-x86_64-3.3 + +python3_cflags = $(ZLIB_CFLAGS) +ifneq (,$(ENABLE_VALGRIND)) + python3_cflags += $(VALGRIND_CFLAGS) +endif + +# This happens to override the -O3 in the default OPT set in +# workdir/UnpackedTarball/python3/configure.ac while keeping the other content of that OPT intact: +ifeq ($(ENABLE_OPTIMIZED),) +python3_cflags += $(gb_COMPILERNOOPTFLAGS) +endif + +$(call gb_ExternalProject_get_state_target,python3,build) : + $(call gb_Trace_StartRange,python3,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + $(if $(filter MACOSX,$(OS)), \ + $(if $(filter 10.8 10.9 10.10 10.11,$(MACOSX_DEPLOYMENT_TARGET)), \ + ac_cv_func_getentropy=no \ + ac_cv_func_clock_gettime=no \ + ) \ + ) \ + ./configure \ + $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(if $(ENABLE_VALGRIND),--with-valgrind) \ + --prefix=/python-inst \ + --with-system-expat \ + $(if $(filter AIX,$(OS)), \ + --disable-ipv6 --with-threads OPT="-g0 -fwrapv -O3 -Wall") \ + $(if $(filter MACOSX,$(OS)), \ + $(if $(filter INTEL,$(CPUNAME)),--enable-universalsdk=$(MACOSX_SDK_PATH) \ + --with-universal-archs=intel \ + ) \ + --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \ + --enable-shared \ + $(if $(filter 1090 101000 101100 101200,$(MAC_OS_X_VERSION_MIN_REQUIRED)),ac_cv_func_utimensat=no) \ + ) \ + $(if $(SYSTEM_OPENSSL)$(DISABLE_OPENSSL),,\ + --with-openssl=$(call gb_UnpackedTarball_get_dir,openssl) \ + ) \ + $(if $(filter LINUX,$(OS)), \ + PKG_CONFIG_LIBDIR="$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)$${PKG_CONFIG_LIBDIR:+:$$PKG_CONFIG_LIBDIR}" \ + ) \ + CC="$(strip $(CC) \ + $(if $(SYSTEM_EXPAT),,-I$(call gb_UnpackedTarball_get_dir,expat)/lib) \ + $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \ + )" \ + $(if $(python3_cflags),CFLAGS='$(python3_cflags)') \ + $(if $(filter -fsanitize=%,$(CC)),LINKCC="$(CXX) -pthread") \ + LDFLAGS="$(strip $(LDFLAGS) \ + $(if $(filter LINUX,$(OS)),-L$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs) \ + $(if $(SYSTEM_EXPAT),,-L$(gb_StaticLibrary_WORKDIR)) \ + $(if $(SYSTEM_ZLIB),,-L$(gb_StaticLibrary_WORKDIR)) \ + $(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \ + $(gb_LTOFLAGS) \ + )" \ + && MAKEFLAGS= $(MAKE) \ + $(if $(filter MACOSX,$(OS)),DESTDIR=$(EXTERNAL_WORKDIR)/python-inst install) \ + $(if $(SYSTEM_ZLIB),,ZLIB_INCDIR=$(WORKDIR)/UnpackedTarball/zlib) \ + && ln -s build/lib.* LO_lib \ + ) + $(call gb_Trace_EndRange,python3,EXTERNAL) + +endif + +ifeq ($(OS),MACOSX) + +python3_fw_prefix=$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework + +# rule to allow relocating the whole framework, removing reference to buildinstallation directory +$(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/idle$(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) '\ + BEGIN {print "#!/bin/bash\n\ +origpath=$$(pwd)\n\ +bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\ +cd \"$$origpath\"\n\ +\"$$bindir/../Resources/Python.app/Contents/MacOS/LibreOfficePython\" - $$@ <<EOF"} \ + FNR==1{next} \ + {print} \ + END {print "EOF"}' > "$$file" ; } < "$$file" ; chmod +x "$$file" ; done + touch $@ + +$(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_ExternalProject_get_state_target,python3,build) + $(INSTALL_NAME_TOOL) -change \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ + @executable_path/../../../../LibreOfficePython \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython + for file in $(shell $(FIND) $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload -name "*.so") ; do \ + $(INSTALL_NAME_TOOL) -change \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ + @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 + touch $@ + +$(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)/test + touch $@ + +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/GeneratedPackage_python3.mk b/external/python3/GeneratedPackage_python3.mk new file mode 100644 index 000000000..ffde38be5 --- /dev/null +++ b/external/python3/GeneratedPackage_python3.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_GeneratedPackage_GeneratedPackage,python3,$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO)) + +$(eval $(call gb_GeneratedPackage_use_unpacked,python3,python3)) + +$(eval $(call gb_GeneratedPackage_use_external_project,python3,python3)) + +$(eval $(call gb_GeneratedPackage_add_dir,python3,$(INSTROOT)/Frameworks/LibreOfficePython.framework,LibreOfficePython.framework)) + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/Makefile b/external/python3/Makefile new file mode 100644 index 000000000..e4968cf85 --- /dev/null +++ b/external/python3/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/Module_python3.mk b/external/python3/Module_python3.mk new file mode 100644 index 000000000..5ef1deb21 --- /dev/null +++ b/external/python3/Module_python3.mk @@ -0,0 +1,22 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,python3)) + +ifneq ($(DISABLE_PYTHON),TRUE) + +$(eval $(call gb_Module_add_targets,python3,\ + UnpackedTarball_python3 \ + ExternalProject_python3 \ + $(if $(filter MACOSX,$(OS)),GeneratedPackage_python3,ExternalPackage_python3) \ +)) + +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/README b/external/python3/README new file mode 100644 index 000000000..edde023af --- /dev/null +++ b/external/python3/README @@ -0,0 +1 @@ +CPython implementation of Python 3 from http://www.python.org diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk new file mode 100644 index 000000000..fb693e70d --- /dev/null +++ b/external/python3/UnpackedTarball_python3.mk @@ -0,0 +1,48 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,python3)) + +$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3)) + +$(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ + PCbuild/pcbuild.sln \ +)) + +$(eval $(call gb_UnpackedTarball_add_patches,python3,\ + external/python3/i100492-freebsd.patch.1 \ + external/python3/python-3.3.0-darwin.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 \ + external/python3/macos-11.patch.0 \ +)) + +ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),) +$(eval $(call gb_UnpackedTarball_add_patches,python3,\ + external/python3/python-3.3.3-elf-rpath.patch.1 \ +)) +endif + +ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE) +$(eval $(call gb_UnpackedTarball_add_patches,python3,\ + external/python3/python-3.3.3-disable-obmalloc.patch.0 \ +)) +endif + +ifneq ($(SYSTEM_ZLIB),TRUE) +$(eval $(call gb_UnpackedTarball_add_patches,python3, \ + external/python3/internal-zlib.patch.0 \ +)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/python3/darwin.patch.0 b/external/python3/darwin.patch.0 new file mode 100644 index 000000000..139cdc978 --- /dev/null +++ b/external/python3/darwin.patch.0 @@ -0,0 +1,10 @@ +--- Modules/_ctypes/libffi_osx/x86/darwin64.S ++++ Modules/_ctypes/libffi_osx/x86/darwin64.S +@@ -29,7 +29,6 @@ + #include <fficonfig.h> + #include <ffi.h> + +- .file "darwin64.S" + .text + + /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, diff --git a/external/python3/i100492-freebsd.patch.1 b/external/python3/i100492-freebsd.patch.1 new file mode 100644 index 000000000..074e5fc48 --- /dev/null +++ b/external/python3/i100492-freebsd.patch.1 @@ -0,0 +1,35 @@ +FreeBSD porting fixes, patch by maho@openoffice.org + +--- 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 @@ + { + pthread_t th; + int status; ++#ifdef __FreeBSD__ ++ sigset_t set, oset; ++#endif + #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) + pthread_attr_t attrs; + #endif +@@ -214,6 +220,10 @@ + callback->func = func; + callback->arg = arg; + ++#ifdef __FreeBSD__ ++ sigfillset(&set); ++ SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset); ++#endif + status = pthread_create(&th, + #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) + &attrs, +@@ -225,6 +234,9 @@ + #endif + pythread_wrapper, callback); + ++#ifdef __FreeBSD__ ++ SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL); ++#endif + #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) + pthread_attr_destroy(&attrs); + #endif diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0 new file mode 100644 index 000000000..abe2630bd --- /dev/null +++ b/external/python3/internal-zlib.patch.0 @@ -0,0 +1,55 @@ +--- configure ++++ configure +@@ -11607,13 +11607,13 @@ + ;; + esac + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 +-$as_echo_n "checking for inflateCopy in -lz... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lzlib" >&5 ++$as_echo_n "checking for inflateCopy in -lzlib... " >&6; } + if ${ac_cv_lib_z_inflateCopy+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lz $LIBS" ++LIBS="-lzlib $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +--- setup.py ++++ setup.py +@@ -1362,7 +1362,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 = [os.environ.get('ZLIB_INCDIR')] + have_zlib = False + if zlib_inc is not None: + zlib_h = zlib_inc[0] + '/zlib.h' +@@ -1379,13 +1379,13 @@ + 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": + 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)) + have_zlib = True + else: +@@ -1399,7 +1399,7 @@ + # crc32 if we have it. Otherwise binascii uses its own. + if have_zlib: + extra_compile_args = ['-DUSE_ZLIB_CRC32'] +- libraries = ['z'] ++ libraries = ['zlib'] + extra_link_args = zlib_extra_link_args + else: + extra_compile_args = [] diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0 new file mode 100644 index 000000000..d3dbbf605 --- /dev/null +++ b/external/python3/macos-11.patch.0 @@ -0,0 +1,59 @@ +-*- Mode: diff -*- +--- configure ++++ configure +@@ -3374,7 +3374,7 @@ + # has no effect, don't bother defining them + Darwin/[6789].*) + define_xopen_source=no;; +- Darwin/1[0-9].*) ++ Darwin/[12][0-9].*) + define_xopen_source=no;; + # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but + # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined +@@ -9372,6 +9275,9 @@ + esac + else + case `/usr/bin/arch` in ++ arm64) ++ MACOSX_DEFAULT_ARCH="arm64" ++ ;; + i386) + MACOSX_DEFAULT_ARCH="x86_64" + ;; +--- Mac/Tools/pythonw.c ++++ Mac/Tools/pythonw.c +@@ -121,6 +121,8 @@ + cpu_types[0] = CPU_TYPE_POWERPC; + #elif defined(__i386__) + cpu_types[0] = CPU_TYPE_X86; ++#elif defined(__arm64__) ++ cpu_types[0] = CPU_TYPE_ARM64; + #else + # error "Unknown CPU" + #endif +--- setup.py ++++ setup.py +@@ -670,7 +670,10 @@ + add_dir_to_list(self.compiler.include_dirs, + sysconfig.get_config_var("INCLUDEDIR")) + +- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] ++ if host_platform == 'darwin': ++ system_lib_dirs = ['/usr/lib', macosx_sdk_root()+'/usr/lib'] ++ else: ++ system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] + system_include_dirs = ['/usr/include'] + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can +--- Modules/_decimal/libmpdec/mpdecimal.h ++++ Modules/_decimal/libmpdec/mpdecimal.h +@@ -135,6 +135,9 @@ + #elif defined(__x86_64__) + #define CONFIG_64 + #define ASM ++ #elif defined(__arm64__) ++ #define CONFIG_64 ++ #define ANSI + #else + #error "unknown architecture for universal build." + #endif diff --git a/external/python3/python-3.3.0-clang.patch.1 b/external/python3/python-3.3.0-clang.patch.1 new file mode 100644 index 000000000..9001110fb --- /dev/null +++ b/external/python3/python-3.3.0-clang.patch.1 @@ -0,0 +1,13 @@ +-*- 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 new file mode 100644 index 000000000..d5cb17e33 --- /dev/null +++ b/external/python3/python-3.3.0-darwin.patch.1 @@ -0,0 +1,81 @@ +-*- Mode: diff -*- + +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 @@ + then + case "$UNIVERSAL_ARCHS" in + 32-bit) +- UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" ++ # LO does not use Universal Binaries (but the only way to set a SDK ++ # here implies that, so de-universalize here...) ++ case `/usr/bin/arch` in ++ i386) ++ UNIVERSAL_ARCH_FLAGS="-arch i386" ++ ;; ++ ppc) ++ UNIVERSAL_ARCH_FLAGS="" ++ ;; ++ *) ++ as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 ++ ;; ++ esac ++ + LIPO_32BIT_FLAGS="" + ARCH_RUN_32BIT="" + ;; +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 @@ + INSTALL_SCRIPT= @INSTALL_SCRIPT@ + INSTALL_DATA=@INSTALL_DATA@ + LN=@LN@ +-STRIPFLAG=-s ++STRIPFLAG= + CPMAC=CpMac + + APPTEMPLATE=$(srcdir)/Resources/app +diff -ru python3.orig/Mac/Resources/app/Info.plist.in python3/Mac/Resources/app/Info.plist.in +--- python3.orig/Mac/Resources/app/Info.plist.in 2015-07-05 18:50:07.000000000 +0200 ++++ python3/Mac/Resources/app/Info.plist.in 2015-07-26 17:42:00.974521224 +0200 +@@ -18,7 +18,7 @@ + </dict> + </array> + <key>CFBundleExecutable</key> +- <string>Python</string> ++ <string>LibreOfficePython</string> + <key>CFBundleGetInfoString</key> + <string>%version%, (c) 2001-2016 Python Software Foundation.</string> + <key>CFBundleHelpBookFolder</key> +diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resources/framework/Info.plist.in +--- python3.orig/Mac/Resources/framework/Info.plist.in 2015-07-05 18:50:07.000000000 +0200 ++++ python3/Mac/Resources/framework/Info.plist.in 2015-07-26 17:41:15.996518204 +0200 +@@ -5,7 +5,7 @@ + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> +- <string>Python</string> ++ <string>@PYTHONFRAMEWORK@</string> + <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-disable-obmalloc.patch.0 b/external/python3/python-3.3.3-disable-obmalloc.patch.0 new file mode 100644 index 000000000..0963a5f1b --- /dev/null +++ b/external/python3/python-3.3.3-disable-obmalloc.patch.0 @@ -0,0 +1,21 @@ +--- Objects/obmalloc.c ++++ Objects/obmalloc.c +@@ -413,8 +413,8 @@ + + #ifdef WITH_PYMALLOC + ++#define WITH_VALGRIND + #ifdef WITH_VALGRIND +-#include <valgrind/valgrind.h> + + /* If we're using GCC, use __builtin_expect() to reduce overhead of + the valgrind checks */ +@@ -1181,7 +1181,7 @@ + + #ifdef WITH_VALGRIND + if (UNLIKELY(running_on_valgrind == -1)) { +- running_on_valgrind = RUNNING_ON_VALGRIND; ++ running_on_valgrind = 1; + } + if (UNLIKELY(running_on_valgrind)) { + return NULL; diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 new file mode 100644 index 000000000..0dfa16c8c --- /dev/null +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -0,0 +1,27 @@ +set RPATH (only to be used on ELF platforms) + +(currently nothing in LO actually links libpython3.so) + +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 @@ + + # 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 + + 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 @@ + fi + + libpython3.so: libpython$(LDVERSION).so +- $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ ++ $(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); \ diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1 new file mode 100644 index 000000000..416ab2c7b --- /dev/null +++ b/external/python3/python-3.5.4-msvc-disable.patch.1 @@ -0,0 +1,56 @@ +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 @@ + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcxproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}" +-EndProject + 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 @@ + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcxproj", "{13CECB97-4119-4316-9D42-8534019A5A44}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" + 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}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcxproj", "{18CAE28C-B454-46C1-87A0-493D91D97F03}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_lzma", "_lzma.vcxproj", "{F9D71780-F393-11E0-BE50-0800200C9A66}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.vcxproj", "{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "..\PC\bdist_wininst\bdist_wininst.vcxproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" +-EndProject + 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 @@ + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj", "{12728250-16EC-4DC6-94D7-E21DD88947F8}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python_uwp", "python_uwp.vcxproj", "{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "venvlauncher", "venvlauncher.vcxproj", "{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}" diff --git a/external/python3/python-3.5.tweak.strip.soabi.patch b/external/python3/python-3.5.tweak.strip.soabi.patch new file mode 100644 index 000000000..48ac7f82f --- /dev/null +++ b/external/python3/python-3.5.tweak.strip.soabi.patch @@ -0,0 +1,12 @@ +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 @@ + $as_echo "$ABIFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 + $as_echo_n "checking SOABI... " >&6; } +-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} ++SOABI='cpython-'`echo $VERSION$ABIFLAGS` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5 + $as_echo "$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 new file mode 100644 index 000000000..e8e94f674 --- /dev/null +++ b/external/python3/python-3.7.6-msvc-ssl.patch.1 @@ -0,0 +1,40 @@ +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 @@ + </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Modules\_ssl.c" />
+- <ClCompile Include="$(opensslIncludeDir)\applink.c">
+- <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions)</PreprocessorDefinitions>
+- </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\PC\python_nt.rc" />
+--- python3/PCbuild/openssl.props.orig 2019-12-23 16:20:34.588135900 +0100 ++++ python3/PCbuild/openssl.props 2019-12-23 16:20:51.074001300 +0100 +@@ -6,7 +6,7 @@ + </ClCompile>
+ <Link>
+ <AdditionalLibraryDirectories>$(opensslOutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+- <AdditionalDependencies>ws2_32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <PropertyGroup>
+@@ -15,10 +15,10 @@ + <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
+ </PropertyGroup>
+ <ItemGroup>
+- <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
+- <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).pdb" />
+- <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" />
+- <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" />
++ <_SSLDLL Include="$(opensslOutDir)\libeay32.dll" />
++ <_SSLDLL Include="$(opensslOutDir)\libeay32.pdb" />
++ <_SSLDLL Include="$(opensslOutDir)\ssleay32.dll" />
++ <_SSLDLL Include="$(opensslOutDir)\ssleay32.pdb" />
+ </ItemGroup>
+ <Target Name="_CopySSLDLL" Inputs="@(_SSLDLL)" Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
+ <Copy SourceFiles="@(_SSLDLL)" DestinationFolder="$(OutDir)" />
diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0 new file mode 100644 index 000000000..938acc1f1 --- /dev/null +++ b/external/python3/ubsan.patch.0 @@ -0,0 +1,20 @@ +--- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c ++++ Modules/_ctypes/libffi_osx/x86/x86-ffi64.c +@@ -599,9 +599,15 @@ + tramp = (volatile unsigned short*)&closure->tramp[0]; + + tramp[0] = 0xbb49; /* mov <code>, %r11 */ +- *(void* volatile*)&tramp[1] = ffi_closure_unix64; ++ tramp[1] = (unsigned short) ffi_closure_unix64; ++ tramp[2] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 16); ++ tramp[3] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 32); ++ tramp[4] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 48); + tramp[5] = 0xba49; /* mov <data>, %r10 */ +- *(void* volatile*)&tramp[6] = closure; ++ tramp[6] = (unsigned short) closure; ++ tramp[7] = (unsigned short) (((unsigned long)closure) >> 16); ++ tramp[8] = (unsigned short) (((unsigned long)closure) >> 32); ++ tramp[9] = (unsigned short) (((unsigned long)closure) >> 48); + + /* Set the carry bit if the function uses any sse registers. + This is clc or stc, together with the first byte of the jmp. */ |