From cc41cf404145356b3db598ab60bf55c29c0c5f58 Mon Sep 17 00:00:00 2001 From: Rmys Date: Fri, 27 Oct 2023 21:49:03 +0300 Subject: [PATCH] py3-setuptools reebuild --- .../python3/python3-setuptools/actions.py | 10 +++ .../gentoo/setuptools-62.4.0-py-compile.patch | 86 +++++++++++++++++++ .../python3/python3-setuptools/pspec.xml | 10 +++ 3 files changed, 106 insertions(+) create mode 100644 programming/language/python3/python3-setuptools/files/gentoo/setuptools-62.4.0-py-compile.patch diff --git a/programming/language/python3/python3-setuptools/actions.py b/programming/language/python3/python3-setuptools/actions.py index 7fceeb23..42eccda5 100644 --- a/programming/language/python3/python3-setuptools/actions.py +++ b/programming/language/python3/python3-setuptools/actions.py @@ -20,3 +20,13 @@ def build(): def install(): pythonmodules.install(pyVer="3") + + pisitools.removeDir("/usr/lib/python3.11/site-packages/setuptools/_vendor") + pisitools.removeDir("/usr/lib/python3.11/site-packages/pkg_resources/_vendor") + + pisitools.removeDir("/usr/lib/python3.11/site-packages/setuptools/extern") + pisitools.removeDir("/usr/lib/python3.11/site-packages/pkg_resources/extern") + + shelltools.system("find %s -name '*.py' -exec sed \ + -e 's:from \w*[.]\+extern ::' -e 's:\w*[.]\+extern[.]::' \ + -i {} + || die" % get.installDIR()) diff --git a/programming/language/python3/python3-setuptools/files/gentoo/setuptools-62.4.0-py-compile.patch b/programming/language/python3/python3-setuptools/files/gentoo/setuptools-62.4.0-py-compile.patch new file mode 100644 index 00000000..09d630b3 --- /dev/null +++ b/programming/language/python3/python3-setuptools/files/gentoo/setuptools-62.4.0-py-compile.patch @@ -0,0 +1,86 @@ +From 8911d627245f4389488c5d65cce6d1258f4cce7b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Tue, 14 Jun 2022 05:58:20 +0200 +Subject: [PATCH] make -OO enable both opt-1 and opt-2 + +--- + setuptools/_distutils/command/build_py.py | 10 ++++------ + setuptools/_distutils/command/install_lib.py | 14 ++++++-------- + 2 files changed, 10 insertions(+), 14 deletions(-) + +diff --git a/setuptools/_distutils/command/build_py.py b/setuptools/_distutils/command/build_py.py +index 1b22004e..88565bce 100644 +--- a/setuptools/_distutils/command/build_py.py ++++ b/setuptools/_distutils/command/build_py.py +@@ -325,11 +325,9 @@ class build_py(Command): + outputs.append( + importlib.util.cache_from_source(filename, optimization='') + ) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + outputs.append( +- importlib.util.cache_from_source( +- filename, optimization=self.optimize +- ) ++ importlib.util.cache_from_source(filename, optimization=opt) + ) + + outputs += [ +@@ -403,10 +401,10 @@ class build_py(Command): + byte_compile( + files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run + ) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + byte_compile( + files, +- optimize=self.optimize, ++ optimize=opt, + force=self.force, + prefix=prefix, + dry_run=self.dry_run, +diff --git a/setuptools/_distutils/command/install_lib.py b/setuptools/_distutils/command/install_lib.py +index ad3089c8..7f906a29 100644 +--- a/setuptools/_distutils/command/install_lib.py ++++ b/setuptools/_distutils/command/install_lib.py +@@ -25,8 +25,8 @@ class install_lib(Command): + # 2) compile .pyc only (--compile --no-optimize; default) + # 3) compile .pyc and "opt-1" .pyc (--compile --optimize) + # 4) compile "opt-1" .pyc only (--no-compile --optimize) +- # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more) +- # 6) compile "opt-2" .pyc only (--no-compile --optimize-more) ++ # 5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more) ++ # 6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more) + # + # The UI for this is two options, 'compile' and 'optimize'. + # 'compile' is strictly boolean, and only decides whether to +@@ -142,10 +142,10 @@ class install_lib(Command): + prefix=install_root, + dry_run=self.dry_run, + ) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + byte_compile( + files, +- optimize=self.optimize, ++ optimize=opt, + force=self.force, + prefix=install_root, + verbose=self.verbose, +@@ -182,11 +182,9 @@ class install_lib(Command): + bytecode_files.append( + importlib.util.cache_from_source(py_file, optimization='') + ) +- if self.optimize > 0: ++ for opt in range(1, self.optimize + 1): + bytecode_files.append( +- importlib.util.cache_from_source( +- py_file, optimization=self.optimize +- ) ++ importlib.util.cache_from_source(py_file, optimization=opt) + ) + + return bytecode_files +-- +2.35.1 + diff --git a/programming/language/python3/python3-setuptools/pspec.xml b/programming/language/python3/python3-setuptools/pspec.xml index 54e55896..ab0b5c14 100644 --- a/programming/language/python3/python3-setuptools/pspec.xml +++ b/programming/language/python3/python3-setuptools/pspec.xml @@ -20,6 +20,9 @@ python3-setuptools + + gentoo/setuptools-62.4.0-py-compile.patch + @@ -36,6 +39,13 @@ + + 2023-10-27 + 68.2.2 + Rebuild. + Mustafa Cinasal + muscnsl@gmail.com + 2023-10-16 68.2.2