示例#1
0
        run_configure(opts, args)

    # Skip creating .spec when .spec file is supplied 
    if args[0].endswith('.spec'):
        spec_file = args[0]
    else:
        spec_file = run_makespec(opts, args)

    run_build(opts, args, spec_file)


if __name__ == '__main__':
    from pyi_optparse import OptionParser

    parser = OptionParser(
        usage="python %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>"
    )

    # Configure.py options
    g = parser.add_option_group('Python environment')
    g.add_option('--target-platform', default=None,
            help='Target platform, required for cross-bundling '
                 '(default: current platform).')
    g.add_option('--upx-dir', default=None,
            help='Directory containing UPX.')
    g.add_option('--executable', default=None,
            help='Python executable to use. Required for '
                 'cross-bundling.')
    g.add_option('-C', '--configfile',
            default=os.path.join(HOME, 'config.dat'),
            help='Name of generated configfile (default: %default)')
示例#2
0
    # Resolve the file name into the soname
    dir, file = os.path.split(lib)
    return os.path.join(dir, getSoname(lib))


def getSoname(filename):
    """Return the soname of a library."""
    cmd = "objdump -p -j .dynamic 2>/dev/null " + filename
    m = re.search(r'\s+SONAME\s+([^\s]+)', os.popen(cmd).read())
    if m: return m.group(1)


if __name__ == "__main__":
    from pyi_optparse import OptionParser
    parser = OptionParser(
        usage="%prog [options] <executable_or_dynamic_library>")
    parser.add_option(
        '--target-platform',
        default=sys.platform,
        help=
        'Target platform, required for cross-bundling (default: current platform)'
    )

    opts, args = parser.parse_args()
    silent = True  # Suppress all informative messages from the dependency code
    import glob
    for a in args:
        for fn in glob.glob(a):
            imports = getImports(fn, opts.target_platform)
            if opts.target_platform == "win32":
                imports.extend([a.getid() for a in getAssemblies(fn)])
示例#3
0
    if config.setdefault('pythonDebug', None) != __debug__:
        print "python optimization flags changed: rerun Configure.py with the same [-O] option"
        print "Configure.py optimize=%s, Build.py optimize=%s" % (
            not config['pythonDebug'], not __debug__)
        sys.exit(1)

    if config['hasRsrcUpdate']:
        import icon, versionInfo

    if config['hasUPX']:
        setupUPXFlags()

    if not config['useELFEXE']:
        EXE.append_pkg = 0

    build(specfile)


if __name__ == '__main__':
    from pyi_optparse import OptionParser
    parser = OptionParser('%prog [options] specfile')
    parser.add_option('-C',
                      '--configfile',
                      default=os.path.join(HOMEPATH, 'config.dat'),
                      help='Name of generated configfile (default: %default)')
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error('Requires exactly one .spec-file')

    main(args[0], configfilename=opts.configfile)
示例#4
0
    find_EXE_dependencies(config)
    test_TCL_TK(config)
    test_Zlib(config)
    test_Crypt(config)
    test_RsrcUpdate(config)
    test_unicode(config)
    test_UPX(config)
    find_PYZ_dependencies(config)

    Build._save_data(configfilename, config)
    print "I: done generating", configfilename


if __name__ == '__main__':
    from pyi_optparse import OptionParser
    parser = OptionParser(usage="%prog [options]")
    parser.add_option('--target-platform',
                      default=None,
                      help='Target platform, required for cross-bundling '
                      '(default: current platform).')
    parser.add_option('--upx-dir',
                      default=None,
                      help='Directory containing UPX.')
    parser.add_option('--executable',
                      default=None,
                      help='Python executable to use. Required for '
                      'cross-bundling.')
    parser.add_option('-C',
                      '--configfile',
                      default=os.path.join(HOME, 'config.dat'),
                      help='Name of generated configfile (default: %default)')
