##// END OF EJS Templates
setup.py: do not install c extensions on pypy...
Joan Massich -
r24192:390410a6 default
parent child Browse files
Show More
@@ -1,646 +1,648
1 1 #
2 2 # This is the mercurial setup script.
3 3 #
4 4 # 'python setup.py install', or
5 5 # 'python setup.py --help' for more options
6 6
7 7 import sys, platform
8 8 if getattr(sys, 'version_info', (0, 0, 0)) < (2, 4, 0, 'final'):
9 9 raise SystemExit("Mercurial requires Python 2.4 or later.")
10 10
11 11 if sys.version_info[0] >= 3:
12 12 def b(s):
13 13 '''A helper function to emulate 2.6+ bytes literals using string
14 14 literals.'''
15 15 return s.encode('latin1')
16 16 printf = eval('print')
17 17 libdir_escape = 'unicode_escape'
18 18 else:
19 19 libdir_escape = 'string_escape'
20 20 def b(s):
21 21 '''A helper function to emulate 2.6+ bytes literals using string
22 22 literals.'''
23 23 return s
24 24 def printf(*args, **kwargs):
25 25 f = kwargs.get('file', sys.stdout)
26 26 end = kwargs.get('end', '\n')
27 27 f.write(b(' ').join(args) + end)
28 28
29 29 # Solaris Python packaging brain damage
30 30 try:
31 31 import hashlib
32 32 sha = hashlib.sha1()
33 33 except ImportError:
34 34 try:
35 35 import sha
36 36 sha.sha # silence unused import warning
37 37 except ImportError:
38 38 raise SystemExit(
39 39 "Couldn't import standard hashlib (incomplete Python install).")
40 40
41 41 try:
42 42 import zlib
43 43 zlib.compressobj # silence unused import warning
44 44 except ImportError:
45 45 raise SystemExit(
46 46 "Couldn't import standard zlib (incomplete Python install).")
47 47
48 48 # The base IronPython distribution (as of 2.7.1) doesn't support bz2
49 49 isironpython = False
50 50 try:
51 51 isironpython = (platform.python_implementation()
52 52 .lower().find("ironpython") != -1)
53 53 except AttributeError:
54 54 pass
55 55
56 56 if isironpython:
57 57 sys.stderr.write("warning: IronPython detected (no bz2 support)\n")
58 58 else:
59 59 try:
60 60 import bz2
61 61 bz2.BZ2Compressor # silence unused import warning
62 62 except ImportError:
63 63 raise SystemExit(
64 64 "Couldn't import standard bz2 (incomplete Python install).")
65 65
66 ispypy = "PyPy" in sys.version
67
66 68 import os, stat, subprocess, time
67 69 import re
68 70 import shutil
69 71 import tempfile
70 72 from distutils import log
71 73 from distutils.core import setup, Command, Extension
72 74 from distutils.dist import Distribution
73 75 from distutils.command.build import build
74 76 from distutils.command.build_ext import build_ext
75 77 from distutils.command.build_py import build_py
76 78 from distutils.command.install_lib import install_lib
77 79 from distutils.command.install_scripts import install_scripts
78 80 from distutils.spawn import spawn, find_executable
79 81 from distutils import file_util
80 82 from distutils.errors import CCompilerError, DistutilsExecError
81 83 from distutils.sysconfig import get_python_inc, get_config_var
82 84 from distutils.version import StrictVersion
83 85
84 86 convert2to3 = '--c2to3' in sys.argv
85 87 if convert2to3:
86 88 try:
87 89 from distutils.command.build_py import build_py_2to3 as build_py
88 90 from lib2to3.refactor import get_fixers_from_package as getfixers
89 91 except ImportError:
90 92 if sys.version_info[0] < 3:
91 93 raise SystemExit("--c2to3 is only compatible with python3.")
92 94 raise
93 95 sys.path.append('contrib')
94 96 elif sys.version_info[0] >= 3:
95 97 raise SystemExit("setup.py with python3 needs --c2to3 (experimental)")
96 98
97 99 scripts = ['hg']
98 100 if os.name == 'nt':
99 101 scripts.append('contrib/win32/hg.bat')
100 102
101 103 # simplified version of distutils.ccompiler.CCompiler.has_function
102 104 # that actually removes its temporary files.
103 105 def hasfunction(cc, funcname):
104 106 tmpdir = tempfile.mkdtemp(prefix='hg-install-')
105 107 devnull = oldstderr = None
106 108 try:
107 109 try:
108 110 fname = os.path.join(tmpdir, 'funcname.c')
109 111 f = open(fname, 'w')
110 112 f.write('int main(void) {\n')
111 113 f.write(' %s();\n' % funcname)
112 114 f.write('}\n')
113 115 f.close()
114 116 # Redirect stderr to /dev/null to hide any error messages
115 117 # from the compiler.
116 118 # This will have to be changed if we ever have to check
117 119 # for a function on Windows.
118 120 devnull = open('/dev/null', 'w')
119 121 oldstderr = os.dup(sys.stderr.fileno())
120 122 os.dup2(devnull.fileno(), sys.stderr.fileno())
121 123 objects = cc.compile([fname], output_dir=tmpdir)
122 124 cc.link_executable(objects, os.path.join(tmpdir, "a.out"))
123 125 except Exception:
124 126 return False
125 127 return True
126 128 finally:
127 129 if oldstderr is not None:
128 130 os.dup2(oldstderr, sys.stderr.fileno())
129 131 if devnull is not None:
130 132 devnull.close()
131 133 shutil.rmtree(tmpdir)
132 134
133 135 # py2exe needs to be installed to work
134 136 try:
135 137 import py2exe
136 138 py2exe.Distribution # silence unused import warning
137 139 py2exeloaded = True
138 140 # import py2exe's patched Distribution class
139 141 from distutils.core import Distribution
140 142 except ImportError:
141 143 py2exeloaded = False
142 144
143 145 def runcmd(cmd, env):
144 146 if (sys.platform == 'plan9'
145 147 and (sys.version_info[0] == 2 and sys.version_info[1] < 7)):
146 148 # subprocess kludge to work around issues in half-baked Python
147 149 # ports, notably bichued/python:
148 150 _, out, err = os.popen3(cmd)
149 151 return str(out), str(err)
150 152 else:
151 153 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
152 154 stderr=subprocess.PIPE, env=env)
153 155 out, err = p.communicate()
154 156 return out, err
155 157
156 158 def runhg(cmd, env):
157 159 out, err = runcmd(cmd, env)
158 160 # If root is executing setup.py, but the repository is owned by
159 161 # another user (as in "sudo python setup.py install") we will get
160 162 # trust warnings since the .hg/hgrc file is untrusted. That is
161 163 # fine, we don't want to load it anyway. Python may warn about
162 164 # a missing __init__.py in mercurial/locale, we also ignore that.
163 165 err = [e for e in err.splitlines()
164 166 if not e.startswith(b('not trusting file')) \
165 167 and not e.startswith(b('warning: Not importing')) \
166 168 and not e.startswith(b('obsolete feature not enabled'))]
167 169 if err:
168 170 printf("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
169 171 printf(b('\n').join([b(' ') + e for e in err]), file=sys.stderr)
170 172 return ''
171 173 return out
172 174
173 175 version = ''
174 176
175 177 # Execute hg out of this directory with a custom environment which
176 178 # includes the pure Python modules in mercurial/pure. We also take
177 179 # care to not use any hgrc files and do no localization.
178 180 pypath = ['mercurial', os.path.join('mercurial', 'pure')]
179 181 env = {'PYTHONPATH': os.pathsep.join(pypath),
180 182 'HGRCPATH': '',
181 183 'LANGUAGE': 'C'}
182 184 if 'LD_LIBRARY_PATH' in os.environ:
183 185 env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
184 186 if 'SystemRoot' in os.environ:
185 187 # Copy SystemRoot into the custom environment for Python 2.6
186 188 # under Windows. Otherwise, the subprocess will fail with
187 189 # error 0xc0150004. See: http://bugs.python.org/issue3440
188 190 env['SystemRoot'] = os.environ['SystemRoot']
189 191
190 192 if os.path.isdir('.hg'):
191 193 cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n']
192 194 numerictags = [t for t in runhg(cmd, env).split() if t[0].isdigit()]
193 195 hgid = runhg([sys.executable, 'hg', 'id', '-i'], env).strip()
194 196 if numerictags: # tag(s) found
195 197 version = numerictags[-1]
196 198 if hgid.endswith('+'): # propagate the dirty status to the tag
197 199 version += '+'
198 200 else: # no tag found
199 201 ltagcmd = [sys.executable, 'hg', 'parents', '--template',
200 202 '{latesttag}']
201 203 ltag = runhg(ltagcmd, env)
202 204 changessincecmd = [sys.executable, 'hg', 'log', '-T', 'x\n', '-r',
203 205 "only(.,'%s')" % ltag]
204 206 changessince = len(runhg(changessincecmd, env).splitlines())
205 207 version = '%s+%s-%s' % (ltag, changessince, hgid)
206 208 if version.endswith('+'):
207 209 version += time.strftime('%Y%m%d')
208 210 elif os.path.exists('.hg_archival.txt'):
209 211 kw = dict([[t.strip() for t in l.split(':', 1)]
210 212 for l in open('.hg_archival.txt')])
211 213 if 'tag' in kw:
212 214 version = kw['tag']
213 215 elif 'latesttag' in kw:
214 216 if 'changessincelatesttag' in kw:
215 217 version = '%(latesttag)s+%(changessincelatesttag)s-%(node).12s' % kw
216 218 else:
217 219 version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
218 220 else:
219 221 version = kw.get('node', '')[:12]
220 222
221 223 if version:
222 224 f = open("mercurial/__version__.py", "w")
223 225 f.write('# this file is autogenerated by setup.py\n')
224 226 f.write('version = "%s"\n' % version)
225 227 f.close()
226 228
227 229
228 230 try:
229 231 from mercurial import __version__
230 232 version = __version__.version
231 233 except ImportError:
232 234 version = 'unknown'
233 235
234 236 class hgbuild(build):
235 237 # Insert hgbuildmo first so that files in mercurial/locale/ are found
236 238 # when build_py is run next.
237 239 sub_commands = [('build_mo', None),
238 240
239 241 # We also need build_ext before build_py. Otherwise, when 2to3 is
240 242 # called (in build_py), it will not find osutil & friends,
241 243 # thinking that those modules are global and, consequently, making
242 244 # a mess, now that all module imports are global.
243 245
244 246 ('build_ext', build.has_ext_modules),
245 247 ] + build.sub_commands
246 248
247 249 class hgbuildmo(build):
248 250
249 251 description = "build translations (.mo files)"
250 252
251 253 def run(self):
252 254 if not find_executable('msgfmt'):
253 255 self.warn("could not find msgfmt executable, no translations "
254 256 "will be built")
255 257 return
256 258
257 259 podir = 'i18n'
258 260 if not os.path.isdir(podir):
259 261 self.warn("could not find %s/ directory" % podir)
260 262 return
261 263
262 264 join = os.path.join
263 265 for po in os.listdir(podir):
264 266 if not po.endswith('.po'):
265 267 continue
266 268 pofile = join(podir, po)
267 269 modir = join('locale', po[:-3], 'LC_MESSAGES')
268 270 mofile = join(modir, 'hg.mo')
269 271 mobuildfile = join('mercurial', mofile)
270 272 cmd = ['msgfmt', '-v', '-o', mobuildfile, pofile]
271 273 if sys.platform != 'sunos5':
272 274 # msgfmt on Solaris does not know about -c
273 275 cmd.append('-c')
274 276 self.mkpath(join('mercurial', modir))
275 277 self.make_file([pofile], mobuildfile, spawn, (cmd,))
276 278
277 279
278 280 class hgdist(Distribution):
279 pure = 0
281 pure = ispypy
280 282
281 283 global_options = Distribution.global_options + \
282 284 [('pure', None, "use pure (slow) Python "
283 285 "code instead of C extensions"),
284 286 ('c2to3', None, "(experimental!) convert "
285 287 "code with 2to3"),
286 288 ]
287 289
288 290 def has_ext_modules(self):
289 291 # self.ext_modules is emptied in hgbuildpy.finalize_options which is
290 292 # too late for some cases
291 293 return not self.pure and Distribution.has_ext_modules(self)
292 294
293 295 class hgbuildext(build_ext):
294 296
295 297 def build_extension(self, ext):
296 298 try:
297 299 build_ext.build_extension(self, ext)
298 300 except CCompilerError:
299 301 if not getattr(ext, 'optional', False):
300 302 raise
301 303 log.warn("Failed to build optional extension '%s' (skipping)",
302 304 ext.name)
303 305
304 306 class hgbuildpy(build_py):
305 307 if convert2to3:
306 308 fixer_names = sorted(set(getfixers("lib2to3.fixes") +
307 309 getfixers("hgfixes")))
308 310
309 311 def finalize_options(self):
310 312 build_py.finalize_options(self)
311 313
312 314 if self.distribution.pure:
313 315 if self.py_modules is None:
314 316 self.py_modules = []
315 317 for ext in self.distribution.ext_modules:
316 318 if ext.name.startswith("mercurial."):
317 319 self.py_modules.append("mercurial.pure.%s" % ext.name[10:])
318 320 self.distribution.ext_modules = []
319 321 else:
320 322 h = os.path.join(get_python_inc(), 'Python.h')
321 323 if not os.path.exists(h):
322 324 raise SystemExit('Python headers are required to build '
323 325 'Mercurial but weren\'t found in %s' % h)
324 326
325 327 def find_modules(self):
326 328 modules = build_py.find_modules(self)
327 329 for module in modules:
328 330 if module[0] == "mercurial.pure":
329 331 if module[1] != "__init__":
330 332 yield ("mercurial", module[1], module[2])
331 333 else:
332 334 yield module
333 335
334 336 class buildhgextindex(Command):
335 337 description = 'generate prebuilt index of hgext (for frozen package)'
336 338 user_options = []
337 339 _indexfilename = 'hgext/__index__.py'
338 340
339 341 def initialize_options(self):
340 342 pass
341 343
342 344 def finalize_options(self):
343 345 pass
344 346
345 347 def run(self):
346 348 if os.path.exists(self._indexfilename):
347 349 f = open(self._indexfilename, 'w')
348 350 f.write('# empty\n')
349 351 f.close()
350 352
351 353 # here no extension enabled, disabled() lists up everything
352 354 code = ('import pprint; from mercurial import extensions; '
353 355 'pprint.pprint(extensions.disabled())')
354 356 out, err = runcmd([sys.executable, '-c', code], env)
355 357 if err:
356 358 raise DistutilsExecError(err)
357 359
358 360 f = open(self._indexfilename, 'w')
359 361 f.write('# this file is autogenerated by setup.py\n')
360 362 f.write('docs = ')
361 363 f.write(out)
362 364 f.close()
363 365
364 366 class buildhgexe(build_ext):
365 367 description = 'compile hg.exe from mercurial/exewrapper.c'
366 368
367 369 def build_extensions(self):
368 370 if os.name != 'nt':
369 371 return
370 372 if isinstance(self.compiler, HackedMingw32CCompiler):
371 373 self.compiler.compiler_so = self.compiler.compiler # no -mdll
372 374 self.compiler.dll_libraries = [] # no -lmsrvc90
373 375 hv = sys.hexversion
374 376 pythonlib = 'python%d%d' % (hv >> 24, (hv >> 16) & 0xff)
375 377 f = open('mercurial/hgpythonlib.h', 'wb')
376 378 f.write('/* this file is autogenerated by setup.py */\n')
377 379 f.write('#define HGPYTHONLIB "%s"\n' % pythonlib)
378 380 f.close()
379 381 objects = self.compiler.compile(['mercurial/exewrapper.c'],
380 382 output_dir=self.build_temp)
381 383 dir = os.path.dirname(self.get_ext_fullpath('dummy'))
382 384 target = os.path.join(dir, 'hg')
383 385 self.compiler.link_executable(objects, target,
384 386 libraries=[],
385 387 output_dir=self.build_temp)
386 388
387 389 class hginstalllib(install_lib):
388 390 '''
389 391 This is a specialization of install_lib that replaces the copy_file used
390 392 there so that it supports setting the mode of files after copying them,
391 393 instead of just preserving the mode that the files originally had. If your
392 394 system has a umask of something like 027, preserving the permissions when
393 395 copying will lead to a broken install.
394 396
395 397 Note that just passing keep_permissions=False to copy_file would be
396 398 insufficient, as it might still be applying a umask.
397 399 '''
398 400
399 401 def run(self):
400 402 realcopyfile = file_util.copy_file
401 403 def copyfileandsetmode(*args, **kwargs):
402 404 src, dst = args[0], args[1]
403 405 dst, copied = realcopyfile(*args, **kwargs)
404 406 if copied:
405 407 st = os.stat(src)
406 408 # Persist executable bit (apply it to group and other if user
407 409 # has it)
408 410 if st[stat.ST_MODE] & stat.S_IXUSR:
409 411 setmode = 0755
410 412 else:
411 413 setmode = 0644
412 414 os.chmod(dst, (stat.S_IMODE(st[stat.ST_MODE]) & ~0777) |
413 415 setmode)
414 416 file_util.copy_file = copyfileandsetmode
415 417 try:
416 418 install_lib.run(self)
417 419 finally:
418 420 file_util.copy_file = realcopyfile
419 421
420 422 class hginstallscripts(install_scripts):
421 423 '''
422 424 This is a specialization of install_scripts that replaces the @LIBDIR@ with
423 425 the configured directory for modules. If possible, the path is made relative
424 426 to the directory for scripts.
425 427 '''
426 428
427 429 def initialize_options(self):
428 430 install_scripts.initialize_options(self)
429 431
430 432 self.install_lib = None
431 433
432 434 def finalize_options(self):
433 435 install_scripts.finalize_options(self)
434 436 self.set_undefined_options('install',
435 437 ('install_lib', 'install_lib'))
436 438
437 439 def run(self):
438 440 install_scripts.run(self)
439 441
440 442 if (os.path.splitdrive(self.install_dir)[0] !=
441 443 os.path.splitdrive(self.install_lib)[0]):
442 444 # can't make relative paths from one drive to another, so use an
443 445 # absolute path instead
444 446 libdir = self.install_lib
445 447 else:
446 448 common = os.path.commonprefix((self.install_dir, self.install_lib))
447 449 rest = self.install_dir[len(common):]
448 450 uplevel = len([n for n in os.path.split(rest) if n])
449 451
450 452 libdir = uplevel * ('..' + os.sep) + self.install_lib[len(common):]
451 453
452 454 for outfile in self.outfiles:
453 455 fp = open(outfile, 'rb')
454 456 data = fp.read()
455 457 fp.close()
456 458
457 459 # skip binary files
458 460 if b('\0') in data:
459 461 continue
460 462
461 463 data = data.replace(b('@LIBDIR@'), libdir.encode(libdir_escape))
462 464 fp = open(outfile, 'wb')
463 465 fp.write(data)
464 466 fp.close()
465 467
466 468 cmdclass = {'build': hgbuild,
467 469 'build_mo': hgbuildmo,
468 470 'build_ext': hgbuildext,
469 471 'build_py': hgbuildpy,
470 472 'build_hgextindex': buildhgextindex,
471 473 'install_lib': hginstalllib,
472 474 'install_scripts': hginstallscripts,
473 475 'build_hgexe': buildhgexe,
474 476 }
475 477
476 478 packages = ['mercurial', 'mercurial.hgweb', 'mercurial.httpclient',
477 479 'hgext', 'hgext.convert', 'hgext.highlight', 'hgext.zeroconf',
478 480 'hgext.largefiles']
479 481
480 482 pymodules = []
481 483
482 484 common_depends = ['mercurial/util.h']
483 485
484 486 extmodules = [
485 487 Extension('mercurial.base85', ['mercurial/base85.c'],
486 488 depends=common_depends),
487 489 Extension('mercurial.bdiff', ['mercurial/bdiff.c'],
488 490 depends=common_depends),
489 491 Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c'],
490 492 depends=common_depends),
491 493 Extension('mercurial.mpatch', ['mercurial/mpatch.c'],
492 494 depends=common_depends),
493 495 Extension('mercurial.parsers', ['mercurial/dirs.c',
494 496 'mercurial/parsers.c',
495 497 'mercurial/pathencode.c'],
496 498 depends=common_depends),
497 499 ]
498 500
499 501 osutil_ldflags = []
500 502
501 503 if sys.platform == 'darwin':
502 504 osutil_ldflags += ['-framework', 'ApplicationServices']
503 505
504 506 # disable osutil.c under windows + python 2.4 (issue1364)
505 507 if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
506 508 pymodules.append('mercurial.pure.osutil')
507 509 else:
508 510 extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'],
509 511 extra_link_args=osutil_ldflags,
510 512 depends=common_depends))
511 513
512 514 try:
513 515 from distutils import cygwinccompiler
514 516
515 517 # the -mno-cygwin option has been deprecated for years
516 518 compiler = cygwinccompiler.Mingw32CCompiler
517 519
518 520 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
519 521 def __init__(self, *args, **kwargs):
520 522 compiler.__init__(self, *args, **kwargs)
521 523 for i in 'compiler compiler_so linker_exe linker_so'.split():
522 524 try:
523 525 getattr(self, i).remove('-mno-cygwin')
524 526 except ValueError:
525 527 pass
526 528
527 529 cygwinccompiler.Mingw32CCompiler = HackedMingw32CCompiler
528 530 except ImportError:
529 531 # the cygwinccompiler package is not available on some Python
530 532 # distributions like the ones from the optware project for Synology
531 533 # DiskStation boxes
532 534 class HackedMingw32CCompiler(object):
533 535 pass
534 536
535 537 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
536 538 'help/*.txt',
537 539 'default.d/*.rc',
538 540 'dummycert.pem']}
539 541
540 542 def ordinarypath(p):
541 543 return p and p[0] != '.' and p[-1] != '~'
542 544
543 545 for root in ('templates',):
544 546 for curdir, dirs, files in os.walk(os.path.join('mercurial', root)):
545 547 curdir = curdir.split(os.sep, 1)[1]
546 548 dirs[:] = filter(ordinarypath, dirs)
547 549 for f in filter(ordinarypath, files):
548 550 f = os.path.join(curdir, f)
549 551 packagedata['mercurial'].append(f)
550 552
551 553 datafiles = []
552 554 setupversion = version
553 555 extra = {}
554 556
555 557 if py2exeloaded:
556 558 extra['console'] = [
557 559 {'script':'hg',
558 560 'copyright':'Copyright (C) 2005-2015 Matt Mackall and others',
559 561 'product_version':version}]
560 562 # sub command of 'build' because 'py2exe' does not handle sub_commands
561 563 build.sub_commands.insert(0, ('build_hgextindex', None))
562 564
563 565 if os.name == 'nt':
564 566 # Windows binary file versions for exe/dll files must have the
565 567 # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535
566 568 setupversion = version.split('+', 1)[0]
567 569
568 570 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
569 571 version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()
570 572 if version:
571 573 version = version[0]
572 574 xcode4 = (version.startswith('Xcode') and
573 575 StrictVersion(version.split()[1]) >= StrictVersion('4.0'))
574 576 xcode51 = re.match(r'^Xcode\s+5\.1', version) is not None
575 577 else:
576 578 # xcodebuild returns empty on OS X Lion with XCode 4.3 not
577 579 # installed, but instead with only command-line tools. Assume
578 580 # that only happens on >= Lion, thus no PPC support.
579 581 xcode4 = True
580 582 xcode51 = False
581 583
582 584 # XCode 4.0 dropped support for ppc architecture, which is hardcoded in
583 585 # distutils.sysconfig
584 586 if xcode4:
585 587 os.environ['ARCHFLAGS'] = ''
586 588
587 589 # XCode 5.1 changes clang such that it now fails to compile if the
588 590 # -mno-fused-madd flag is passed, but the version of Python shipped with
589 591 # OS X 10.9 Mavericks includes this flag. This causes problems in all
590 592 # C extension modules, and a bug has been filed upstream at
591 593 # http://bugs.python.org/issue21244. We also need to patch this here
592 594 # so Mercurial can continue to compile in the meantime.
593 595 if xcode51:
594 596 cflags = get_config_var('CFLAGS')
595 597 if cflags and re.search(r'-mno-fused-madd\b', cflags) is not None:
596 598 os.environ['CFLAGS'] = (
597 599 os.environ.get('CFLAGS', '') + ' -Qunused-arguments')
598 600
599 601 setup(name='mercurial',
600 602 version=setupversion,
601 603 author='Matt Mackall and many others',
602 604 author_email='mercurial@selenic.com',
603 605 url='http://mercurial.selenic.com/',
604 606 download_url='http://mercurial.selenic.com/release/',
605 607 description=('Fast scalable distributed SCM (revision control, version '
606 608 'control) system'),
607 609 long_description=('Mercurial is a distributed SCM tool written in Python.'
608 610 ' It is used by a number of large projects that require'
609 611 ' fast, reliable distributed revision control, such as '
610 612 'Mozilla.'),
611 613 license='GNU GPLv2 or any later version',
612 614 classifiers=[
613 615 'Development Status :: 6 - Mature',
614 616 'Environment :: Console',
615 617 'Intended Audience :: Developers',
616 618 'Intended Audience :: System Administrators',
617 619 'License :: OSI Approved :: GNU General Public License (GPL)',
618 620 'Natural Language :: Danish',
619 621 'Natural Language :: English',
620 622 'Natural Language :: German',
621 623 'Natural Language :: Italian',
622 624 'Natural Language :: Japanese',
623 625 'Natural Language :: Portuguese (Brazilian)',
624 626 'Operating System :: Microsoft :: Windows',
625 627 'Operating System :: OS Independent',
626 628 'Operating System :: POSIX',
627 629 'Programming Language :: C',
628 630 'Programming Language :: Python',
629 631 'Topic :: Software Development :: Version Control',
630 632 ],
631 633 scripts=scripts,
632 634 packages=packages,
633 635 py_modules=pymodules,
634 636 ext_modules=extmodules,
635 637 data_files=datafiles,
636 638 package_data=packagedata,
637 639 cmdclass=cmdclass,
638 640 distclass=hgdist,
639 641 options={'py2exe': {'packages': ['hgext', 'email']},
640 642 'bdist_mpkg': {'zipdist': False,
641 643 'license': 'COPYING',
642 644 'readme': 'contrib/macosx/Readme.html',
643 645 'welcome': 'contrib/macosx/Welcome.html',
644 646 },
645 647 },
646 648 **extra)
General Comments 0
You need to be logged in to leave comments. Login now