316 build_py.finalize_options(self) |
316 build_py.finalize_options(self) |
317 |
317 |
318 if self.distribution.pure: |
318 if self.distribution.pure: |
319 self.distribution.ext_modules = [] |
319 self.distribution.ext_modules = [] |
320 elif self.distribution.cffi: |
320 elif self.distribution.cffi: |
321 import setup_mpatch_cffi |
321 from mercurial.cffi import ( |
322 import setup_bdiff_cffi |
322 bdiff, |
323 exts = [setup_mpatch_cffi.ffi.distutils_extension(), |
323 mpatch, |
324 setup_bdiff_cffi.ffi.distutils_extension()] |
324 ) |
|
325 exts = [mpatch.ffi.distutils_extension(), |
|
326 bdiff.ffi.distutils_extension()] |
325 # cffi modules go here |
327 # cffi modules go here |
326 if sys.platform == 'darwin': |
328 if sys.platform == 'darwin': |
327 import setup_osutil_cffi |
329 from mercurial.cffi import osutil |
328 exts.append(setup_osutil_cffi.ffi.distutils_extension()) |
330 exts.append(osutil.ffi.distutils_extension()) |
329 self.distribution.ext_modules = exts |
331 self.distribution.ext_modules = exts |
330 else: |
332 else: |
331 h = os.path.join(get_python_inc(), 'Python.h') |
333 h = os.path.join(get_python_inc(), 'Python.h') |
332 if not os.path.exists(h): |
334 if not os.path.exists(h): |
333 raise SystemExit('Python headers are required to build ' |
335 raise SystemExit('Python headers are required to build ' |