Ticket #38516: setup_py.diff

File setup_py.diff, 1.6 KB (added by howarth@…, 11 years ago)

setup_py.diff patch adjusted for pymol 1.6.0

  • setup.py

    old new  
    4747    pmap(_single_compile, objects)
    4848    return objects
    4949
    50 # handle extra arguments
    51 class options:
    52     osx_frameworks = False
    53 
    54 try:
    55     import argparse
    56     parser = argparse.ArgumentParser()
    57     parser.add_argument('--osx-frameworks', action="store_true")
    58     options, sys.argv = parser.parse_known_args(namespace=options)
    59 except ImportError:
    60     print "argparse not available"
    61 
    6250jobs = int(os.getenv('JOBS', 0))
    6351pmap = map if jobs == 1 else multiprocessing.pool.ThreadPool(jobs or None).map
    6452
     
    246234    try:
    247235        prefix_path = os.environ['PREFIX_PATH'].split(os.pathsep)
    248236    except KeyError:
    249         prefix_path = ["/usr", "/usr/X11", "/opt/local", "/sw"]
     237        prefix_path = ["@PREFIX@", "/usr", "/usr/X11"]
    250238
    251239    for prefix in prefix_path:
    252240        inc_dirs += filter(os.path.isdir, [prefix + s for s in ["/include", "/include/freetype2"]])
    253241        lib_dirs += filter(os.path.isdir, [prefix + s for s in ["/lib64", "/lib"]])
    254242
    255     if sys.platform == 'darwin' and options.osx_frameworks:
    256         ext_link_args += [
    257             "-framework", "OpenGL",
    258             "-framework", "GLUT",
    259         ]
    260     else:
    261         glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
    262         pyogl_libs += ["GL", "GLU", glut]
     243    glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
    263244
    264245    libs += ["GLEW"]
     246    pyogl_libs += ["GL", "GLU", glut]
     247
    265248    libs += pyogl_libs
    266249
    267250    ext_comp_args += ["-ffast-math", "-funroll-loops", "-O3", "-fcommon"]