示例#1
0
def prebuild_cleanup(Force=False):
    print "cleaning up previous files..."
    if Force:
        build_helper.write_output(['git', 'clean', '-xfd'])
        return
    shutil.rmtree(configuration, ignore_errors=True)
    shutil.rmtree('CMakeFiles', ignore_errors=True)
    shutil.rmtree(target+ '.app', ignore_errors=True)
    if os.path.exists ('CMakeCache.txt'):
        os.remove('CMakeCache.txt')
示例#2
0
def prebuild_cleanup(Force=False):
    print 'cleaning up previous files...'
    if Force:
        build_helper.write_output(['git', 'clean', '-xfd'])
        return
    shutil.rmtree(configuration, ignore_errors=True)
    shutil.rmtree('CMakeFiles', ignore_errors=True)
    shutil.rmtree(target+ '.app', ignore_errors=True)
    if os.path.exists ('CMakeCache.txt'):
        os.remove('CMakeCache.txt')
示例#3
0
def execute_buildscript(generator = 'xcode'):
    print "executing build scripts..."
    if generator == 'xcode':
        command = ['xcodebuild', '-target', 'ALL_BUILD', '-configuration', configuration, '-jobs', num_cpus]
    elif generator == 'ninja':
        command = ['ninja']
    else:
        command = ['make', '-j', num_cpus]
    build_helper.write_output(command)
    if generator == 'xcode':
        shutil.copytree(os.path.join(configuration, target+ '.app'), target + '.app')
示例#4
0
def execute_buildscript(generator = 'xcode'):
    print 'executing build scripts...'
    if generator == 'xcode':
        command = ['xcodebuild', '-target', 'ALL_BUILD', '-configuration', configuration, '-jobs', num_cpus]
    elif generator == 'ninja':
        command = ['ninja']
    else:
        command = ['make', '-j', num_cpus]
    build_helper.write_output(command)
    if generator == 'xcode':
        shutil.copytree(os.path.join(configuration, target+ '.app'), target + '.app')
示例#5
0
def generate_buildscript(generator = 'xcode', os_min = '10.7'):
    print "generating build scripts..."
    if not os.path.exists('CMakeLists.txt'):
        print 'Please execute this frome the top dir of the source'
        sys.exit(-1)
    cmake_args = ['cmake', '.', '-DCMAKE_BUILD_TYPE=' + configuration]
    cmake_args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=' + os_min);
    if generator == 'xcode':
        cmake_args.extend(['-G', 'Xcode'])
    elif generator == 'ninja':
        cmake_args.extend(['-G', 'Ninja'])
    else:
        cmake_args.extend(['-G', 'Unix Makefiles'])
    build_helper.write_output(cmake_args)
示例#6
0
def postbuild_patchelf():
    lib_path = os.path.join(target, 'lib')
    bin_path = os.path.join(target, 'bin')
    binaries = os.listdir(bin_path)
    for binrary_name in binaries:
        binrary = os.path.join(bin_path, binrary_name)
        if os.path.isdir(binrary):
            continue
        build_helper.write_output(['patchelf', '-set-rpath', '\\\$ORIGIN/../lib', binrary])
    libs = os.listdir(lib_path)
    for lib_name in libs:
        lib = os.path.join(lib_path, lib_name)
        if os.path.isdir(lib):
            continue
        build_helper.write_output(['patchelf', '-set-rpath', '\\\$ORIGIN/../lib', lib])
示例#7
0
def postbuild_copy_libraries_xcode():
    frameworks_path = os.path.join(target + '.app', 'Contents', 'Frameworks')
    resources_path = os.path.join(target + '.app', 'Contents', 'Resources')
    macos_path = os.path.join(target + '.app', 'Contents', 'MacOS')
    binaries = [os.path.join(macos_path, target),
                os.path.join(resources_path, 'ccnet'),
                os.path.join(resources_path, 'seaf-daemon')]
    libs = []
    for binrary in binaries:
        libs.extend(build_helper.get_dependencies_recursively(binrary))
    if not os.path.isdir(frameworks_path):
        os.makedirs(frameworks_path)
    for lib in libs:
        shutil.copyfile(lib, frameworks_path + '/' + os.path.basename(lib))
    build_helper.write_output(['macdeployqt', target + '.app'])
示例#8
0
def postbuild_patchelf():
    lib_path = os.path.join(target, 'lib')
    bin_path = os.path.join(target, 'bin')
    binaries = os.listdir(bin_path)
    for binrary_name in binaries:
        binrary = os.path.join(bin_path, binrary_name)
        if os.path.isdir(binrary):
            continue
        build_helper.write_output(['patchelf', '-set-rpath', '\\\$ORIGIN/../lib', binrary])
    libs = os.listdir(lib_path)
    for lib_name in libs:
        lib = os.path.join(lib_path, lib_name)
        if os.path.isdir(lib):
            continue
        build_helper.write_output(['patchelf', '-set-rpath', '\\\$ORIGIN/../lib', lib])
