Ejemplo n.º 1
0
def setup_parent_build(configuration, options):
    """Generate the parent Makefile
    """
    print "Setup the PyQwt build."

    sipconfig.ParentMakefile(configuration=configuration,
                             subdirs=options.subdirs).generate()
Ejemplo n.º 2
0
def doit():
    global opt_static
    global opt_debug
    # The name of the SIP build file generated by SIP and used by the build
    # system.
    build_file = "qvarianttest.sbf"

    # Get the PyQt configuration information.
    config = pyqtconfig.Configuration()
    config.pyqt_modules = ['QtCore']

    cmd = " ".join([
        config.sip_bin, "-c", "sipQVariantTest", "-b",
        "sipQVariantTest/" + build_file, "-I", config.pyqt_sip_dir,
        config.pyqt_sip_flags, "qvarianttest.sip"
    ])
    ret = os.system(cmd)

    if ret:
        sys.exit(ret % 255)

    makefile = QVariantTestModuleMakefile(configuration=config,
                                          build_file=build_file,
                                          static=opt_static,
                                          debug=opt_debug,
                                          dir="sipQVariantTest")

    sipconfig.ParentMakefile(configuration=config,
                             subdirs=["sipQVariantTest"]).generate()

    # Generate the Makefile itself.
    makefile.generate()
Ejemplo n.º 3
0
def create_makefiles():
    """Create the additional Makefiles.
    """
    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(configuration=pyqtcfg,
                             subdirs=["qicstable"],
                             installs=("pyqicstableconfig.py",
                                       opt_pyqicstablemoddir)).generate()
Ejemplo n.º 4
0
def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.  Make sure we get the right one.
    sys.path.insert(0, os.path.curdir)
    invalidate_caches()
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(
        configuration=cfg,
        subdirs=["sipgen", "siplib"],
        installs=(["sipconfig.py", os.path.join(src_dir, "sipdistutils.py")],
                cfg.sip_mod_dir)
    ).generate()

    sipconfig.inform("Creating sip code generator Makefile...")

    sipconfig.ProgramMakefile(
        configuration=cfg,
        build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"),
        dir="sipgen",
        install_dir=os.path.dirname(cfg.sip_bin),
        console=1,
        warnings=0,
        universal=opts.universal,
        arch=opts.arch,
        deployment_target=opts.deployment_target
    ).generate()

    sipconfig.inform("Creating sip module Makefile...")

    makefile = sipconfig.ModuleMakefile(
        configuration=cfg,
        build_file=os.path.join(src_dir, "siplib", "siplib.sbf"),
        dir="siplib",
        install_dir=cfg.sip_mod_dir,
        installs=([os.path.join(src_dir, "siplib", "sip.h")], cfg.sip_inc_dir),
        console=1,
        warnings=0,
        static=opts.static,
        debug=opts.debug,
        universal=opts.universal,
        arch=opts.arch,
        deployment_target=opts.deployment_target
    )

    makefile.generate()
Ejemplo n.º 5
0
def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(
        configuration=cfg,
        subdirs=["sipgen", "siplib"],
        installs=(["sipconfig.py", "sipdistutils.py"], cfg.sip_mod_dir)
    ).generate()

    sipconfig.inform("Creating sip code generator Makefile...")

    sipconfig.ProgramMakefile(
        configuration=cfg,
        build_file="sipgen.sbf",
        dir="sipgen",
        install_dir=os.path.dirname(cfg.sip_bin),
        console=1,
        warnings=0,
        universal=opts.universal
    ).generate()

    sipconfig.inform("Creating sip module Makefile...")

    makefile = sipconfig.ModuleMakefile(
        configuration=cfg,
        build_file="siplib.sbf",
        dir="siplib",
        install_dir=cfg.sip_mod_dir,
        installs=(["sip.h"], cfg.sip_inc_dir),
        console=1,
        warnings=0,
        static=opts.static,
        debug=opts.debug,
        universal=opts.universal
    )

    makefile.generate()
