Commit Graph

42 Commits

Author SHA1 Message Date
Jeffery To d4f5759190 python3: Update to 3.11.7, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-12-13 14:16:39 +08:00
Jeffery To 624fb95561 python3: Fix building C extensions with setuptools
setuptools provides a local copy of distutils and when building a C
extension, this distutils will add the target LIBDIR (/usr/lib) to the
list of library paths.

If the build system has a libpython3.11.so in /usr/lib, then the linker
will try to link to this shared library and fail.

This adapts 008-distutils-use-python-sysroot.patch for host setuptools
to add the correct library directory.

Fixes: https://github.com/openwrt/packages/issues/22330

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-30 13:33:07 -07:00
Jeffery To 2aba43afe9
python3: Update to 3.11.6, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-10-09 09:20:50 +08:00
Jeffery To e42c845039 python3: Update to 3.11.5, refresh patches
Includes fix for CVE-2023-40217 (Bypass TLS handshake on closed
sockets).

This also:

* Remove 027-install-python3-symlink-after-stdlib.patch

  This was merged upstream in
  https://github.com/python/cpython/pull/104693.

* Remove fix for unnecessary linking with libbsd
  (60bf01cb60)

  This was fixed upstream in
  https://github.com/python/cpython/pull/105236.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-09-08 19:01:47 +08:00
Jeffery To 4627ed7c43
python3: Update to 3.11.4, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-06-12 14:10:01 +08:00
Jeffery To 2445fe9fb2 python3: Update to 3.11.3, refresh/redo patches
* Removed patches:

  * 001-enable-zlib.patch: zlib module should be enabled automatically

  * 007-distutils-do-not-adjust-path.patch: Not necessary since we
    process shebang lines for all scripts (in python3-package.mk)

  * 030-bpo-43112-detect-musl-as-a-separate-SOABI-GH-24502.patch:
    Already merged

* Move configure vars from config.site back into Makefile

  Centralizing all build information into one file makes it easier to
  maintain

* No longer set ac_cv_header_uuid_h=yes as configure should detect
  libuuid

* Order configure args by enable-/disable-/with-/without-, then
  alphabetically

* Set ac_cv_working_openssl_hashlib=yes for host configure to bypass the
  OpenSSL API tests with LibreSSL

* Use the default Host/Compile recipe instead of picking out specific
  targets to make

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2023-05-24 06:04:33 +03:00
Michal Vasilek e9ddc479f9
python3: update to 3.10.7
* fixes CVE-2021-28861
* adjust pip and setuptools versions
* refresh patches

Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
2022-10-10 16:59:12 +02:00
Jeffery To 57e2b656cb
python3: Update to 3.10.5, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-06-13 18:21:20 +08:00
Jeffery To d0efe27a8c python3: Update to 3.10.4
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-28 00:57:45 -07:00
Jeffery To bed8dc2132
python3: Update to 3.10.3, refresh patches
Includes fixes for:
* Windows builds updated to bzip2 1.0.8 to mitigate CVE-2016-3189 and
  CVE-2019-12900
* CVE-2022-26488: Escalation of privilege via Windows Installer

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-21 16:43:35 +08:00
Jeffery To 5b2c8bccf3
python3: Update to 3.10.2, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-01-17 04:32:42 +08:00
Jeffery To d63664a5e7
python3: Update to 3.10.1, refresh/remove patches
Removed patches:
* 027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch
  Already merged.
* 029-disable-deprecation-warning.patch
  Packages should be patched/fixed to remove the use of distutils
  instead of disabling this warning.

Also:
* Updates PKG_LICENSE to use the correct SPDX license identifier
* Fixes build for mipsel_24kc_24kf

Fixes https://github.com/openwrt/packages/issues/17217.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-01-05 16:10:01 +08:00
Alexandru Ardelean 4e05541782 python3: bump to version 3.10.0
Manually re-applied:
  008-distutils-use-python-sysroot.patch
  016-adjust-config-paths.patch

Drop patch: 003-do-not-run-distutils-tests.patch
There is now a configure option '--disable-test-modules'
And seems we left the '_ctypes_test' around for quite some time.
Dropped now.
Refs:
  https://bugs.python.org/issue27640
  https://bugs.python.org/issue43282

Drop patch: 013-getbuildinfo-date-time-source-date-epoch.patch
Python build honors SOURCE_DATE_EPOCH pretty well now.

Drop setuptools patches. Setuptools should be reproducible with Python 3.6+
according to a mention here:
  https://github.com/pypa/setuptools/pull/1690#issuecomment-536517456
It's time to let upstream fix Setuptools reproduce-ability.

