]> git.pld-linux.org Git - packages/python-virtualenv.git/blob - virtualenv-pld.patch
31355f184aafbd9c70a2532de67e8e193e570180
[packages/python-virtualenv.git] / virtualenv-pld.patch
1 --- virtualenv-1.8.4/virtualenv.py.orig 2012-11-25 18:11:26.000000000 +0100
2 +++ virtualenv-1.8.4/virtualenv.py      2013-01-11 18:31:34.212018758 +0100
3 @@ -72,7 +72,11 @@
4                      'fnmatch', 'locale', 'encodings', 'codecs',
5                      'stat', 'UserDict', 'readline', 'copy_reg', 'types',
6                      're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile',
7 -                    'zlib']
8 +                    'zlib', 'time', 'cStringIO', 'md5', '_hashlib', '_struct', 'bz2',
9 +                    '_collections', 'operator', 'itertools', 'math', 'binascii', 
10 +                    '_random', '_io', '_functools', 'array', '_socket', '_ssl', 'select',
11 +                    'fcntl', 'cPickle', 'datetime', 'syslog', '_sqlite3', 'unicodedata',
12 +                    'parser', 'simplejson', 'multiprocessing', '_multiprocessing']
13  
14  REQUIRED_FILES = ['lib-dynload', 'config']
15  
16 @@ -1118,18 +1122,8 @@
17          inc_dir = join(home_dir, 'include')
18          bin_dir = join(home_dir, 'bin')
19      elif not is_win:
20 -        lib_dir = join(home_dir, 'lib', py_version)
21 -        multiarch_exec = '/usr/bin/multiarch-platform'
22 -        if is_executable_file(multiarch_exec):
23 -            # In Mageia (2) and Mandriva distros the include dir must be like:
24 -            # virtualenv/include/multiarch-x86_64-linux/python2.7
25 -            # instead of being virtualenv/include/python2.7
26 -            p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
27 -            stdout, stderr = p.communicate()
28 -            # stdout.strip is needed to remove newline character
29 -            inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags)
30 -        else:
31 -            inc_dir = join(home_dir, 'include', py_version + abiflags)
32 +        lib_dir = join(home_dir, sys.lib, py_version)
33 +        inc_dir = join(home_dir, 'include', py_version + abiflags)
34          bin_dir = join(home_dir, 'bin')
35      return home_dir, lib_dir, inc_dir, bin_dir
36  
37 @@ -1234,7 +1228,6 @@
38      else:
39          prefix = sys.prefix
40      mkdir(lib_dir)
41 -    fix_lib64(lib_dir)
42      stdlib_dirs = [os.path.dirname(os.__file__)]
43      if is_win:
44          stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
45 @@ -1267,6 +1260,15 @@
46          site_filename = site_filename.replace('$py.class', '.py')
47      site_filename_dst = change_prefix(site_filename, home_dir)
48      site_dir = os.path.dirname(site_filename_dst)
49 +    # PLD fix
50 +    try:
51 +        os.symlink(
52 +            make_relative_path(os.path.join(site_dir, 'site-packages'),
53 +                   os.path.join(lib_dir, 'site-packages')),
54 +           os.path.join(site_dir, 'site-packages')
55 +        )
56 +    except (OSError, NotImplementedError):
57 +        logger.info('Symlinking site-packages failed.')
58      writefile(site_filename_dst, SITE_PY)
59      writefile(join(site_dir, 'orig-prefix.txt'), prefix)
60      site_packages_filename = join(site_dir, 'no-global-site-packages.txt')
61 @@ -1304,7 +1306,7 @@
62          elif is_jython:
63              exec_dir = join(sys.exec_prefix, 'Lib')
64          else:
65 -            exec_dir = join(sys.exec_prefix, 'lib', py_version)
66 +            exec_dir = join(sys.exec_prefix, sys.lib, py_version)
67          for fn in os.listdir(exec_dir):
68              copyfile(join(exec_dir, fn), join(lib_dir, fn))
69  
70 @@ -1616,27 +1618,6 @@
71                      os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \
72                                                              os.path.join(local_path, subdir_name))
73  
74 -def fix_lib64(lib_dir):
75 -    """
76 -    Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
77 -    instead of lib/pythonX.Y.  If this is such a platform we'll just create a
78 -    symlink so lib64 points to lib
79 -    """
80 -    if [p for p in distutils.sysconfig.get_config_vars().values()
81 -        if isinstance(p, basestring) and 'lib64' in p]:
82 -        logger.debug('This system uses lib64; symlinking lib64 to lib')
83 -        assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
84 -            "Unexpected python lib dir: %r" % lib_dir)
85 -        lib_parent = os.path.dirname(lib_dir)
86 -        top_level = os.path.dirname(lib_parent)
87 -        lib_dir = os.path.join(top_level, 'lib')
88 -        lib64_link = os.path.join(top_level, 'lib64')
89 -        assert os.path.basename(lib_parent) == 'lib', (
90 -            "Unexpected parent dir: %r" % lib_parent)
91 -        if os.path.lexists(lib64_link):
92 -            return
93 -        os.symlink('lib', lib64_link)
94 -
95  def resolve_interpreter(exe):
96      """
97      If the executable given isn't an absolute path, search $PATH for the interpreter
98 --- virtualenv-1.8.4/virtualenv_support/site.py.orig    2013-01-11 17:58:03.708727329 +0100
99 +++ virtualenv-1.8.4/virtualenv_support/site.py 2013-01-11 18:39:25.132008943 +0100
100 @@ -226,42 +226,25 @@
101                                  os.path.join(prefix, "Extras", "lib", "python")]
102  
103                  else: # any other Python distros on OSX work this way
104 -                    sitedirs = [os.path.join(prefix, "lib",
105 +                    sitedirs = [os.path.join(prefix, sys.lib,
106                                               "python" + sys.version[:3], "site-packages")]
107  
108              elif os.sep == '/':
109                  sitedirs = [os.path.join(prefix,
110 -                                         "lib",
111 +                                         sys.lib,
112                                           "python" + sys.version[:3],
113                                           "site-packages"),
114 -                            os.path.join(prefix, "lib", "site-python"),
115 +                            os.path.join(prefix, sys.lib, "site-python"),
116                              os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")]
117 -                lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages")
118 -                if (os.path.exists(lib64_dir) and
119 -                    os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]):
120 -                    if _is_64bit:
121 -                        sitedirs.insert(0, lib64_dir)
122 -                    else:
123 -                        sitedirs.append(lib64_dir)
124                  try:
125                      # sys.getobjects only available in --with-pydebug build
126                      sys.getobjects
127                      sitedirs.insert(0, os.path.join(sitedirs[0], 'debug'))
128                  except AttributeError:
129                      pass
130 -                # Debian-specific dist-packages directories:
131 -                if sys.version[0] == '2':
132 -                    sitedirs.append(os.path.join(prefix, "lib",
133 -                                                 "python" + sys.version[:3],
134 -                                                 "dist-packages"))
135 -                else:
136 -                    sitedirs.append(os.path.join(prefix, "lib",
137 -                                                 "python" + sys.version[0],
138 -                                                 "dist-packages"))
139 -                sitedirs.append(os.path.join(prefix, "local/lib",
140 -                                             "python" + sys.version[:3],
141 -                                             "dist-packages"))
142 -                sitedirs.append(os.path.join(prefix, "lib", "dist-python"))
143 +                # PLD-specific noarch directory:
144 +                sitedirs.append(os.path.join(prefix, "share",
145 +                        "python" + sys.version[:3]))
146              else:
147                  sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
148              if sys.platform == 'darwin':
149 @@ -577,14 +560,9 @@
150      elif sys.platform == 'win32':
151          paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')]
152      else:
153 -        paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])]
154 +        paths = [os.path.join(sys.real_prefix, sys.lib, 'python'+sys.version[:3]),
155 +                os.path.join(sys.real_prefix, 'share', 'python'+sys.version[:3])]
156          hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below
157 -        lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3])
158 -        if os.path.exists(lib64_path):
159 -            if _is_64bit:
160 -                paths.insert(0, lib64_path)
161 -            else:
162 -                paths.append(lib64_path)
163          # This is hardcoded in the Python executable, but relative to
164          # sys.prefix.  Debian change: we need to add the multiarch triplet
165          # here, which is where the real stuff lives.  As per PEP 421, in
166 @@ -595,7 +573,7 @@
167          except AttributeError:
168              # This is a non-multiarch aware Python.  Fallback to the old way.
169              arch = sys.platform
170 -        plat_path = os.path.join(sys.real_prefix, 'lib',
171 +        plat_path = os.path.join(sys.real_prefix, sys.lib,
172                                   'python'+sys.version[:3],
173                                   'plat-%s' % arch)
174          if os.path.exists(plat_path):
This page took 0.050412 seconds and 2 git commands to generate.