Ticket #15706: patch-setupext.py.diff

File patch-setupext.py.diff, 3.2 KB (added by skymoo (Adam Mercer), 16 years ago)

updated patch-setupext.py.diff - take 2

  • setupext.py

    old new  
    5050    'linux2' : ['/usr/local', '/usr'],
    5151    'linux'  : ['/usr/local', '/usr',],
    5252    'cygwin' : ['/usr/local', '/usr',],
    53     'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local',
    54                 '/usr', '/sw', '/usr/X11R6'],
     53    'darwin' : ['@@MPORTS_PREFIX@@'],
    5554    'freebsd4' : ['/usr/local', '/usr'],
    5655    'freebsd5' : ['/usr/local', '/usr'],
    5756    'freebsd6' : ['/usr/local', '/usr'],
     
    982981    return tcl_lib, tcl_inc, tk_lib, tk_inc
    983982
    984983def hardcoded_tcl_config():
    985     tcl_inc = "/usr/local/include"
    986     tk_inc = "/usr/local/include"
    987     tcl_lib = "/usr/local/lib"
    988     tk_lib = "/usr/local/lib"
     984    tcl_inc = "@@MPORTS_PREFIX@@/include"
     985    tk_inc = "@@MPORTS_PREFIX@@/include"
     986    tcl_lib = "@@MPORTS_PREFIX@@/lib"
     987    tk_lib = "@@MPORTS_PREFIX@@/lib"
    989988    return tcl_lib, tcl_inc, tk_lib, tk_inc
    990989
    991990def add_tk_flags(module):
     
    10031002            raise RuntimeError('No tk/win32 support for this python version yet')
    10041003        module.library_dirs.extend([os.path.join(sys.prefix, 'dlls')])
    10051004
    1006     elif sys.platform == 'darwin':
    1007         # this config section lifted directly from Imaging - thanks to
    1008         # the effbot!
    1009 
    1010         # First test for a MacOSX/darwin framework install
    1011         from os.path import join, exists
    1012         framework_dirs = [
    1013             join(os.getenv('HOME'), '/Library/Frameworks'),
    1014             '/Library/Frameworks',
    1015             '/System/Library/Frameworks/',
    1016         ]
    1017 
    1018         # Find the directory that contains the Tcl.framework and Tk.framework
    1019         # bundles.
    1020         # XXX distutils should support -F!
    1021         tk_framework_found = 0
    1022         for F in framework_dirs:
    1023             # both Tcl.framework and Tk.framework should be present
    1024             for fw in 'Tcl', 'Tk':
    1025                 if not exists(join(F, fw + '.framework')):
    1026                     break
    1027             else:
    1028                 # ok, F is now directory with both frameworks. Continure
    1029                 # building
    1030                 tk_framework_found = 1
    1031                 break
    1032         if tk_framework_found:
    1033             # For 8.4a2, we must add -I options that point inside the Tcl and Tk
    1034             # frameworks. In later release we should hopefully be able to pass
    1035             # the -F option to gcc, which specifies a framework lookup path.
    1036             #
    1037             tk_include_dirs = [
    1038                 join(F, fw + '.framework', H)
    1039                 for fw in 'Tcl', 'Tk'
    1040                 for H in 'Headers', 'Versions/Current/PrivateHeaders'
    1041             ]
    1042 
    1043             # For 8.4a2, the X11 headers are not included. Rather than include a
    1044             # complicated search, this is a hard-coded path. It could bail out
    1045             # if X11 libs are not found...
    1046             # tk_include_dirs.append('/usr/X11R6/include')
    1047             frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
    1048             module.include_dirs.extend(tk_include_dirs)
    1049             module.extra_link_args.extend(frameworks)
    1050             module.extra_compile_args.extend(frameworks)
    1051 
    10521005    # you're still here? ok we'll try it this way...
    10531006    else:
    10541007        success = False