Ticket #38332: setup.py.patch

File setup.py.patch, 2.2 KB (added by jdgleeson, 12 years ago)
  • setup.py

    old new  
    3030    'Topic :: Software Development :: Libraries :: Python Modules',
    3131]
    3232
    33 # If we are on Mac OS 10.5 or later, attempt a universal binary, which is the way
    34 # the original system version of readline.so was compiled. Set up flags here.
    35 UNIVERSAL = ''
    36 platform = distutils.util.get_platform()
    37 if platform.startswith('macosx'):
    38     osx_version = platform.split('-')[1]
    39     SDK = ''
    40     if osx_version == '10.5':
    41         SDK = '/Developer/SDKs/MacOSX10.5.sdk'
    42         UNIVERSAL = '-arch i386 -arch ppc -arch x86_64 -arch ppc64'
    43     elif osx_version == '10.6':
    44         # Starting with 10.6 (Snow Leopard), only Intel architecture is supported
    45         SDK = '/Developer/SDKs/MacOSX10.6.sdk'
    46         UNIVERSAL = '-arch i386 -arch x86_64'
    47     elif osx_version > '10.6':
    48         # Starting with 10.7 (Lion) and Xcode 4.3, the developer sysroot is inside the Xcode.app - ignore it
    49         UNIVERSAL = '-arch i386 -arch x86_64'
    50 
    51     if os.path.exists(SDK):
    52         # only add sysroot if it exists:
    53         UNIVERSAL = "-isysroot %s %s" % (SDK, UNIVERSAL)
    54 
    5533# Since we have the latest readline (post 4.2), enable all readline functionality
    5634# These macros can be found in pyconfig.h.in in the main directory of the Python tarball
    5735DEFINE_MACROS = [
     
    9876    maintainer_email="ludwig.schwardt@gmail.com; github@srid.name",
    9977    url="http://github.com/ludwigschwardt/python-readline",
    10078    license="GNU GPL",
     79    extra_path = 'readline',
    10180    platforms=['MacOS X', 'Posix'],
    10281    include_package_data=True,
    10382    ext_modules=[
     
    10584                  sources=["Modules/%s.x/readline.c" % (sys.version_info[0],)],
    10685                  include_dirs=['.'],
    10786                  define_macros=DEFINE_MACROS,
    108                   extra_compile_args=['-Wno-strict-prototypes'] + UNIVERSAL.split(),
    109                   extra_link_args=UNIVERSAL.split(),
     87                  extra_compile_args=['-Wno-strict-prototypes'],
    11088                  extra_objects=['readline/libreadline.a', 'readline/libhistory.a'],
    11189                  libraries=['ncurses']
    11290        ),