Ejemplo n.º 6
0
def main(argv):
    global pyqt_modroot
    pyqt_modroot = os.path.join(pyqt_modroot, "pyvoip")
    installs = [([join('sip', '__init__.py')], pyqt_modroot)]
    debug = False
    build_dirs = []

    try:
        opts, args = getopt.getopt(argv, "d")
    except getopt.GetoptError:
        print(
            "Usage: 'configure.py -d' to build debug version, otherwise ommit this flag."
        )
        sys.exit(2)

    if opts:
        for opt, arg in opts:
            if opt == "-d":
                sipconfig.inform("Building debug libraries...")
                debug = True

    if not debug:
        sipconfig.inform("Building libraries...")

    for module in pyqt_modules:
        mname = module if not debug else mname + "d"
        build_dirs.append(
            generate_code(module,
                          libs=needed_qt_libs(mname),
                          lib_dirs=lib_dirs(module),
                          include_dirs=include_dirs(module),
                          debug=debug))

    # Create the additional Makefiles.
    sipconfig.inform("Creating top level Makefile...")

    sipconfig.ParentMakefile(configuration=pyqtcfg,
                             subdirs=build_dirs,
                             installs=installs).generate()
Ejemplo n.º 7
0
def gen_makefile():
    # Get the SIP configuration information.
    config = sipconfig.Configuration()

    run_sip(config)

    # Create the Makefile in src.
    makefile = sipconfig.SIPModuleMakefile(config,
                                           build_file,
                                           dir=str(SIP_DIR))

    # Add the library we are wrapping.  The name doesn't include any platform
    # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
    # ".dll" extension on Windows).
    makefile.extra_libs = []
    makefile.extra_cxxflags = wxpyconfig.cxxflags
    makefile.extra_lflags = wxpyconfig.lflags

    # Generate the Makefile itself.
    makefile.generate()

    # Create the parent makefile
    root_make = sipconfig.ParentMakefile(config, subdirs=[SIP_DIR])
    root_make.generate()
Ejemplo n.º 8
0
            "-framework QtGui",
            "-framework QtCore",
            "-framework DiskArbitration",
            "-framework IOKit",
            "-framework OpenGL",
            "-framework AGL",
        ]

    else:
        makefile.extra_include_dirs+=[
            os.path.join(qtconfig.QT_INSTALL_HEADERS, "QtCore"),
            os.path.join(qtconfig.QT_INSTALL_HEADERS, "QtGui"),
            os.path.join(qtconfig.QT_INSTALL_HEADERS, "QtWidgets"),
        ]
        makefile.extra_lib_dirs+=[os.path.join('..','src','release')]
        makefile.extra_libs+=['Qt5Core','Qt5Gui','Qt5Widgets']

    makefile.generate()

    sipconfig.ParentMakefile(
        configuration = config,
        subdirs = ["src", output_dir],
    ).generate()

    os.chdir("src")    
    qmake_cmd=qmake_exe
    if sys.platform=="win32": qmake_cmd+=" -spec win32-msvc2010"
    print()
    print(qmake_cmd)
    os.system(qmake_cmd)
    sys.exit()
