Exemplo n.º 1
0
def pack_win(builder):
    info = buildbot_utils.VersionInfo(builder)

    os.chdir(builder.build_dir)
    cleanup_files(builder.build_dir, '.zip')

    # CPack will add the platform name
    cpack_name = get_package_name(builder, None)
    package_name = get_package_name(builder, 'windows' + str(builder.bits))

    command = [
        'cmake', '-DCPACK_OVERRIDE_PACKAGENAME:STRING=' + cpack_name, '.'
    ]
    buildbot_utils.call(builder.command_prefix + command)
    command = ['cpack', '-G', 'ZIP']
    buildbot_utils.call(builder.command_prefix + command)

    package_filename = package_name + '.zip'
    package_filepath = os.path.join(builder.build_dir, package_filename)
    package_files = [(package_filepath, package_filename)]

    if info.version_cycle == 'release':
        # Installer only for final release builds, otherwise will get
        # 'this product is already installed' messages.
        command = ['cpack', '-G', 'WIX']
        buildbot_utils.call(builder.command_prefix + command)

        package_filename = package_name + '.msi'
        package_filepath = os.path.join(builder.build_dir, package_filename)
        package_files += [(package_filepath, package_filename)]

    create_buildbot_upload_zip(builder, package_files)
Exemplo n.º 2
0
def pack_linux(builder):
    blender_executable = os.path.join(builder.install_dir, 'blender')

    info = buildbot_utils.VersionInfo(builder)

    # Strip all unused symbols from the binaries
    print("Stripping binaries...")
    buildbot_utils.call(builder.command_prefix +
                        ['strip', '--strip-all', blender_executable])

    print("Stripping python...")
    py_target = os.path.join(builder.install_dir, info.version)
    buildbot_utils.call(builder.command_prefix + [
        'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'
    ])

    # Construct package name
    platform_name = 'linux64'
    package_name = get_package_name(builder, platform_name)
    package_filename = package_name + ".tar.xz"

    print("Creating .tar.xz archive")
    package_filepath = builder.install_dir + '.tar.xz'
    create_tar_xz(builder.install_dir, package_filepath, package_name)

    # Create buildbot_upload.zip
    create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
Exemplo n.º 3
0
def pack_mac(builder):
    info = buildbot_utils.VersionInfo(builder)

    os.chdir(builder.build_dir)
    cleanup_files(builder.build_dir, '.dmg')

    package_name = get_package_name(builder, 'macOS')
    package_filename = package_name + '.dmg'
    package_filepath = os.path.join(builder.build_dir, package_filename)

    release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
    buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot')
    bundle_script = os.path.join(buildbot_dir, 'worker_bundle_dmg.py')

    command = [bundle_script]
    command += ['--dmg', package_filepath]
    if info.is_development_build:
        background_image = os.path.join(release_dir, 'buildbot',
                                        'background.tif')
        command += ['--background-image', background_image]
    if builder.codesign:
        command += ['--codesign']
    command += [builder.install_dir]
    buildbot_utils.call(command)

    create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
Exemplo n.º 4
0
def get_package_name(builder, platform=None):
    info = buildbot_utils.VersionInfo(builder)

    package_name = 'blender-' + info.full_version
    if platform:
        package_name += '-' + platform
    if builder.branch != 'master' and info.is_development_build:
        package_name = builder.branch + "-" + package_name

    return package_name
Exemplo n.º 5
0
def get_ctest_environment(builder):
    info = buildbot_utils.VersionInfo(builder)
    blender_version_dir = os.path.join(builder.install_dir, info.version)

    env = os.environ.copy()
    env['BLENDER_SYSTEM_SCRIPTS'] = os.path.join(blender_version_dir,
                                                 'scripts')
    env['BLENDER_SYSTEM_DATAFILES'] = os.path.join(blender_version_dir,
                                                   'datafiles')
    return env
Exemplo n.º 6
0
def pack_linux(builder):
    blender_executable = os.path.join(builder.install_dir, 'blender')

    info = buildbot_utils.VersionInfo(builder)
    blender_glibc = builder.name.split('_')[1]
    blender_arch = 'x86_64'

    # Strip all unused symbols from the binaries
    print("Stripping binaries...")
    buildbot_utils.call(builder.command_prefix +
                        ['strip', '--strip-all', blender_executable])

    print("Stripping python...")
    py_target = os.path.join(builder.install_dir, info.version)
    buildbot_utils.call(builder.command_prefix + [
        'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'
    ])

    # Copy all specific files which are too specific to be copied by
    # the CMake rules themselves
    print("Copying extra scripts and libs...")

    extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra')
    mesalibs = os.path.join(extra, 'mesalibs' + str(builder.bits) + '.tar.bz2')
    software_gl = os.path.join(builder.blender_dir, 'release', 'bin',
                               'blender-softwaregl')
    icons = os.path.join(builder.blender_dir, 'release', 'freedesktop',
                         'icons')

    os.system('tar -xpf %s -C %s' % (mesalibs, builder.install_dir))
    os.system('cp %s %s' % (software_gl, builder.install_dir))
    os.system('cp -r %s %s' % (icons, builder.install_dir))
    os.system('chmod 755 %s' %
              (os.path.join(builder.install_dir, 'blender-softwaregl')))

    # Construct package name
    platform_name = 'linux-' + blender_glibc + '-' + blender_arch
    package_name = get_package_name(builder, platform_name)
    package_filename = package_name + ".tar.bz2"

    print("Creating .tar.bz2 archive")
    package_filepath = builder.install_dir + '.tar.bz2'
    create_tar_bz2(builder.install_dir, package_filepath, package_name)

    # Create buildbot_upload.zip
    create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])