示例#9
0
def postbuild_copy_libraries_xcode():
    frameworks_path = os.path.join(target + '.app', 'Contents', 'Frameworks')
    resources_path = os.path.join(target + '.app', 'Contents', 'Resources')
    macos_path = os.path.join(target + '.app', 'Contents', 'MacOS')
    binaries = [os.path.join(macos_path, target),
                os.path.join(resources_path, 'ccnet'),
                os.path.join(resources_path, 'seaf-daemon')]
    libs = []
    for binrary in binaries:
        libs.extend(build_helper.get_dependencies_recursively(binrary))
    if not os.path.isdir(frameworks_path):
        os.makedirs(frameworks_path)
    for lib in libs:
        shutil.copyfile(lib, frameworks_path + '/' + os.path.basename(lib))
    build_helper.write_output(['macdeployqt', target + '.app'])
示例#10
0
def generate_buildscript(generator = 'xcode', os_min = '10.7', with_shibboleth = False):
    print 'generating build scripts...'
    if not os.path.exists('CMakeLists.txt'):
        print 'Please execute this frome the top dir of the source'
        sys.exit(-1)
    cmake_args = ['cmake', '.', '-DCMAKE_BUILD_TYPE=' + configuration]
    cmake_args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=' + os_min);
    if with_shibboleth:
        cmake_args.append('-DBUILD_SHIBBOLETH_SUPPORT=ON')
    else:
        cmake_args.append('-DBUILD_SHIBBOLETH_SUPPORT=OFF')
    if generator == 'xcode':
        cmake_args.extend(['-G', 'Xcode'])
    elif generator == 'ninja':
        cmake_args.extend(['-G', 'Ninja'])
    else:
        cmake_args.extend(['-G', 'Unix Makefiles'])
    build_helper.write_output(cmake_args)
示例#11
0
def postbuild_install_name_tool():
    frameworks_path = os.path.join(target + '.app', 'Contents', 'Frameworks')
    resources_path = os.path.join(target + '.app', 'Contents', 'Resources')
    macos_path = os.path.join(target + '.app', 'Contents', 'MacOS')
    binaries = [os.path.join(macos_path, target),
                os.path.join(resources_path, 'ccnet'),
                os.path.join(resources_path, 'seaf-daemon')]
    for binary in binaries:
        build_helper.write_output(['install_name_tool', '-add_rpath', '@executable_path/../Frameworks', binary])
        deps = build_helper.get_dependencies(binary)
        for dep in deps:
                build_helper.write_output(['install_name_tool', '-change', dep, '@executable_path/../Frameworks/%s' % os.path.basename(dep), binary])
    libs = os.listdir(frameworks_path)
    for lib_name in libs:
        lib = os.path.join(frameworks_path, lib_name)
        if os.path.isdir(lib):
            continue
        build_helper.write_output(['install_name_tool', '-id', '@loader_path/../Frameworks/%s' % os.path.basename(lib), lib])
        build_helper.write_output(['install_name_tool', '-add_rpath', '@loader_path/../Frameworks', lib])
        deps = build_helper.get_dependencies(lib)
        for dep in deps:
                build_helper.write_output(['install_name_tool', '-change', dep, '@loader_path/../Frameworks/%s' % os.path.basename(dep), lib])
示例#12
0
def postbuild_install_name_tool():
    frameworks_path = os.path.join(target + '.app', 'Contents', 'Frameworks')
    resources_path = os.path.join(target + '.app', 'Contents', 'Resources')
    macos_path = os.path.join(target + '.app', 'Contents', 'MacOS')
    binaries = [os.path.join(macos_path, target),
                os.path.join(resources_path, 'ccnet'),
                os.path.join(resources_path, 'seaf-daemon')]
    for binary in binaries:
        build_helper.write_output(['install_name_tool', '-add_rpath', '@executable_path/../Frameworks', binary])
        deps = build_helper.get_dependencies(binary)
        for dep in deps:
                build_helper.write_output(['install_name_tool', '-change', dep, '@executable_path/../Frameworks/%s' % os.path.basename(dep), binary])
        build_helper.write_output(['install_name_tool', '-delete_rpath', '/usr/local/lib', binary])
        build_helper.write_output(['install_name_tool', '-delete_rpath', '/opt/local/lib', binary])
    libs = os.listdir(frameworks_path)
    for lib_name in libs:
        lib = os.path.join(frameworks_path, lib_name)
        if os.path.isdir(lib):
            continue
        build_helper.write_output(['install_name_tool', '-id', '@loader_path/../Frameworks/%s' % os.path.basename(lib), lib])
        build_helper.write_output(['install_name_tool', '-add_rpath', '@loader_path/../Frameworks', lib])
        build_helper.write_output(['install_name_tool', '-delete_rpath', '/usr/local/lib', lib])
        build_helper.write_output(['install_name_tool', '-delete_rpath', '/opt/local/lib', lib])
        deps = build_helper.get_dependencies(lib)
        for dep in deps:
                build_helper.write_output(['install_name_tool', '-change', dep, '@loader_path/../Frameworks/%s' % os.path.basename(dep), lib])