Example #1
0
 def test_framework_info(self):
     self.assertIsNone(framework_info('completely/invalid'))
     self.assertIsNone(framework_info('completely/invalid/_debug'))
     self.assertIsNone(framework_info('P/F.framework'))
     self.assertIsNone(framework_info('P/F.framework/_debug'))
     self.assertEqual(framework_info('P/F.framework/F'),
                      d('P', 'F.framework/F', 'F'))
     self.assertEqual(framework_info('P/F.framework/F_debug'),
                      d('P', 'F.framework/F_debug', 'F', suffix='debug'))
     self.assertIsNone(framework_info('P/F.framework/Versions'))
     self.assertIsNone(framework_info('P/F.framework/Versions/A'))
     self.assertEqual(framework_info('P/F.framework/Versions/A/F'),
                      d('P', 'F.framework/Versions/A/F', 'F', 'A'))
     self.assertEqual(framework_info('P/F.framework/Versions/A/F_debug'),
                      d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug'))
Example #2
0
def dyld_override_search(name, env=None):
    framework = framework_info(name)
    if framework is not None:
        for path in dyld_framework_path(env):
            yield os.path.join(path, framework['name'])
    for path in dyld_library_path(env):
        yield os.path.join(path, os.path.basename(name))
Example #3
0
def dyld_override_search(name, env=None):
    # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a
    # framework name, use the first file that exists in the framework
    # path if any.  If there is none go on to search the DYLD_LIBRARY_PATH
    # if any.

    framework = framework_info(name)

    if framework is not None:
        for path in dyld_framework_path(env):
            yield os.path.join(path, framework['name'])

    # If DYLD_LIBRARY_PATH is set then use the first file that exists
    # in the path.  If none use the original name.
    for path in dyld_library_path(env):
        yield os.path.join(path, os.path.basename(name))
Example #4
0
def dyld_override_search(name, env=None):
    # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a
    # framework name, use the first file that exists in the framework
    # path if any.  If there is none go on to search the DYLD_LIBRARY_PATH
    # if any.

    framework = framework_info(name)

    if framework is not None:
        for path in dyld_framework_path(env):
            yield os.path.join(path, framework['name'])

    # If DYLD_LIBRARY_PATH is set then use the first file that exists
    # in the path.  If none use the original name.
    for path in dyld_library_path(env):
        yield os.path.join(path, os.path.basename(name))
Example #5
0
def dyld_default_search(name, env=None):
    yield name
    framework = framework_info(name)
    if framework is not None:
        fallback_framework_path = dyld_fallback_framework_path(env)
        for path in fallback_framework_path:
            yield os.path.join(path, framework['name'])
    fallback_library_path = dyld_fallback_library_path(env)
    for path in fallback_library_path:
        yield os.path.join(path, os.path.basename(name))
    if framework is not None and not fallback_framework_path:
        for path in DEFAULT_FRAMEWORK_FALLBACK:
            yield os.path.join(path, framework['name'])
    if not fallback_library_path:
        for path in DEFAULT_LIBRARY_FALLBACK:
            yield os.path.join(path, os.path.basename(name))
Example #6
0
def dyld_default_search(name, env=None):
    yield name

    framework = framework_info(name)

    if framework is not None:
        fallback_framework_path = dyld_fallback_framework_path(env)
        for path in fallback_framework_path:
            yield os.path.join(path, framework['name'])

    fallback_library_path = dyld_fallback_library_path(env)
    for path in fallback_library_path:
        yield os.path.join(path, os.path.basename(name))

    if framework is not None and not fallback_framework_path:
        for path in DEFAULT_FRAMEWORK_FALLBACK:
            yield os.path.join(path, framework['name'])

    if not fallback_library_path:
        for path in DEFAULT_LIBRARY_FALLBACK:
            yield os.path.join(path, os.path.basename(name))