]> git.pld-linux.org Git - packages/python-virtualenv.git/commitdiff
bring back lib <-> lib{64,x32} symlink; rel 2 auto/th/python-virtualenv-20.13.0-2
authorJan Palus <atler@pld-linux.org>
Tue, 18 Jan 2022 21:49:32 +0000 (22:49 +0100)
committerJan Palus <atler@pld-linux.org>
Tue, 18 Jan 2022 21:49:32 +0000 (22:49 +0100)
new virtualenv no longer creates lib64 symlink which causes issues
primarily in mozilla tooling due to mismatch between arch specific lib
dir in virtualenv and generic 'lib' returned by
distutils.sysconfig.get_python_lib(). proper solution would be either:

1. modify virtualenv not to prefer distutils from setuptools wheel
   (implications unknown)

2. prepare patched setuptools wheel
   * patch distutils embedded in setuptools same way as we patch
     python3:
+        if plat_specific or standard_lib or prefix != "/usr":
   * start creating setuptools wheel
   * point virtualenv to our custom wheel (https://virtualenv.pypa.io/en/20.13.0/user_guide.html#embed-wheels-for-distributions)

multilib.patch [new file with mode: 0644]
python-virtualenv.spec

diff --git a/multilib.patch b/multilib.patch
new file mode 100644 (file)
index 0000000..bddc71b
--- /dev/null
@@ -0,0 +1,31 @@
+--- virtualenv-20.13.0/src/virtualenv/create/via_global_ref/builtin/via_global_self_do.py.orig 2022-01-02 16:54:28.000000000 +0100
++++ virtualenv-20.13.0/src/virtualenv/create/via_global_ref/builtin/via_global_self_do.py      2022-01-18 22:37:40.976826916 +0100
+@@ -10,6 +10,8 @@
+ from ..api import ViaGlobalRefApi, ViaGlobalRefMeta
+ from .builtin_way import VirtualenvBuiltin
++import os
++import sys
+ class BuiltinViaGlobalRefMeta(ViaGlobalRefMeta):
+     def __init__(self):
+@@ -82,6 +83,7 @@
+                 dirs.remove(directory)
+         for directory in sorted(dirs):
+             ensure_dir(directory)
++        self.symlink_libdir()
+         self.set_pyenv_cfg()
+         self.pyenv_cfg.write()
+@@ -112,3 +114,11 @@
+         self.pyenv_cfg["base-prefix"] = self.interpreter.system_prefix
+         self.pyenv_cfg["base-exec-prefix"] = self.interpreter.system_exec_prefix
+         self.pyenv_cfg["base-executable"] = self.interpreter.system_executable
++
++    def symlink_libdir(self):
++        lib_arch = None
++        for lib in [ 'lib64', 'libx32']:
++            if any(lib in p for p in sys.path):
++                lib_arch = lib
++        if lib_arch and (self.dest / lib_arch).exists() and not (self.dest / 'lib').exists():
++            os.symlink(lib_arch, str(self.dest / 'lib'))
index 7594dc5ca7af499940f12b4388a1173239744f3d..d359e3e47c58dfc8d275f412b5dfa118491fd3f2 100644 (file)
@@ -10,12 +10,13 @@ Summary:    Tool to create isolated Python environments
 Summary(pl.UTF-8):     Narzędzie do tworzenia oddzielonych środowisk Pythona
 Name:          python-virtualenv
 Version:       20.13.0
-Release:       1
+Release:       2
 License:       MIT
 Group:         Development/Languages
 #Source0Download: https://pypi.org/simple/virtualenv/
 Source0:       https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
 # Source0-md5: 95176f0639dc033650f0f3f9fdff299e
+Patch0:                multilib.patch
 URL:           https://pypi.org/project/virtualenv/
 %if %{with python2}
 BuildRequires: python >= 1:2.7
@@ -124,6 +125,7 @@ Project. Zostało wydane na liberalnej licencji w stylu MIT.
 
 %prep
 %setup -q -n virtualenv-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
This page took 0.164621 seconds and 4 git commands to generate.