Ejemplo n.º 9
0
def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.  Make sure we get the right one.
    sys.path.insert(0, os.path.curdir)
    invalidate_caches()
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    if opts.no_tools:
        subdirs = ["siplib"]
        installs = None
    else:
        subdirs = ["sipgen", "siplib"]
        installs = (["sipconfig.py",
                     os.path.join(src_dir,
                                  "sipdistutils.py")], cfg.sip_mod_dir)

    if opts.use_qmake:
        sipconfig.inform("Creating top level .pro file...")

        pro = open("sip.pro", "w")

        pro.write("TEMPLATE = subdirs\n")
        pro.write("SUBDIRS = %s\n" % " ".join(subdirs))

        if installs is not None:
            files, path = installs
            pro.write("\n")
            pro.write("build_system.files = %s\n" % " ".join(files))
            pro.write("build_system.path = %s\n" % quote(path))
            pro.write("INSTALLS += build_system\n")

        pro.close()
    else:
        sipconfig.inform("Creating top level Makefile...")

        sipconfig.ParentMakefile(configuration=cfg,
                                 subdirs=subdirs,
                                 installs=installs).generate()

    if opts.use_qmake:
        sipconfig.inform("Creating sip code generator .pro file...")

        pro = open(os.path.join("sipgen", "sipgen.pro"), "w")

        pro.write("TEMPLATE = app\n")
        pro.write("TARGET = sip\n")
        pro.write("CONFIG -= qt app_bundle\n")
        pro.write("CONFIG += warn_off exceptions_off console %s\n" %
                  (("debug" if opts.debug else "release")))

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")

        pro.write("\n")
        pro.write("target.path = %s\n" % os.path.dirname(cfg.sip_bin))
        pro.write("INSTALLS += target\n")

        c_sources = get_sources("sipgen", "*.c")
        pro.write("\n")
        pro.write("SOURCES = %s\n" % " ".join(c_sources))

        headers = get_sources("sipgen", "*.h")
        pro.write("\n")
        pro.write("HEADERS = %s\n" % " ".join(headers))

        pro.close()
    else:
        sipconfig.inform("Creating sip code generator Makefile...")

        sipconfig.ProgramMakefile(
            configuration=cfg,
            build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"),
            dir="sipgen",
            install_dir=os.path.dirname(cfg.sip_bin),
            console=1,
            warnings=0,
            universal=opts.universal,
            arch=opts.arch,
            deployment_target=opts.deployment_target).generate()

    if opts.use_qmake:
        sipconfig.inform("Creating sip module .pro file...")

        pro = open(os.path.join("siplib", "siplib.pro"), "w")

        pro.write("TEMPLATE = lib\n")
        pro.write("TARGET = %s\n" % sip_module_base)
        pro.write("CONFIG -= qt\n")
        pro.write("CONFIG += warn_on exceptions_off %s %s\n" %
                  (("staticlib" if opts.static else "plugin"),
                   ("debug" if opts.debug else "release")))

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")

        pro.write("\n")
        pro.write("INCLUDEPATH += %s\n" % cfg.py_inc_dir)
        if cfg.py_conf_inc_dir != cfg.py_inc_dir:
            pro.write("INCLUDEPATH += %s\n" % cfg.py_conf_inc_dir)

        if not opts.static:
            # These only need to be correct for Windows.
            debug_suffix = "_d" if opts.debug else ""
            link_lib_dir = quote("-L" + cfg.py_lib_dir)

            pro.write("""
win32 {
    PY_MODULE = %s%s.pyd
    target.files = %s%s.pyd
    LIBS += %s -lpython%d.%d
    QMAKE_POST_LINK = $(COPY_FILE) $(DESTDIR_TARGET) $$PY_MODULE
} else {
    PY_MODULE = %s.so
    target.files = %s.so
    QMAKE_POST_LINK = $(COPY_FILE) $(TARGET) $$PY_MODULE
}

macx {
    QMAKE_LFLAGS += "-undefined dynamic_lookup"
    QMAKE_LFLAGS += "-install_name $$absolute_path($$PY_MODULE, $$target.path)"
}
""" % (sip_module_base, debug_suffix, sip_module_base, debug_suffix,
            link_lib_dir, (py_version >> 16),
            ((py_version >> 8) & 0xff), sip_module_base, sip_module_base))

        pro.write("\n")
        pro.write("target.CONFIG = no_check_exist\n")
        pro.write("target.path = %s\n" % cfg.sip_mod_dir)
        pro.write("INSTALLS += target\n")

        pro.write("\n")
        pro.write("sip_h.files = sip.h\n")
        pro.write("sip_h.path = %s\n" % cfg.sip_inc_dir)
        pro.write("INSTALLS += sip_h\n")

        c_sources = get_sources("siplib", "*.c")
        cpp_sources = get_sources("siplib", "*.cpp")
        pro.write("\n")
        pro.write("SOURCES = %s\n" % " ".join(c_sources + cpp_sources))

        headers = get_sources("siplib", "*.h")
        pro.write("\n")
        pro.write("HEADERS = %s\n" % " ".join(headers))

        pro.close()
    else:
        sipconfig.inform("Creating sip module Makefile...")

        sipconfig.ModuleMakefile(
            configuration=cfg,
            build_file=os.path.join(src_dir, "siplib", "siplib.sbf"),
            dir="siplib",
            install_dir=cfg.sip_mod_dir,
            installs=([os.path.join(src_dir, "siplib",
                                    "sip.h")], cfg.sip_inc_dir),
            console=1,
            warnings=0,
            static=opts.static,
            debug=opts.debug,
            universal=opts.universal,
            arch=opts.arch,
            deployment_target=opts.deployment_target).generate()
