summaryrefslogtreecommitdiff
path: root/debian/patches/sysconfig-debian-schemes.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
commitc089c4500b0b78acf03ee5405ad250a84b0dfa66 (patch)
tree23870848d194569aff6e0e4e41bc7907960b1af1 /debian/patches/sysconfig-debian-schemes.diff
parent377002e7300431b68f3548d9fd2c7f99cf883939 (diff)
downloadpython3.7-debian.tar.gz
Import python3.7 (3.7.5-2)debian/3.7.5-2debian
Diffstat (limited to 'debian/patches/sysconfig-debian-schemes.diff')
-rw-r--r--debian/patches/sysconfig-debian-schemes.diff33
1 files changed, 27 insertions, 6 deletions
diff --git a/debian/patches/sysconfig-debian-schemes.diff b/debian/patches/sysconfig-debian-schemes.diff
index d26ee20..07eb5bf 100644
--- a/debian/patches/sysconfig-debian-schemes.diff
+++ b/debian/patches/sysconfig-debian-schemes.diff
@@ -1,8 +1,10 @@
# DP: Add schemes 'deb_system' and 'posix_local', make the latter the default
+Index: b/Lib/sysconfig.py
+===================================================================
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
-@@ -32,6 +32,30 @@
+@@ -31,6 +31,30 @@ _INSTALL_SCHEMES = {
'scripts': '{base}/bin',
'data': '{base}',
},
@@ -33,7 +35,7 @@
'posix_home': {
'stdlib': '{installed_base}/lib/python',
'platstdlib': '{base}/lib/python',
-@@ -162,7 +186,7 @@
+@@ -136,7 +160,7 @@ def is_python_build(check_home=False):
_PYTHON_BUILD = is_python_build(True)
if _PYTHON_BUILD:
@@ -42,7 +44,7 @@
_INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
_INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'
-@@ -200,7 +224,12 @@
+@@ -174,7 +198,16 @@ def _expand_vars(scheme, vars):
def _get_default_scheme():
if os.name == 'posix':
# the default scheme for posix is posix_prefix
@@ -51,12 +53,16 @@
+ # virtual environments
+ return 'posix_prefix'
+ else:
-+ # Debian default
-+ return 'posix_local'
++ # default to /usr for package builds, /usr/local otherwise
++ deb_build = os.environ.get('DEB_PYTHON_INSTALL_LAYOUT', 'posix_local')
++ if deb_build in ('deb', 'deb_system'):
++ return 'deb_system'
++ else:
++ return 'posix_local'
return os.name
-@@ -485,7 +514,7 @@
+@@ -472,7 +505,7 @@ def get_config_h_filename():
else:
inc_dir = _sys_home or _PROJECT_BASE
else:
@@ -65,3 +71,18 @@
return os.path.join(inc_dir, 'pyconfig.h')
+Index: b/Lib/test/test_sysconfig.py
+===================================================================
+--- a/Lib/test/test_sysconfig.py
++++ b/Lib/test/test_sysconfig.py
+@@ -227,8 +227,8 @@ class TestSysConfig(unittest.TestCase):
+ self.assertTrue(os.path.isfile(config_h), config_h)
+
+ def test_get_scheme_names(self):
+- wanted = ('nt', 'nt_user', 'osx_framework_user',
+- 'posix_home', 'posix_prefix', 'posix_user')
++ wanted = ('deb_system', 'nt', 'nt_user', 'osx_framework_user',
++ 'posix_home', 'posix_local', 'posix_prefix', 'posix_user')
+ self.assertEqual(get_scheme_names(), wanted)
+
+ @skip_unless_symlink