Drop patch: 010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
I can't seem to fully remember why it's there.
And it seem to build fine without it.

Drop patch: 015-abort-on-failed-modules.patch
Python build supports a similar PYTHONSTRICTEXTENSIONBUILD=1 env-var
option.

Add patch: 026-openssl-feature-flags.patch
We need to keep this in our tree for a while.
See:
  https://bugs.python.org/issue45627

Backport patch: 027-bpo-43158-Use-configure-values-for-building-_uuid-ex.patch
Link: https://github.com/python/cpython/pull/29353
Fixes the build for uuid C module.

Add patch: 028-host-python-support-ssl-with-libressl.patch
We need the _ssl module working on the host-side with LibreSSL for pip to
work to download from https://pypi.org
Refs: https://github.com/openwrt/openwrt/pull/4749

Add patch: 029-disable-deprecation-warning.patch
Fixes apparmor build. The warning causes a configure error.

Refreshed the rest of patches.

Some old build-flags were removed. They don't seem to be necessary anymore.

Split python3-uuid from python3-light. To better manage the libuuid library
(if needed). Also, fixing the uuid C module build. Seems this was failing,
and was falling back to using hashlib.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-11-19 13:30:14 +02:00
Alexandru Ardelean 26988f905f python3: bump version to 3.9.7
Refreshed patches.
And apply hack for line-endings in pep517 (from pip).

Hack comment:
  # FIXME: [1] get rid of this asap; 'patch' doesn't like Windows endings, and this file is full of them...
  #        I actually tried this in a number of ways and the only way to fix this is to implement
  #        a poor-man's dos2unix using sed.
  #        The issue is with the pip package; it seems that it throws in some Windows line-endings
  #        and 'patch' won't handle them. So, we do a "dos2unix" and then patch.
  #        We can get rid of this once this is solved upstream and in pip:
  #            https://github.com/pypa/pep517/pull/130

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-09-09 14:31:46 -07:00
Josef Schlehofer feaaacc10f
python3-setuptools: add _distutils_hack
I tried to install matplotlib by using pip and it failed with the following output:

2021-08-18T11:52:26,171 Collecting matplotlib
2021-08-18T11:52:26,173   Created temporary directory: /tmp/pip-unpack-wuth2u0e
2021-08-18T11:52:26,565   Using cached matplotlib-3.4.3.tar.gz (37.9 MB)
2021-08-18T11:52:38,659   Added matplotlib from https://files.pythonhosted.org/packages/21/37/           197e68df384ff694f78d687a49ad39f96c67b8d75718bc61503e1676b617/matplotlib-3.4.3.tar.                       gz#sha256=fc4f526dfdb31c9bd6b8ca06bf9fab663ca12f3ec9cdf4496fb44bc680140318 to build tracker '/tmp/pip-   req-tracker-u30x8pht'
2021-08-18T11:52:38,660     Running setup.py (path:/tmp/pip-install-afiyiers/                            matplotlib_8e717e38862f4976a3d6cb1832ba3261/setup.py) egg_info for package matplotlib
2021-08-18T11:52:38,661     Created temporary directory: /tmp/pip-pip-egg-info-kbtiezxq
2021-08-18T11:52:38,662     Running command python setup.py egg_info
2021-08-18T11:52:38,831     Traceback (most recent call last):
2021-08-18T11:52:38,832       File "<string>", line 1, in <module>
2021-08-18T11:52:38,832       File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 8, in <module>
2021-08-18T11:52:38,833     ModuleNotFoundError: No module named '_distutils_hack'

More details about it:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968410

Once I applied the patch from the bug tracker, I got further to install
it.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-18 12:20:07 +02:00
Alexandru Ardelean 8b3297e507 python3: update to version 3.9.6
Refreshed patches.
Bumped pip to 21.1.3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-07-06 16:20:18 +02:00
Alexandru Ardelean e312275dd9 python3: bump version to 3.9.5
Refreshed Python patches.
Updated pip & setuptools version.

For pip, patch '001-pep517-pyc-fix.patch' was reworked.

Also, the current version of the bundled pip (21.1.1) no longer supports
Python2, so the 'py2.py3' suffix gets replaced with just py3.