Ejemplo n.º 10
0
def create_makefiles(macros):
    """Create the Makefiles.

    macros is the dictionary of platform specific build macros.
    """
    # Bootstrap.  Make sure we get the right one.
    sys.path.insert(0, os.path.curdir)
    invalidate_caches()
    import sipconfig

    cfg = sipconfig.Configuration()

    cfg.set_build_macros(macros)

    all_installs = []
    top_installs = []
    gen_installs = []
    subdirs = []

    if not opts.no_tools:
        subdirs.append('sipgen')
        top_installs.append(
            (["sipconfig.py",
              os.path.join(src_dir, "sipdistutils.py")], cfg.sip_root_dir))
        gen_installs.append((os.path.join(src_dir, "siplib",
                                          "sip.h"), cfg.sip_inc_dir))

    if not opts.no_module:
        subdirs.append('siplib')

    all_installs.extend(top_installs)
    all_installs.extend(gen_installs)

    # The command to run to generate the dist-info directory.
    mk_distinfo = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                               'mk_distinfo.py')
    distinfo_dir = os.path.join(
        cfg.sip_module_dir, '%s-%s.dist-info' %
        (sip_module_name.replace('.', '_'), sip_version_str))

    if opts.use_qmake:
        run_mk_distinfo = '%s %s \\\"$(INSTALL_ROOT)\\\" %s installed.txt' % (
            sys.executable, mk_distinfo, distinfo_dir)

        sipconfig.inform("Creating top level .pro file...")

        pro = open("sip.pro", "w")

        pro.write("TEMPLATE = subdirs\n")
        pro.write("SUBDIRS = %s\n" % " ".join(subdirs))

        if top_installs:
            # There will only be one element.
            files, path = top_installs[0]
            pro.write("\n")
            pro.write("build_system.files = %s\n" % " ".join(files))
            pro.write("build_system.path = %s\n" % quote(path))
            pro.write("INSTALLS += build_system\n")

        if opts.distinfo:
            pro.write("\n")
            pro.write("distinfo.extra = %s\n" % run_mk_distinfo)
            pro.write("distinfo.path = %s\n" % quote(cfg.sip_module_dir))
            pro.write("INSTALLS += distinfo\n")

        pro.close()
    else:
        run_mk_distinfo = '%s %s "$(DESTDIR)" %s installed.txt' % (
            sys.executable, mk_distinfo, distinfo_dir)

        sipconfig.inform("Creating top level Makefile...")

        # Note that mk_distinfo.py won't exist if we are building from the
        # repository.
        if opts.distinfo and os.path.isfile(mk_distinfo):
            top_installs.append((run_mk_distinfo, None))

        sipconfig.ParentMakefile(configuration=cfg,
                                 subdirs=subdirs,
                                 installs=top_installs).generate()

    if opts.use_qmake:
        sipconfig.inform("Creating sip code generator .pro file...")

        pro = open(os.path.join("sipgen", "sipgen.pro"), "w")

        pro.write("TEMPLATE = app\n")
        pro.write("TARGET = sip\n")
        pro.write("CONFIG -= qt app_bundle\n")
        pro.write("CONFIG += warn_on exceptions_off console %s\n" %
                  (("debug" if opts.debug else "release")))

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")

        pro.write("\n")
        pro.write("target.path = %s\n" % os.path.dirname(cfg.sip_bin))
        pro.write("INSTALLS += target\n")

        c_sources = get_sources("sipgen", "*.c")
        pro.write("\n")
        pro.write("SOURCES = %s\n" %
                  " ".join([qmake_quote(s) for s in c_sources]))

        headers = get_sources("sipgen", "*.h")
        pro.write("\n")
        pro.write("HEADERS = %s\n" %
                  " ".join([qmake_quote(h) for h in headers]))

        if gen_installs:
            # There will only be one element.
            files, path = gen_installs[0]
            pro.write("\n")
            pro.write("sip_h.files = %s\n" % " ".join(files))
            pro.write("sip_h.path = %s\n" % quote(path))
            pro.write("INSTALLS += sip_h\n")

        pro.close()
    else:
        sipconfig.inform("Creating sip code generator Makefile...")

        sipconfig.ProgramMakefile(
            configuration=cfg,
            build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"),
            dir="sipgen",
            install_dir=os.path.dirname(cfg.sip_bin),
            installs=gen_installs,
            console=1,
            warnings=1,
            universal=opts.universal,
            arch=opts.arch,
            deployment_target=opts.deployment_target).generate()

    # The implied code generator installs.
    if not opts.no_tools:
        sip_dir, sip_exe = os.path.split(cfg.sip_bin)
        if sys.platform == 'win32':
            sip_exe += '.exe'

        all_installs.append((sip_exe, sip_dir))

    # The module installs.
    module_installs = []

    if opts.pyi:
        module_installs.append((os.path.join(src_dir, 'sip.pyi'), pyi_dir))

    all_installs.extend(module_installs)

    if not opts.no_module:
        if sys.platform == 'win32':
            mod = 'sip.lib' if opts.static else 'sip.pyd'
        else:
            mod = 'libsip.a' if opts.static else 'sip.so'

        all_installs.append((mod, sip_module_dest_dir))

    if opts.use_qmake:
        sipconfig.inform("Creating sip module .pro file...")

        pro = open(os.path.join("siplib", "siplib.pro"), "w")

        pro.write("TEMPLATE = lib\n")
        pro.write("TARGET = sip\n")
        pro.write("CONFIG -= qt\n")
        pro.write("CONFIG += warn_on exceptions_off %s %s\n" %
                  (("staticlib" if opts.static else "plugin plugin_bundle"),
                   ("debug" if opts.debug else "release")))

        pro.write("\n")
        pro.write("# Work around QTBUG-39300.\n")
        pro.write("CONFIG -= android_install\n")

        pro.write("\n")
        pro.write("INCLUDEPATH += %s\n" % cfg.py_inc_dir)
        if cfg.py_conf_inc_dir != cfg.py_inc_dir:
            pro.write("INCLUDEPATH += %s\n" % cfg.py_conf_inc_dir)

        if sip_module_name != 'sip':
            pro.write("\n")
            pro.write('DEFINES += SIP_MODULE_NAME=%s\n' % sip_module_name)

            base_name = sip_module_name.split('.')[-1]
            if base_name != 'sip':
                pro.write('DEFINES += SIP_MODULE_BASENAME=%s\n' % base_name)

        if not opts.static:
            # These only need to be correct for Windows.
            debug_suffix = "_d" if opts.debug else ""
            link_lib_dir = quote("-L" + cfg.py_lib_dir)

            pro.write("""
win32 {
    PY_MODULE = sip%s.pyd
    PY_MODULE_SRC = $(DESTDIR_TARGET)

    LIBS += %s
} else {
    PY_MODULE = sip.so

    macx {
        PY_MODULE_SRC = $(TARGET).plugin/Contents/MacOS/$(TARGET)

        QMAKE_LFLAGS += "-undefined dynamic_lookup"
    } else {
        PY_MODULE_SRC = $(TARGET)
    }
}

QMAKE_POST_LINK = $(COPY_FILE) $$PY_MODULE_SRC $$PY_MODULE

target.CONFIG = no_check_exist
target.files = $$PY_MODULE
""" % (debug_suffix, link_lib_dir))

        pro.write("\n")
        pro.write("target.path = %s\n" % sip_module_dest_dir)
        pro.write("INSTALLS += target\n")

        if opts.pyi:
            pro.write("\n")
            pro.write("sip_pyi.files = sip.pyi\n")
            pro.write("sip_pyi.path = %s\n" % pyi_dir)
            pro.write("INSTALLS += sip_pyi\n")

        c_sources = get_sources("siplib", "*.c")
        cpp_sources = get_sources("siplib", "*.cpp")
        pro.write("\n")
        pro.write("SOURCES = %s\n" %
                  " ".join([qmake_quote(s) for s in c_sources + cpp_sources]))

        headers = get_sources("siplib", "*.h")
        pro.write("\n")
        pro.write("HEADERS = %s\n" %
                  " ".join([qmake_quote(h) for h in headers]))

        pro.close()
    else:
        sipconfig.inform("Creating sip module Makefile...")

        build_dir = os.getcwd()

        makefile = sipconfig.ModuleMakefile(
            configuration=cfg,
            build_file=os.path.join(src_dir, "siplib", "siplib.sbf"),
            dir="siplib",
            install_dir=sip_module_dest_dir,
            installs=module_installs,
            console=1,
            warnings=1,
            static=opts.static,
            debug=opts.debug,
            universal=opts.universal,
            arch=opts.arch,
            deployment_target=opts.deployment_target)

        if sip_module_name != 'sip':
            makefile.DEFINES.append('SIP_MODULE_NAME=%s' % sip_module_name)

            base_name = sip_module_name.split('.')[-1]
            if base_name != 'sip':
                makefile.DEFINES.append('SIP_MODULE_BASENAME=%s' % base_name)

        if src_dir != build_dir:
            src_siplib_dir = os.path.join(src_dir, "siplib")
            makefile.extra_include_dirs.append(src_siplib_dir)
            makefile.extra_source_dirs.append(src_siplib_dir)

        makefile.generate()

    # Create the file containing all installed files.
    if opts.distinfo:
        installed = open('installed.txt', 'w')

        for sources, dst in all_installs:
            if not isinstance(sources, (list, tuple)):
                sources = [sources]

            for src in sources:
                installed.write(
                    os.path.join(dst, os.path.basename(src)) + '\n')

        installed.close()
