예제 #1
0
 def __init__(self):
     self.src_root = CALIBRE_DIR
     self.base = mkdtemp('frozen-')
     self.lib_dir = j(self.base, 'lib')
     self.py_dir = j(self.lib_dir, 'python' + py_ver)
     os.makedirs(self.py_dir)
     self.bin_dir = j(self.base, 'bin')
     os.mkdir(self.bin_dir)
     self.SRC = j(self.src_root, 'src')
     self.obj_dir = mkdtemp('launchers-')
예제 #2
0
def build(dep, args, dest_dir):
    set_title('Building ' + dep)
    owd = os.getcwdu()
    set_current_source(filename_for_dep(dep))
    output_dir = todir = mkdtemp(prefix=dep + '-')
    set_build_dir(output_dir)
    try:
        m = importlib.import_module('pkgs.' + dep)
    except ImportError:
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), dep + '.py')):
            raise
        m = None
    tsdir = extract_source()
    try:
        if hasattr(m, 'main'):
            m.main(args)
        else:
            simple_build()
        if isosx:
            fix_install_names(m, output_dir)
    except Exception:
        import traceback
        traceback.print_exc()
        print('\nDropping you into a shell')
        sys.stdout.flush(), sys.stderr.flush()
        run_shell()
        raise SystemExit(1)
    create_package(m, output_dir, pkg_path(dep))
    install_package(pkg_path(dep), dest_dir)
    if hasattr(m, 'post_install_check'):
        m.post_install_check()
    os.chdir(owd)
    rmtree(todir)
    rmtree(tsdir)
예제 #3
0
def main(args, ext_dir, test_runner):
    build_dir = abspath(join(mkdtemp('frozen-'), APPNAME + '.app'))
    Freeze(build_dir,
           ext_dir,
           test_runner,
           dont_strip=args.dont_strip,
           sign_installers=args.sign_installers)
예제 #4
0
def main(args, ext_dir, test_runner):
    build_dir = a(j(mkdtemp('frozen-')))
    env = Env(build_dir)
    initbase(env)
    build_launchers(env)
    build_utils(env)
    freeze(env, ext_dir)
    embed_manifests(env)
    copy_crt(env)
    archive_lib_dir(env)
    test_runner(os.path.join(env.base, 'calibre-debug.exe'), env.base)
    create_installer(env)
    if not is64bit:
        build_portable(env)
        build_portable_installer(env)
    if args.sign_installers:
        sign_installers(env)
예제 #5
0
def main(args, ext_dir, test_runner):
    build_dir = a(j(mkdtemp('frozen-')))
    env = Env(build_dir)
    initbase(env)
    build_launchers(env)
    build_utils(env)
    freeze(env, ext_dir)
    embed_manifests(env)
    copy_crt(env)
    archive_lib_dir(env)
    test_runner(os.path.join(env.base, 'calibre-debug.exe'), env.base)
    if args.sign_installers:
        sign_executables(env)
    create_installer(env)
    if not is64bit:
        build_portable(env)
        build_portable_installer(env)
    if args.sign_installers:
        sign_installers(env)
예제 #6
0
def build(dep, args, dest_dir):
    set_title('Building ' + dep)
    owd = os.getcwdu()
    set_current_source(filename_for_dep(dep))
    output_dir = todir = mkdtemp(prefix=dep + '-')
    set_build_dir(output_dir)
    idep = dep.replace('-', '_')
    try:
        m = importlib.import_module('pkgs.' + idep)
    except ImportError:
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), idep + '.py')):
            raise
        m = None
    tsdir = extract_source()
    try:
        if hasattr(m, 'main'):
            m.main(args)
        else:
            if dep in python_deps:
                python_build()
                output_dir = os.path.join(output_dir, os.path.basename(SW), os.path.basename(PREFIX))
            else:
                simple_build()
        if isosx:
            fix_install_names(m, output_dir)
    except Exception:
        import traceback
        traceback.print_exc()
        print('\nDropping you into a shell')
        sys.stdout.flush(), sys.stderr.flush()
        run_shell()
        raise SystemExit(1)
    create_package(m, output_dir, pkg_path(dep))
    install_package(pkg_path(dep), dest_dir)
    if hasattr(m, 'post_install_check'):
        m.post_install_check()
    os.chdir(owd)
    rmtree(todir)
    rmtree(tsdir)
예제 #7
0
def main(args, ext_dir, test_runner):
    build_dir = abspath(join(mkdtemp('frozen-'), APPNAME + '.app'))
    Freeze(build_dir, ext_dir, test_runner, dont_strip=args.dont_strip, sign_installers=args.sign_installers)