For setuptools, there is no longer a script/module:
  https://github.com/pypa/setuptools/pull/2544

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-05-11 11:50:35 +03:00
Alexandru Ardelean 156e2e354e python3: bump to version 3.9.4
For some reason Python3 jumped from 3.9.2 to 3.9.4 in about a week.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-04-05 19:32:00 +03:00
Jeffery To 6d9005d5ac
python3: Update to 3.9.2, refresh patches
Includes fixes for:
* CVE-2021-3177 - ctypes: Buffer overflow in PyCArg_repr
* CVE-2021-23336 - urllib parse_qsl(): Web cache poisoning - semicolon
  as a query args separator

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-02-22 21:58:56 +08:00
Alexandru Ardelean 571dd8e40a python3: bump to version 3.9.1
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2020-12-14 08:32:23 +02:00
Alexandru Ardelean cc332fddaa python3: bump to version 3.9.0
Refreshed patches.

Dropped 'patches-setuptools/004-site-patch.patch'
Does not apply anymore. Setuptools has removed site.py support:
   https://github.com/pypa/setuptools/issues/2165
If this is still needed, we may need to re-think it's implementation.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2020-10-19 11:01:12 +03:00
Jeffery To 7d6fcf20e7
python3: Update to 3.8.5
This version includes fixes for:
* CVE-2020-15801 - Fixes python3x._pth being ignored on Windows
* CVE-2019-20907 - Avoid infinite loop when reading specially crafted
  TAR files using the tarfile module

This also:
* Remove patches that are included in the update
* Add a dependency in python3-distutils for python3-email[1]

[1]: https://github.com/python/cpython/blob/v3.8.5/Lib/distutils/dist.py#L10

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-07-27 04:33:28 +08:00
Jeffery To 1a3cef77d4
python3: Update to 3.8.4, refresh/rework patches, backport patches
This version includes fixes for:
* CVE-2020-14422: Hash collisions in IPv4Interface and IPv6Interface
* CVE-2020-15523: Python uses invalid DLL path after calling Py_SetPath
  on Windows

This version also includes support for OpenSSL 1.1.x builds that use
'no-deprecated' and '--api=1.1.0'[1], and so this removes the previous
OpenSSL-related patches.

This also backports fixes for security issues, including:
* CVE-2019-20907: Infinite loop in the tarfile module

This also updates the setuptools and pip packages to 47.1.0 and 20.1.1,
respectively.

[1]: https://github.com/python/cpython/pull/20566

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-07-20 17:30:14 +08:00
Jeffery To 3c36696a56 python-packages: Add usr/bin symlinks without "3" suffix
Previously, binaries installed by Python packages will have a
non-suffixed Python 2 version and a suffixed Python 3 version, e.g. pip
and pip3. With the removal of Python 2, the non-suffixed names are no
longer taken.

This adds symlinks for the non-suffixed names linking to the suffixed
scripts (or in the case of pip, easy_install, and python-config, to the
fully-versioned scripts).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-22 03:57:55 +08:00
Jeffery To 70a7f736c5 python3-setuptools: Fix error when installing from source
When a Python package is installed from source (i.e. using setup.py)
into a custom location (with --home), setuptools may want to create a
site.py file in the custom location. This file is created based on the
source code of site-patch.py, a file bundled with setuptools.

Because the normal OpenWrt setuptools package does not contain Python
source code, this file is missing and the installation will end with an
error.

This copies site-patch.py to site-patch.py.txt so that it will be
included in python3-setuptools, and patches setuptools to look for this
file.

See https://github.com/openwrt/packages/issues/12223

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-21 20:02:13 +08:00
Jeffery To 0254a4bea9 python3: Update to 3.8.3, refresh patches
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-20 17:40:38 +08:00
Jeffery To 11bc05763d python3-pip: Fix error when installing packages that require compilation
This addresses one of the issues raised in #11912.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-24 21:09:37 +08:00
Jeffery To 932bfe4cf3 python3-pip: Symlink pip3 to pip3.8
Currently, python3-pip installs the same script as pip3 and pip3.8 to
usr/bin. This changes pip3 to be a symlink to pip3.8.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-04 06:21:39 +08:00
Jeffery To 7513448d20 python3: Update to 3.8.2, fix python3-xml dependency
xml.sax.saxutils has a dependency on urllib[1].

[1]: https://github.com/python/cpython/blob/v3.8.2/Lib/xml/sax/saxutils.py#L6

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-03-20 16:30:22 +08:00
Josef Schlehofer d2c997f39e
python3: Updated to version 3.8.1
Removed upstream patch: 002-fix-blake2-detection.patch

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2019-12-21 20:04:30 +01:00
Alexandru Ardelean 48277ec915 python3: bump to version 3.8
This required a bit work to get working, compared to other versions. So,
some things have changed a bit more significantly.

Some highlights:
* there is no longer a pgen executable, seems this is now part of
  libpython; let's see what this means for us in the future
* blake2 hash (from OpenSSL) detection needs some fixing; will upstream
  added patch 002-fix-blake2-detection.patch