Ejemplo n.º 11
0
def doit():
	global opt_static
	global opt_debug
	# The name of the SIP build file generated by SIP and used by the build
	# system.
	build_file = "stone.sbf"

	# Get the PyQt configuration information.
	config = pyqtconfig.Configuration()
	config.pyqt_modules = ['QtCore','QtXml','QtNetwork','QtSql']
	config.__dict__["AR"] = "ar r"
    
	sipOutputDir = "sipStone"
	if opt_static == 1:
		sipOutputDir += "Static"
	
	path = os.path.dirname(os.path.abspath(__file__))
	
	try:
		os.mkdir(os.path.join(path,sipOutputDir))
	except: pass
        
	makefileName = "sipMakefile"
	if opt_static == 1:
		makefileName += "Static"

	# Get the extra SIP flags needed by the imported qt module.  Note that
	# this normally only includes those flags (-x and -t) that relate to SIP's
	# versioning system.
	#print config.__dict__

	# Run SIP to generate the code.  Note that we tell SIP where to find the qt
	# module's specification files using the -I flag.
	#config.pyqt_sip_dir = "/usr/share/sip/PyQt4"
	#config.pyqt_sip_dir = "c:\\python24\\sip\\PyQt4\\"
	if sys.platform=="win32":
		sip_bin = "..\\sip\\sipgen\\sip.exe"
	else: 
		sip_bin = config.sip_bin
	cmd = " ".join([sip_bin, "-e", "-k", "-c", sipOutputDir, "-b", sipOutputDir+"/"+build_file, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags, "sip/blurqt.sip"])
	ret = os.system(cmd)
	
	if ret:
		sys.exit(ret%255)
        
	# We are going to install the SIP specification file for this module and
	# its configuration module.

	# Create the Makefile.  The QtModuleMakefile class provided by the
	# pyqtconfig module takes care of all the extra preprocessor, compiler and
	# linker flags needed by the Qt library.
	makefile = StoneModuleMakefile(
		configuration=config,
		build_file=build_file,
		static=opt_static,
		debug=opt_debug,
		# Use the sip mod directory instead in order to adhere to the DESTDIR settings
		install_dir=os.path.join(config.sip_mod_dir,"blur"),
#       install_dir=os.path.join(config.default_mod_dir,"blur"),
		dir=sipOutputDir
	)
	installs = []
	sipfiles = []
	scriptfiles = []

	scriptfilesprefix = "../../../python/blur"
	for s in glob.glob(scriptfilesprefix + "/*.py"):
		if sys.platform == "win32":
			scriptfilesprefix = scriptfilesprefix.replace("/","\\")
		scriptfiles.append(os.path.join(scriptfilesprefix, os.path.basename(s)))

	installs.append([scriptfiles, os.path.join(config.sip_mod_dir, "blur")])

	for s in glob.glob("sip/*.sip"):
		sipfiles.append(os.path.join("sip", os.path.basename(s)))

	# installs.append([sipfiles, os.path.join(config.sip_mod_dir, "blur")])
	installs.append([sipfiles, os.path.join(config.default_sip_dir, "blur")])

	# Use the sip mod directory instead in order to adhere to the DESTDIR settings
	installs.append(["stoneconfig.py", config.sip_mod_dir])