示例#5
0
    find_EXE_dependencies(config)
    test_TCL_TK(config)
    test_Zlib(config)
    test_Crypt(config)
    test_RsrcUpdate(config)
    test_unicode(config)
    test_UPX(config)
    find_PYZ_dependencies(config)

    Build._save_data(configfilename, config)
    print "I: done generating", configfilename


if __name__ == '__main__':
    from pyi_optparse import OptionParser
    parser = OptionParser(usage="%prog [options]")
    parser.add_option('--target-platform', default=None,
                      help='Target platform, required for cross-bundling '
                           '(default: current platform).')
    parser.add_option('--upx-dir', default=None,
                      help='Directory containing UPX.')
    parser.add_option('--executable', default=None,
                      help='Python executable to use. Required for '
                           'cross-bundling.')
    parser.add_option('-C', '--configfile',
                      default=os.path.join(HOME, 'config.dat'),
                      help='Name of generated configfile (default: %default)')

    opts, args = parser.parse_args()
    if args:
        parser.error('Does not expect any arguments')
示例#6
0
        run_configure(opts, args)

    # Skip creating .spec when .spec file is supplied
    if args[0].endswith('.spec'):
        spec_file = args[0]
    else:
        spec_file = run_makespec(opts, args)

    run_build(opts, args, spec_file)


if __name__ == '__main__':
    from pyi_optparse import OptionParser

    parser = OptionParser(
        usage=
        "python %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>")

    # Configure.py options
    g = parser.add_option_group('Python environment')
    g.add_option('--target-platform',
                 default=None,
                 help='Target platform, required for cross-bundling '
                 '(default: current platform).')
    g.add_option('--upx-dir', default=None, help='Directory containing UPX.')
    g.add_option('--executable',
                 default=None,
                 help='Python executable to use. Required for '
                 'cross-bundling.')
    g.add_option('-C',
                 '--configfile',
示例#7
0
    # give up :(
    if lib is None:
        return None

    # Resolve the file name into the soname
    dir, file = os.path.split(lib)
    return os.path.join(dir, getSoname(lib))

def getSoname(filename):
    """Return the soname of a library."""
    cmd = "objdump -p -j .dynamic 2>/dev/null " + filename
    m = re.search(r'\s+SONAME\s+([^\s]+)', os.popen(cmd).read())
    if m: return m.group(1)


if __name__ == "__main__":
    from pyi_optparse import OptionParser
    parser = OptionParser(usage="%prog [options] <executable_or_dynamic_library>")
    parser.add_option('--target-platform', default=sys.platform,
                      help='Target platform, required for cross-bundling (default: current platform)')

    opts, args = parser.parse_args()
    silent = True  # Suppress all informative messages from the dependency code
    import glob
    for a in args:
        for fn in glob.glob(a):
            imports = getImports(fn, opts.target_platform)
            if opts.target_platform == "win32":
                imports.extend([a.getid() for a in getAssemblies(fn)])
            print fn, imports
示例#8
0
文件: Build.py 项目: pdubroy/kurt
            print "Please re-run Configure.py with this version."
            sys.exit(1)

    if config.setdefault('pythonDebug', None) != __debug__:
        print "python optimization flags changed: rerun Configure.py with the same [-O] option"
        print "Configure.py optimize=%s, Build.py optimize=%s" % (not config['pythonDebug'], not __debug__)
        sys.exit(1)

    if config['hasRsrcUpdate']:
        import icon, versionInfo

    if config['hasUPX']:
        setupUPXFlags()

    if not config['useELFEXE']:
        EXE.append_pkg = 0

    build(specfile)

if __name__ == '__main__':
    from pyi_optparse import OptionParser
    parser = OptionParser('%prog [options] specfile')
    parser.add_option('-C', '--configfile',
                      default=os.path.join(HOMEPATH, 'config.dat'),
                      help='Name of generated configfile (default: %default)')
    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error('Requires exactly one .spec-file')

    main(args[0], configfilename=opts.configfile)