* removed all bpo patches; those should be fixed in upstream
* some needed to be manually re-applied as stuff changed:
  - 001-enable-zlib.patch  - file changed
  - 004-do-not-write-bytes-codes.patch  - file changed
  - 015-abort-on-failed-modules.patch - variable was renamed
    cross_compiling -> CROSS_COMPILING
* 017_lib2to3_fix_pyc_search.patch - the code changed, it does not seem to
     have the original problem with respect to file-extension, as there
     does not seem to be any special extension logic anymore there
* 006-remove-multi-arch-and-local-paths.patch - dropped patch; I can't
     remember the full-details of this issue; it was something with
     Debian/Ubuntu's multi-arch stuff; it was probably added maybe due to
     some overzealous (on my part) thingy caused by some weird reports,
     that I could never solve; let's have this patch dropped and see
* make package/python3/refresh to reduce fuzz for the rest

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-10-21 15:24:51 +03:00
Josef Schlehofer ce769db007
python3: Update to version 3.7.4
- Update setuptools to 40.8.0
- Update pip to 19.0.3
- Refreshed patches
- Removed 4 patches (2 of them was included in 3.7.3 and other two are
included in this release)

Makefile python3:
- Move PKG_MAINTAINER above PKG_LICENSE

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2019-07-10 10:11:50 +02:00
Jeffery To da35e6770d python-setuptools: Add reproducibility patches from Debian
This adds the ability to patch setuptools (and pip), and adds 3
reproducibility patches from Debian[1].
(003-PKG-INFO-output-reproducible.patch addresses the issue identified
in #9039.)

The patching is not perfect, in that the patches are applied to
setuptools and pip after they have been installed, since they are
installed from wheels which are already "precompiled".

Also, patching for the host install cannot be updated in place, for
example if a patch is added or removed.

[1]: https://sources.debian.org/patches/python-setuptools/40.8.0-1/

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-05-24 13:18:09 +08:00
Eneas U de Queiroz 5f447b9020
python-python3-pip: add LICENSE information
CVE id was left commented out as it is not handled by uscan.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2019-05-21 14:46:13 -03:00
Eneas U de Queiroz bbd4930ccd
python-python3-setuptools: add LICENSE information
CVE id was left commented out as it is not handled by uscan.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2019-05-21 14:44:40 -03:00
Daniel F. Dickinson a37a0e8a4d python3: Fix py3 pip and setuptools versions
The update to Python 3.7.2 missed updating pip and setuptools versions,
so fix that.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-01-02 02:59:08 -05:00
Alexandru Ardelean 1e9a248a56 python3: bump to version 3.7.2
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2018-12-31 19:26:46 +02:00
Jeffery To 2f55f2a7b5 python/python3: fix .dist-info missing for setuptools and pip
Without .dist-info (similar to .egg-info), setuptools and pip are not
discoverable by pkg_resources.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2018-12-22 22:16:52 +08:00
Alexandru Ardelean 178ffb41f1 python3: bump to version 3.7.1
This change bumps Python3 version to 3.7.1.
Patch `002-fix-implicit-dh-free-declaration.patch` is now included in
upstream.
This also fixes CVE-2018-1061.
   https://www.cvedetails.com/cve/CVE-2018-1061/

Compile & run-tested on x86.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2018-11-02 09:58:57 +02:00
Martin Strobel fe01c8fc05 python3: update to python 3.7.0
Fixes python3 host SSL build -> host-pip can use https:// urls again.
Updates Pip to 10.0.1
rebased patches

Signed-off-by: Martin Strobel <arctus@crza.de>
2018-07-11 06:34:54 +02:00
Alexandru Ardelean b7d1d2149e python3: update to version 3.6.5
Add PKG_RELEASE for setuptools and pip.
Refresh all patches.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2018-05-03 14:46:35 +03:00
Alexandru Ardelean ccdc6bc530 python,python3: export mk files outside of python package dirs
Since `lang/python` is it's own folder of Python packages
(for both Python 2 & 3), and these build rules are needed
in a lot of packages [especially Python packages],
putting them here makes sense architecturally,
to be shared.

This also helps get rid of the `include_mk` construct
which relies on OpenWrt core to provide, and seems
like a broken design idea that has persisted for a while.
Reason is: it requires that Python 2/3 be built to provide
these mk files for other Python packages,
which seems like a bad idea.

Long-term, there could be an issue where some other feeds
would require these mk files [e.g. telephony] for
some Python packages.
We'll see how we handle this a bit later.

For now we limit this to this feed.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2018-01-10 23:01:51 +02:00