Comment 20 for bug 248558

Revision history for this message
In , Thomas (thomas-redhat-bugs) wrote :

Here's a naive patch:

Index: python-virtualenv.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-virtualenv/devel/python-virtualenv.spec,v
retrieving revision 1.5
diff -r1.5 python-virtualenv.spec
12a13
> Patch0: virtualenv-lib64.patch
28c29,33
< %setup -q -n virtualenv-%{version}
---
> %setup0 -q -n virtualenv-%{version}
> %if "%{_lib}" == "lib64"
> %patch0 -p1 -b .lib64
> %endif
> %{__python} rebuild-script.py

diff -up virtualenv-1.3.1/support-files/site.py.orig virtualenv-1.3.1/support-files/site.py
--- virtualenv-1.3.1/support-files/site.py.orig 2008-11-25 03:27:26.000000000 +0100
+++ virtualenv-1.3.1/support-files/site.py 2008-12-03 00:38:40.000000000 +0100
@@ -213,6 +213,10 @@ def addsitepackages(known_paths, sys_pre

             elif os.sep == '/':
                 sitedirs = [os.path.join(prefix,
+ "lib64",
+ "python" + sys.version[:3],
+ "site-packages"),
+ os.path.join(prefix,
                                          "lib",
                                          "python" + sys.version[:3],
                                          "site-packages"),

This seems to work, but now there are too many dirs in the path:

% /tmp/env/bin/python -c 'import sys, pprint; pprint.pprint(sys.path);'
['',
 '/tmp/env/lib64/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',
 '/tmp/env/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',
 '/tmp/env/lib64/python25.zip',
 '/tmp/env/lib64/python2.5',
 '/tmp/env/lib64/python2.5/plat-linux2',
 '/tmp/env/lib64/python2.5/lib-tk',
 '/tmp/env/lib64/python2.5/lib-dynload',
 '/usr/lib/python2.5',
 '/usr/lib64/python2.5',
 '/usr/lib64/python2.5/lib-tk',
 '/tmp/env/lib64/python2.5/site-packages',
 '/tmp/env/lib/python2.5/site-packages',
 '/usr/lib64/python2.5/site-packages',
 '/usr/lib64/python2.5/site-packages/Numeric',
 '/usr/lib64/python2.5/site-packages/PIL',
 '/usr/lib64/python2.5/site-packages/gst-0.10',
 '/usr/lib64/python2.5/site-packages/gtk-2.0',
 '/usr/lib/python2.5/site-packages']

Note that simply copying the system site.py did not work for me neither. According to a message found on their mailinglist, the version in the virtualenv package is slightly modified. So maybe the right way is to use system's site.py, but apply virtualenv's modfications.