diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3-setuptools')
3 files changed, 89 insertions, 25 deletions
diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig.py-make-it-possible-to-substite.patch b/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig.py-make-it-possible-to-substite.patch new file mode 100644 index 0000000000..0f6c9d250d --- /dev/null +++ b/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig.py-make-it-possible-to-substite.patch @@ -0,0 +1,58 @@ +From d393759315b189a738e4b6a2ce31dc18dbbfae29 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Wed, 11 May 2022 21:41:14 +0200 +Subject: [PATCH] _distutils/sysconfig.py: make it possible to substite the + prefix to target sysroot + +This is done by probing STAGING_INCDIR/STAGING_LIBDIRenv vars: +not the most elegant solution, but distutils/sysconfig has been +tweaked to do this for many, many year, and so it's easiest +to replicate here as well, the original is +meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch + +I'm not sure exactly why setuptools now needs a copy, and what +would happen to this module in light of distutils deprecation. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + setuptools/_distutils/sysconfig.py | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py +index a40a723..14f35e7 100644 +--- a/setuptools/_distutils/sysconfig.py ++++ b/setuptools/_distutils/sysconfig.py +@@ -119,6 +119,8 @@ def get_python_inc(plat_specific=0, prefix=None): + sys.base_exec_prefix -- i.e., ignore 'plat_specific'. + """ + default_prefix = BASE_EXEC_PREFIX if plat_specific else BASE_PREFIX ++ if os.environ.get('STAGING_INCDIR', ""): ++ default_prefix = os.environ['STAGING_INCDIR'].rstrip('include') + resolved_prefix = prefix if prefix is not None else default_prefix + try: + getter = globals()[f'_get_python_inc_{os.name}'] +@@ -238,7 +240,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + + early_prefix = prefix + +- if prefix is None: ++ if os.environ.get('STAGING_LIBDIR', ""): ++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] ++ else: ++ lib_basename = "lib" ++ if prefix is None and os.environ.get('STAGING_LIBDIR', ""): ++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) ++ elif prefix is None: + if standard_lib: + prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX + else: +@@ -253,7 +261,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + # Pure Python + libdir = "lib" + implementation = 'pypy' if IS_PYPY else 'python' +- libpython = os.path.join(prefix, libdir, implementation + get_python_version()) ++ libpython = os.path.join(prefix, lib_basename, implementation + get_python_version()) + return _posix_lib(standard_lib, libpython, early_prefix, prefix) + elif os.name == "nt": + if standard_lib: diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-change-shebang-to-python3.patch b/meta/recipes-devtools/python/python3-setuptools/0001-change-shebang-to-python3.patch deleted file mode 100644 index 6dcf52771b..0000000000 --- a/meta/recipes-devtools/python/python3-setuptools/0001-change-shebang-to-python3.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c39d0896930e25c224cc897660fc8511ccae30c8 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Thu, 23 Apr 2020 10:01:12 +0000 -Subject: [PATCH] change shebang to python3 - -Upstream-Status: Pending - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - pkg_resources/_vendor/appdirs.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/pkg_resources/_vendor/appdirs.py b/pkg_resources/_vendor/appdirs.py -index ae67001..933e398 100644 ---- a/pkg_resources/_vendor/appdirs.py -+++ b/pkg_resources/_vendor/appdirs.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # -*- coding: utf-8 -*- - # Copyright (c) 2005-2010 ActiveState Software Inc. - # Copyright (c) 2013 Eddy Petrișor --- -2.24.1 - diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-conditionally-do-not-fetch-code-by-easy_install.patch b/meta/recipes-devtools/python/python3-setuptools/0001-conditionally-do-not-fetch-code-by-easy_install.patch new file mode 100644 index 0000000000..e227c2889c --- /dev/null +++ b/meta/recipes-devtools/python/python3-setuptools/0001-conditionally-do-not-fetch-code-by-easy_install.patch @@ -0,0 +1,31 @@ +From 80fe63816eb3bfd1f5b6d354e1f2442805cff4e0 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 17 Jul 2018 10:13:38 +0800 +Subject: [PATCH] conditionally do not fetch code by easy_install + +If var-NO_FETCH_BUILD is set, do not allow to fetch code from +internet by easy_install. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + setuptools/command/easy_install.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py +index 858fb20..62bd853 100644 +--- a/setuptools/command/easy_install.py ++++ b/setuptools/command/easy_install.py +@@ -672,6 +672,11 @@ class easy_install(Command): + os.path.exists(tmpdir) and _rmtree(tmpdir) + + def easy_install(self, spec, deps=False): ++ if os.environ.get('NO_FETCH_BUILD', None): ++ log.error("ERROR: Do not try to fetch `%s' for building. " ++ "Please add its native recipe to DEPENDS." % spec) ++ return None ++ + with self._tmpdir() as tmpdir: + if not isinstance(spec, Requirement): + if URL_SCHEME(spec): |