#   installs.append(["stoneconfig.py", config.default_mod_dir])

	if opt_static == 0:
		if os.name == 'nt':
			installs.append(["stone.dll", os.path.join(config.default_mod_dir, "blur")])

	sipconfig.ParentMakefile(
		configuration=config,
		installs=installs,
		subdirs=[sipOutputDir],
        makefile=makefileName
	).generate()

	# Add the library we are wrapping.  The name doesn't include any platform
	# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
	# ".dll" extension on Windows).
	if sys.platform == "win32":
		makefile.extra_libs = ["stone","QtSql4","QtXml4","QtNetwork4"]
	elif sys.platform == "darwin":
		makefile.extra_libs = ["stone"]
	else:
		makefile.extra_libs = ["stone","QtSql","QtXml","QtNetwork"]
		
	makefile.extra_include_dirs = ["../include"]
	makefile.extra_lib_dirs.append( ".." );

	# Generate the Makefile itself.
	makefile.generate()

	# Now we create the configuration module.  This is done by merging a Python
	# dictionary (whose values are normally determined dynamically) with a
	# (static) template.
	content = {
		# Publish where the SIP specifications for this module will be
		# installed.
		"stone_sip_dir":    config.default_sip_dir,

		# Publish the set of SIP flags needed by this module.  As these are the
		# same flags needed by the qt module we could leave it out, but this
		# allows us to change the flags at a later date without breaking
		# scripts that import the configuration module.
		"stone_sip_flags":  config.pyqt_sip_flags
	}

	# This creates the helloconfig.py module from the helloconfig.py.in
	# template and the dictionary.
	sipconfig.create_config_module("stoneconfig.py", "stoneconfig.py.in", content)
