]> git.pld-linux.org Git - packages/python-virtualenv.git/commitdiff
- more x32 fixes, should work now on all archs auto/th/python-virtualenv-15.0.1-3
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 19 Oct 2016 07:17:34 +0000 (09:17 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Wed, 19 Oct 2016 07:17:34 +0000 (09:17 +0200)
- rel 3

multilib.patch
python-virtualenv.spec
rebuild-support.patch [new file with mode: 0644]
unpack-support.py [new file with mode: 0644]

index b33ab8086c3d90c7040f5a06970b3d4b0aa4d5c3..8955bd67aa475372d3c135e24d887f62e7c4c168 100644 (file)
  
  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
index c99254ff4f219687de9de3bcc9ccebd4e6606267..a5607bf111ebe9d87f90ab51a7362732e13b14f2 100644 (file)
@@ -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/rebuild-support.patch b/rebuild-support.patch
new file mode 100644 (file)
index 0000000..7ad5f08
--- /dev/null
@@ -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 (file)
index 0000000..d357315
--- /dev/null
@@ -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()
This page took 0.117879 seconds and 4 git commands to generate.