[packages/python-virtualenv] - more x32 fixes, should work now on all archs - rel 3

baggins baggins at pld-linux.org
Wed Oct 19 09:17:54 CEST 2016


commit 0f8f7537b41132265c70ffa03a57ed358f2a636a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Oct 19 09:17:34 2016 +0200

    - more x32 fixes, should work now on all archs
    - rel 3

 multilib.patch         | 29 +++++++++++++++++++++++++++++
 python-virtualenv.spec |  8 +++++++-
 rebuild-support.patch  | 12 ++++++++++++
 unpack-support.py      | 23 +++++++++++++++++++++++
 4 files changed, 71 insertions(+), 1 deletion(-)
---
diff --git a/python-virtualenv.spec b/python-virtualenv.spec
index c99254f..a5607bf 100644
--- a/python-virtualenv.spec
+++ b/python-virtualenv.spec
@@ -9,13 +9,15 @@ Summary:	Tool to create isolated Python environments
 Summary(pl.UTF-8):	Narzędzie do tworzenia oddzielonych środowisk Pythona
 Name:		python-virtualenv
 Version:	15.0.1
-Release:	2
+Release:	3
 License:	MIT
 Group:		Development/Languages
 #Source0Download: https://pypi.python.org/simple/virtualenv/
 Source0:	https://pypi.python.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
 # Source0-md5:	28d76a0d9cbd5dc42046dd14e76a6ecc
+Source1:	unpack-support.py
 Patch0:		multilib.patch
+Patch1:		rebuild-support.patch
 URL:		https://pypi.python.org/pypi/virtualenv
 %if %{with python2}
 BuildRequires:	python >= 1:2.6
@@ -97,7 +99,11 @@ Project. Zostało wydane na liberalnej licencji w stylu MIT.
 
 %prep
 %setup -q -n virtualenv-%{version}
+install -p -p %{SOURCE1} bin
+%{__python} ./bin/unpack-support.py
 %patch0 -p1
+%patch1 -p1
+%{__python} ./bin/rebuild-script.py
 
 %build
 %if %{with python2}
diff --git a/multilib.patch b/multilib.patch
index b33ab80..8955bd6 100644
--- a/multilib.patch
+++ b/multilib.patch
@@ -64,3 +64,32 @@
  
  def resolve_interpreter(exe):
      """
+--- virtualenv-15.0.1/virtualenv_support/site.py~	2016-10-19 09:09:07.000000000 +0200
++++ virtualenv-15.0.1/virtualenv_support/site.py	2016-10-19 09:11:26.681732254 +0200
+@@ -243,6 +243,13 @@
+                         sitedirs.insert(0, lib64_dir)
+                     else:
+                         sitedirs.append(lib64_dir)
++                libx32_dir = os.path.join(prefix, "libx32", "python" + sys.version[:3], "site-packages")
++                if (os.path.exists(libx32_dir) and
++                    os.path.realpath(libx32_dir) not in [os.path.realpath(p) for p in sitedirs]):
++                    if _is_64bit:
++                        sitedirs.append(libx32_dir)
++                    else:
++                        sitedirs.insert(0, libx32_dir)
+                 try:
+                     # sys.getobjects only available in --with-pydebug build
+                     sys.getobjects
+@@ -589,6 +596,12 @@
+                 paths.insert(0, lib64_path)
+             else:
+                 paths.append(lib64_path)
++        libx32_path = os.path.join(sys.real_prefix, 'libx32', 'python'+sys.version[:3])
++        if os.path.exists(libx32_path):
++            if _is_64bit:
++                paths.append(libx32_path)
++            else:
++                paths.insert(0, libx32_path)
+         # This is hardcoded in the Python executable, but relative to
+         # sys.prefix.  Debian change: we need to add the multiarch triplet
+         # here, which is where the real stuff lives.  As per PEP 421, in
diff --git a/rebuild-support.patch b/rebuild-support.patch
new file mode 100644
index 0000000..7ad5f08
--- /dev/null
+++ b/rebuild-support.patch
@@ -0,0 +1,12 @@
+--- virtualenv-1.8.4/bin/rebuild-script.py	2011-08-31 12:30:48.000000000 +0200
++++ virtualenv-1.9.1/bin/rebuild-script.py	2013-04-05 20:06:30.000000000 +0200
+@@ -29,7 +29,7 @@
+         data = match.group(3)
+ 
+         print('Found file %s' % fn_decoded)
+-        pathname = os.path.join(here, '..', 'virtualenv_embedded', fn_decoded)
++        pathname = os.path.join(here, '..', 'virtualenv_support', fn_decoded)
+ 
+         with open(pathname, 'rb') as f:
+             embedded = f.read()
+
diff --git a/unpack-support.py b/unpack-support.py
new file mode 100644
index 0000000..d357315
--- /dev/null
+++ b/unpack-support.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import re
+import os
+import sys
+
+cmd_folder = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, os.path.join(cmd_folder, '..'))
+
+import virtualenv
+
+file_regex = re.compile(
+        r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)',
+        re.S)
+
+f = open('virtualenv.py', 'rb')
+content = f.read()
+f.close()
+match = None
+for match in file_regex.finditer(content):
+	f = open(os.path.join('virtualenv_support', match.group(1)), 'wb')
+	f.write(eval("virtualenv." + match.group(2)).encode('utf-8'))
+	f.close()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-virtualenv.git/commitdiff/0f8f7537b41132265c70ffa03a57ed358f2a636a



More information about the pld-cvs-commit mailing list