Ejemplo n.º 12
0
def doit():
	global opt_static
	global opt_debug
	global opt_generate_code
	
	# The name of the SIP build file generated by SIP and used by the build
	# system.
	build_file = "absubmit.sbf"

	# Get the PyQt configuration information.
	config = pyqtconfig.Configuration()
	config.pyqt_modules = []
	config.__dict__["AR"] = "ar r"

	# Get the extra SIP flags needed by the imported qt module.  Note that
	# this normally only includes those flags (-x and -t) that relate to SIP's
	# versioning system.
#	qt_sip_flags = config.pyqt_qt_sip_flags

	# Run SIP to generate the code.  Note that we tell SIP where to find the qt
	# module's specification files using the -I flag.
	#config.pyqt_sip_dir = "/usr/share/sip/PyQt4"
	#config.pyqt_sip_dir = "c:\\python24\\sip\\PyQt4\\"
	print config.default_sip_dir
	qt_sip_flags = config.pyqt_sip_flags
	if opt_generate_code:
		if sys.platform=="win32":
				sip_bin = "..\\sip\\sipgen\\sip.exe"
		else:
				sip_bin = config.sip_bin
		if not os.path.exists("sipAbsubmit"):
				os.mkdir("sipAbsubmit")
		ret = os.system(" ".join([sip_bin, "-k", "-c", "sipAbsubmit", "-b", "sipAbsubmit/" + build_file, "-I", config.pyqt_sip_dir, "-I", config.default_sip_dir, "-I", config.sip_mod_dir, config.pyqt_sip_flags, "sip/absubmit.sip"]))
		if ret:
			sys.exit(ret%255)
	
	# Create the Makefile.  The QtModuleMakefile class provided by the
	# pyqtconfig module takes care of all the extra preprocessor, compiler and
	# linker flags needed by the Qt library.
	makefile = AbsubmitModuleMakefile(
		configuration=config,
		build_file=build_file,
		static=opt_static,
		debug=opt_debug,
		# Use the sip mod dir to adhere to the DESTDIR env var
		install_dir=os.path.join(config.sip_mod_dir,"blur"),
#		install_dir=os.path.join(config.default_mod_dir,"blur"),
		dir="sipAbsubmit"
	)

	installs = []
	sipfiles = []

	for s in glob.glob("sip/*.sip"):
		sipfiles.append(os.path.join("sip", os.path.basename(s)))

	installs.append([sipfiles, os.path.join(config.default_sip_dir, "blur")])

	# Use the sip mod dir to adhere to the DESTDIR env var
	#installs.append(["absubmitconfig.py", config.sip_mod_dir])
	#installs.append(["absubmitconfig.py", config.default_mod_dir])

	sipconfig.ParentMakefile(
		configuration=config,
		installs=installs,
		subdirs=["sipAbsubmit"]
	).generate()

	# Add the library we are wrapping.  The name doesn't include any platform
	# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
	# ".dll" extension on Windows).
	if sys.platform == "win32":
		makefile.extra_libs = ["absubmit","classes","stone","QtSql4","QtXml4","QtNetwork4","Mpr"]
	elif sys.platform == "darwin":
		makefile.extra_libs = ["absubmit","classes","stone","absubmit"]
	else:
		makefile.extra_libs = ["absubmit","classes","stone","QtSql","QtXml","QtNetwork","absubmit"]

	makefile.extra_include_dirs = ["../.out","../../stone/include","../include","../../classes/autocore","../../classes"]
	makefile.extra_lib_dirs.append( ".." );
	makefile.extra_lib_dirs.append( "../../stone" );
	makefile.extra_lib_dirs.append( "../../classes" );
	

	# Generate the Makefile itself.
	makefile.generate()

	# Now we create the configuration module.  This is done by merging a Python
	# dictionary (whose values are normally determined dynamically) with a
	# (static) template.
	content = {
		# Publish where the SIP specifications for this module will be
		# installed.
		"stone_sip_dir":    config.default_sip_dir,

		# Publish the set of SIP flags needed by this module.  As these are the
		# same flags needed by the qt module we could leave it out, but this
		# allows us to change the flags at a later date without breaking
		# scripts that import the configuration module.
		"stone_sip_flags":  qt_sip_flags
	}
