]> git.pld-linux.org Git - packages/python3.git/blob - python3-multilib.patch
- purelib: directory for non-platform-specific files, rel 5
[packages/python3.git] / python3-multilib.patch
1 diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/sysconfig.py Python-3.9.2/Lib/distutils/sysconfig.py
2 --- Python-3.9.2.org/Lib/distutils/sysconfig.py 2021-02-19 13:31:44.000000000 +0100
3 +++ Python-3.9.2/Lib/distutils/sysconfig.py     2021-02-25 18:40:00.705652346 +0100
4 @@ -145,13 +145,13 @@ def get_python_lib(plat_specific=0, stan
5              prefix = plat_specific and EXEC_PREFIX or PREFIX
6  
7      if os.name == "posix":
8 -        if plat_specific or standard_lib:
9 +        if plat_specific or standard_lib or prefix != "/usr":
10              # Platform-specific modules (any module from a non-pure-Python
11              # module distribution) or standard Python library modules.
12              libdir = sys.platlibdir
13          else:
14              # Pure Python
15 -            libdir = "lib"
16 +            libdir = "share"
17          libpython = os.path.join(prefix, libdir,
18                                   "python" + get_python_version())
19          if standard_lib:
20 diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/tests/test_install.py Python-3.9.2/Lib/distutils/tests/test_install.py
21 --- Python-3.9.2.org/Lib/distutils/tests/test_install.py        2021-02-19 13:31:44.000000000 +0100
22 +++ Python-3.9.2/Lib/distutils/tests/test_install.py    2021-02-25 18:40:00.705652346 +0100
23 @@ -56,7 +56,7 @@ class InstallTestCase(support.TempdirMan
24              expected = os.path.normpath(expected)
25              self.assertEqual(got, expected)
26  
27 -        libdir = os.path.join(destination, "lib", "python")
28 +        libdir = os.path.join(destination, sys.platlibdir, "python")
29          check_path(cmd.install_lib, libdir)
30          platlibdir = os.path.join(destination, sys.platlibdir, "python")
31          check_path(cmd.install_platlib, platlibdir)
32 diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py
33 --- Python-3.9.2.org/Lib/site.py        2021-02-19 13:31:44.000000000 +0100
34 +++ Python-3.9.2/Lib/site.py    2021-02-25 18:40:00.705652346 +0100
35 @@ -295,7 +295,7 @@
36      if sys.platform == 'darwin' and sys._framework:
37          return f'{userbase}/lib/python/site-packages'
38  
39 -    return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
40 +    return f'{userbase}/{sys.platlibdir}/python{version[0]}.{version[1]}/site-packages'
41  
42  
43  def getuserbase():
44 @@ -344,6 +344,8 @@ def getsitepackages(prefixes=None):
45                                      "python%d.%d" % sys.version_info[:2],
46                                      "site-packages")
47                  sitepackages.append(path)
48 +            sitepackages.append(os.path.join(prefix, sys.platlibdir, "site-python"))
49 +            sitepackages.append(os.path.join(prefix, "share", "python%d.%d" % sys.version_info[:2], "site-packages"))
50          else:
51              sitepackages.append(prefix)
52  
53 diff -urNp -x '*.orig' Python-3.9.2.org/Lib/sysconfig.py Python-3.9.2/Lib/sysconfig.py
54 --- Python-3.9.2.org/Lib/sysconfig.py   2021-02-19 13:31:44.000000000 +0100
55 +++ Python-3.9.2/Lib/sysconfig.py       2021-02-25 18:40:00.705652346 +0100
56 @@ -27,7 +27,7 @@
57      'posix_prefix': {
58          'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
59          'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
60 -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
61 +        'purelib': '{base}/share/python{py_version_short}/site-packages',
62          'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
63          'include':
64              '{installed_base}/include/python{py_version_short}{abiflags}',
65 @@ -37,10 +37,10 @@ _INSTALL_SCHEMES = {
66          'data': '{base}',
67          },
68      'posix_home': {
69 -        'stdlib': '{installed_base}/lib/python',
70 -        'platstdlib': '{base}/lib/python',
71 -        'purelib': '{base}/lib/python',
72 -        'platlib': '{base}/lib/python',
73 +        'stdlib': '{installed_base}/{platlibdir}/python',
74 +        'platstdlib': '{base}/{platlibdir}/python',
75 +        'purelib': '{base}/share/python',
76 +        'platlib': '{base}/{platlibdir}/python',
77          'include': '{installed_base}/include/python',
78          'platinclude': '{installed_base}/include/python',
79          'scripts': '{base}/bin',
80 @@ -100,8 +100,8 @@ if _HAS_USER_BASE:
81          'posix_user': {
82              'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
83              'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
84 -            'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
85 -            'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
86 +            'purelib': '{userbase}/share/python{py_version_short}/site-packages',
87 +            'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
88              'include': '{userbase}/include/python{py_version_short}',
89              'scripts': '{userbase}/bin',
90              'data': '{userbase}',
91 @@ -490,7 +490,11 @@ def get_config_h_filename():
92          else:
93              inc_dir = _sys_home or _PROJECT_BASE
94      else:
95 -        inc_dir = get_path('platinclude')
96 +        if hasattr(sys, 'abiflags'):
97 +            config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
98 +        else:
99 +            config_dir_name = 'config'
100 +        inc_dir = os.path.join(get_path('stdlib'), config_dir_name)
101      return os.path.join(inc_dir, 'pyconfig.h')
102  
103
104 --- Python-3.10.0/Makefile.pre.in~      2021-10-04 19:40:46.000000000 +0200
105 +++ Python-3.10.0/Makefile.pre.in       2021-10-20 22:21:30.573156183 +0200
106 @@ -1707,9 +1707,9 @@ libainstall:      @DEF_MAKE_RULE@ python-conf
107                 if test -d $(LIBRARY); then :; else \
108                         if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
109                                 if test "$(SHLIB_SUFFIX)" = .dll; then \
110 -                                       $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
111 +                                       $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
112                                 else \
113 -                                       $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
114 +                                       $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \
115                                 fi; \
116                         else \
117                                 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
118 diff -urNp -x '*.orig' Python-3.9.2.org/setup.py Python-3.9.2/setup.py
119 --- Python-3.9.2.org/setup.py   2021-02-19 13:31:44.000000000 +0100
120 +++ Python-3.9.2/setup.py       2021-02-25 18:40:00.708985783 +0100
121 @@ -750,7 +750,7 @@ class PyBuildExt(build_ext):
122              add_dir_to_list(self.compiler.include_dirs,
123                              sysconfig.get_config_var("INCLUDEDIR"))
124  
125 -        system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
126 +        system_lib_dirs = ['/' + sys.platlibdir, '/usr/' + sys.platlibdir]
127          system_include_dirs = ['/usr/include']
128          # lib_dirs and inc_dirs are used to search for files;
129          # if a file is found in one of those directories, it can
130 @@ -1039,11 +1039,11 @@ class PyBuildExt(build_ext):
131              elif curses_library:
132                  readline_libs.append(curses_library)
133              elif self.compiler.find_library_file(self.lib_dirs +
134 -                                                     ['/usr/lib/termcap'],
135 +                                                     ['/usr/' + sys.platlibdir + '/termcap'],
136                                                       'termcap'):
137                  readline_libs.append('termcap')
138              self.add(Extension('readline', ['readline.c'],
139 -                               library_dirs=['/usr/lib/termcap'],
140 +                               library_dirs=['/usr/' + sys.platlibdir + '/termcap'],
141                                 extra_link_args=readline_extra_link_args,
142                                 libraries=readline_libs))
143          else:
144 --- Python-3.10.3/Lib/test/test_sysconfig.py~   2022-03-16 12:27:11.000000000 +0100
145 +++ Python-3.10.3/Lib/test/test_sysconfig.py    2022-03-22 23:11:16.335919644 +0100
146 @@ -299,13 +299,13 @@
147                  expected = global_path.replace(base, user, 1)
148                  # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
149                  # whereas posix_prefix does.
150 -                if name == 'platlib':
151 +                if name != 'platlib':
152                      # Replace "/lib64/python3.11/site-packages" suffix
153                      # with "/lib/python3.11/site-packages".
154                      py_version_short = sysconfig.get_python_version()
155                      suffix = f'python{py_version_short}/site-packages'
156 -                    expected = expected.replace(f'/{sys.platlibdir}/{suffix}',
157 -                                                f'/lib/{suffix}')
158 +                    expected = expected.replace(f'/lib/{suffix}',
159 +                                                f'/{sys.platlibdir}/{suffix}')
160                  self.assertEqual(user_path, expected)
161  
162      def test_main(self):
This page took 0.06678 seconds and 3 git commands to generate.