Ticket #42860: setup_py.diff

File setup_py.diff, 1.5 KB (added by mtiberti (Matteo Tiberti), 11 years ago)
  • setup.py

     
    5151class options:
    5252    osx_frameworks = False
    5353
    54 try:
    55     import argparse
    56     parser = argparse.ArgumentParser()
    57     parser.add_argument('--osx-frameworks', action="store_true")
    58     options, sys.argv[1:] = parser.parse_known_args(namespace=options)
    59 except ImportError:
    60     print "argparse not available"
    61 
    6254jobs = int(os.getenv('JOBS', 0))
    6355pmap = map if jobs == 1 else multiprocessing.pool.ThreadPool(jobs or None).map
    6456
     
    242234    try:
    243235        prefix_path = os.environ['PREFIX_PATH'].split(os.pathsep)
    244236    except KeyError:
    245         prefix_path = ["/usr", "/usr/X11", "/opt/local", "/sw"]
     237        prefix_path = ["/opt/local", "/usr", "/usr/X11"]
    246238
    247239    for prefix in prefix_path:
    248240        inc_dirs += filter(os.path.isdir, [prefix + s for s in ["/include", "/include/freetype2"]])
    249241        lib_dirs += filter(os.path.isdir, [prefix + s for s in ["/lib64", "/lib"]])
    250242
    251     if sys.platform == 'darwin' and options.osx_frameworks:
    252         ext_link_args += [
    253             "-framework", "OpenGL",
    254             "-framework", "GLUT",
    255         ]
    256     else:
    257         glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
    258         pyogl_libs += ["GL", "GLU", glut]
     243    glut = posix_find_lib(['glut', 'freeglut'], lib_dirs)
    259244
    260245    libs += ["GLEW"]
     246    pyogl_libs += ["GL", "GLU", glut]
    261247    libs += pyogl_libs
    262248
    263249    ext_comp_args += ["-ffast-math", "-funroll-loops", "-O3", "-fcommon"]