Ejemplo n.º 13
0
def doit():
    global opt_static
    global opt_debug
    # The name of the SIP build file generated by SIP and used by the build
    # system.
    build_file = "epa.sbf"

    # Get the PyQt configuration information.
    config = pyqtconfig.Configuration()
    config.pyqt_modules = ['QtCore', 'QtXml', 'QtNetwork', 'QtSql']
    config.__dict__["AR"] = "ar r"

    # Get the extra SIP flags needed by the imported qt module.  Note that
    # this normally only includes those flags (-x and -t) that relate to SIP's
    # versioning system.
    #print config.__dict__

    # Run SIP to generate the code.  Note that we tell SIP where to find the qt
    # module's specification files using the -I flag.
    #config.pyqt_sip_dir = "/usr/share/sip/PyQt4"
    #config.pyqt_sip_dir = "c:\\python24\\sip\\PyQt4\\"
    cmd = " ".join([
        config.sip_bin, "-c", "sipEpa", "-b", "sipEpa/" + build_file, "-I",
        config.pyqt_sip_dir, config.pyqt_sip_flags, "sip/blurqt.sip"
    ])
    ret = os.system(cmd)

    if ret:
        sys.exit(ret % 255)

    # We are going to install the SIP specification file for this module and
    # its configuration module.

    # Create the Makefile.  The QtModuleMakefile class provided by the
    # pyqtconfig module takes care of all the extra preprocessor, compiler and
    # linker flags needed by the Qt library.
    makefile = EpaModuleMakefile(configuration=config,
                                 build_file=build_file,
                                 static=opt_static,
                                 debug=opt_debug,
                                 install_dir=os.path.join(
                                     config.default_mod_dir, "blur"),
                                 dir="sipEpa")
    installs = []
    sipfiles = []

    for s in glob.glob("sip/*.sip"):
        sipfiles.append(os.path.join("sip", os.path.basename(s)))

    installs.append([sipfiles, os.path.join(config.default_sip_dir, "blur")])

    installs.append(["epaconfig.py", config.default_mod_dir])

    sipconfig.ParentMakefile(configuration=config,
                             installs=installs,
                             subdirs=["sipEpa"]).generate()

    # Add the library we are wrapping.  The name doesn't include any platform
    # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
    # ".dll" extension on Windows).
    if sys.platform == "win32":
        makefile.extra_libs = ["epa", "QtSql4", "QtXml4", "QtNetwork4"]
    elif sys.platform == "darwin":
        makefile.extra_libs = ["epa"]
    else:
        makefile.extra_libs = ["epa", "QtSql", "QtXml", "QtNetwork"]

    makefile.extra_include_dirs = ["../include"]
    makefile.extra_lib_dirs.append("..")

    # Generate the Makefile itself.
    makefile.generate()

    # Now we create the configuration module.  This is done by merging a Python
    # dictionary (whose values are normally determined dynamically) with a
    # (static) template.
    content = {
        # Publish where the SIP specifications for this module will be
        # installed.
        "epa_sip_dir": config.default_sip_dir,

        # Publish the set of SIP flags needed by this module.  As these are the
        # same flags needed by the qt module we could leave it out, but this
        # allows us to change the flags at a later date without breaking
        # scripts that import the configuration module.
        "epa_sip_flags": config.pyqt_sip_flags
    }

    # This creates the helloconfig.py module from the helloconfig.py.in
    # template and the dictionary.
    sipconfig.create_config_module("epaconfig.py", "epaconfig.py.in", content)
Ejemplo n.º 14
0

# Create the Makefile.  The QtModuleMakefile class provided by the
# pyqtconfig module takes care of all the extra preprocessor, compiler and
# linker flags needed by the Qt library.
makefile = BurnerModuleMakefile(
    configuration=config,
    build_file=build_file,
    #	installs=installs,
    static=1,
    debug=sys.argv.count("-u"),
    install_dir=os.path.join(config.sip_mod_dir, "blur"),
    dir="sipBurner")

sipconfig.ParentMakefile(configuration=config,
                         subdirs=["sipBurner"],
                         makefile="sipMakefile").generate()

sipconfig.ParentMakefile(configuration=config,
                         subdirs=["sipBurner"],
                         makefile="sipMakefileStatic").generate()

# Add the library we are wrapping.  The name doesn't include any platform
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
# ".dll" extension on Windows).
makefile.extra_libs = ["classes", "stone", "Mpr"]

makefile.extra_include_dirs = [
    "../../../lib/classes/autocore", "../../../lib/classes",
    "../../../lib/stone/include", "../include",
    "../../../lib/libtorrent/include", "/usr/include/classes",