Example #1
0
def generate_configuration_module(pyqtcfg, popplerqtcfg, opts):
    import sipconfig
    
    content = {
        "pypopplerqt4_sip_dir":    popplerqtcfg['sip_dir'],
        "pypopplerqt4_sip_flags":  pyqtcfg.pyqt_sip_flags,
        "pypopplerqt4_mod_dir":    popplerqtcfg['mod_dir'],
        "pypopplerqt4_modules":    'PopplerQt',
        "popplerqt4_inc_dirs":      popplerqtcfg['inc_dirs'],              
        "popplerqt4_lib_dirs":      popplerqtcfg['lib_dirs'],              
    }

    # This creates the pypopplerqt4config.py module from the pypopplerqt4config.py.in
    # template and the dictionary.
    sipconfig.create_config_module(
        os.path.join(BASE_DIR, "pypopplerqt4config.py"), 
        os.path.join(BASE_DIR, "pypopplerqt4config.py.in"), 
        content)
Example #2
0
def create_config(module, template):
    """Create the PyQMMP configuration module so that it can be imported
    by build scripts.

    module is the module file name.
    template is the template file name.
    """
    sipconfig.inform("Creating %s..." % module)

    content = {
        "pyqmmp_version": pyqmmp_version,
        "pyqmmp_version_str": pyqmmp_version_str,
        "pyqmmp_mod_dir": opt_pyqmmpmoddir,
        "pyqmmp_sip_dir": opt_pyqmmpsipdir,
        "pyqmmp_qmmp_sip_flags": qmmp_sip_flags,
        # These are internal.
        "_pyqmmp_defines": qmmp_define,
        "_pyqmmp_inc_dir": opt_qmmpincdir,
        "_pyqmmp_lib_dir": opt_qmmplibdir,
    }

    sipconfig.create_config_module(module, template, content)
Example #3
0
def main():
    excludeMods = set()

    config = sipconfig.Configuration()

    fn = rootName('config.inc')
    confFile = open(rootName('config.inc'))
    for line in confFile:
        if line.startswith('export') : break
        line = line.strip('\n ')
        if line.startswith('COMPILE_'):
            var, value = line.split('=')
            try:
                value = int(value)
            except ValueError:
                continue
            if not value:
                modname = '_'.join([x.lower() for x in var.split('_')[1:]])
                excludeMods.add(modname)

    for modName, modDirs in modules:
    
        extra_cxxflags = []
        if modName in excludeMods:
            continue
    
        if os.path.exists(modName):
            if not os.path.isdir(modName):
                raise 'Error: %s exists and is not a directory' % modName
        else:
            os.mkdir(modName)

        os.chdir('%s' % modName)

        global rootDir
        orig_rootDir = rootDir
        rootDir = os.path.join('..', rootDir)
    
        sipFileNameSrc = "lima%s.sip" % modName
        if modName != 'core':
            if major == 4 and minor < 12:
                sipFileNameIn = os.path.join("..","limamodules_before_4_12.sip.in")
            else:
                sipFileNameIn = os.path.join("..","limamodules.sip.in")
            f = open(sipFileNameIn)
            lines = f.read()
            f.close()
            newlines = lines.replace('%NAME',modName)
            d = open(sipFileNameSrc,'w')
            d.write(newlines)
            d.close()
        elif major == 4 and minor < 12:
            sipFileNameSrc = "limacore_before_4_12.sip"

        sipFileName = "lima%s_tmp.sip" % modName
        shutil.copyfile(sipFileNameSrc, sipFileName)

        initNumpy = 'lima_init_numpy.cpp'
        shutil.copyfile(os.path.join('..',initNumpy), initNumpy)


        dirProcesslib = rootName(os.path.join('third-party','Processlib'))
        sipProcesslib = os.path.join(dirProcesslib,'sip')
        extraIncludes = ['.', os.path.join('..','core'),
                         sipProcesslib, numpy.get_include(),
                         config.sip_inc_dir]

        extraIncludes += findIncludes(dirProcesslib)
        if platform.system() == 'Windows':
            extraIncludes += [os.path.join(dirProcesslib,"core","include","WindowSpecific")]
            
        coreDirs = modules[0][1]
        extraIncludes += findModuleIncludes('core')
        
        if (modName in espiaModules) and ('espia' not in excludeMods):
            espia_base = '/segfs/bliss/source/driver/linux-2.6/espia'
            espia_incl = os.path.join(espia_base,'src')
            extraIncludes += [espia_incl]
            
        if(modName == 'basler') :
            if platform.system() != 'Windows':
                extraIncludes += ['%s/include' % os.environ['PYLON_ROOT']]
                extraIncludes += ['%s/library/CPP/include' % os.environ['GENICAM_ROOT_V2_1']]
                extra_cxxflags += ['-DUSE_GIGE']
            else:
                extraIncludes += ['%s\library\cpp\include' % os.environ['PYLON_GENICAM_ROOT']]
                extraIncludes += ['%s\include' % os.environ['PYLON_ROOT']]
                extra_cxxflags += ['-DUSE_GIGE']
        elif(modName == 'ueye') and platform.system() != 'Windows':
            extra_cxxflags += ['-D__LINUX__']
        elif(modName == 'andor') :
            extraIncludes += ['/usr/local/include']
        elif(modName == 'xpad'):
            extraIncludes += ['../../third-party/yat/include','/home/xpix_user/PCI_VALIDATED/trunk/sw/xpci_lib']
        elif(modName == 'xspress3'):
            extraIncludes += ['../../third-party/hdf5/c++/src']
            extra_cxxflags += ['-DSIPCOMPILATION']
        elif(modName == 'pco'):
            extraIncludes += ['R:/bliss/projects/LIMA/package/WIN32/PCO/sdkPco/include']
        elif(modName == 'marccd'):
            extraIncludes += ['../../../include/DiffractionImage']
            extraIncludes += ['../../third-party/yat/include']
        elif(modName == 'pointgrey'):
            extraIncludes += ['/usr/include/flycapture']
        elif(modName == 'vieworksvp'):
            extraIncludes += ['../../camera/common/siso-me4/include',
                              '/opt/siso/include'] # howto not hardcode this
        elif(modName == 'rayonixhs'):
            extraIncludes += ['/opt/rayonix/include/craydl','/opt/rayonix/include','/opt/rayonix/include/marccd']
            extra_cxxflags += ['-std=c++0x']
        elif(modName == 'aviex'):
            extra_cxxflags += ['-DOS_UNIX']
        extraIncludes += findModuleIncludes(modName)
	if (modName == 'roperscientific'):
            extraIncludes.remove('../../camera/roperscientific/sdk/msvc/include')
        
        sipFile = open(sipFileName,"a")
        sipFile.write('\n')

        sipProcesslib = sipProcesslib.replace(os.sep,'/') # sip don't manage windows path
        sipFile.write('%%Import %s/processlib_tmp.sip\n' % sipProcesslib)
    
        if modName != 'core':
            sipFile.write('%Import ../core/limacore_tmp.sip\n')
        if (modName in espiaModules) and (modName != 'espia'):
            sipFile.write('%Import ../espia/limaespia_tmp.sip\n')
            extraIncludes += findModuleIncludes('espia')
            
        for sdir in modDirs:
            srcDir = rootName(sdir)
            for root,dirs,files in os.walk(srcDir) :
                dir2rmove = excludeMods.intersection(dirs)
                for dname in dir2rmove:
                    dirs.remove(dname)
        
                for filename in files:
                    base,ext = os.path.splitext(filename)
                    if ext != '.sip':
                        continue
                    if major == 4 and minor < 12:
                        if os.access(os.path.join(root,filename + "_4_12"), os.R_OK):
                            filename += "_4_12"

                    incl = os.path.join(root,filename)
                    incl = incl.replace(os.sep,'/') # sip don't manage windows path.
                    sipFile.write('%%Include %s\n' % incl)

        sipFile.close()

        # The name of the SIP build file generated by SIP and used by the build
        # system.
        build_file = "lima%s.sbf" % modName

        # Run SIP to generate the code.
        # module's specification files using the -I flag.
        if platform.system() == 'Windows':
            if platform.machine() == 'AMD64':
                plat = 'WIN64_PLATFORM'
            else:
                plat = 'WIN32_PLATFORM'
        else:
            plat = 'POSIX_PLATFORM'
        cmdargs = [config.sip_bin,"-g", "-e","-c", '.','-t',plat]
        if 'config' in excludeMods:
            cmdargs.extend(['-x','WITH_CONFIG'])
        cmdargs.extend(["-b", build_file,sipFileName])
        cmd = " ".join(cmdargs)
        print(cmd)
        os.system(cmd)

        #little HACK for adding source
        bfile = open(build_file)
        whole_line = ''
        for line in bfile :
            if 'sources' in line :
                begin,end = line.split('=')
                line = '%s = lima_init_numpy.cpp %s' % (begin,end)
            whole_line += line
        bfile.close()
        bfile = open(build_file,'w')
        bfile.write(whole_line)
        bfile.close()

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

        installs.append([sipFileNameSrc, os.path.join(config.default_sip_dir,
                                                      "lima")])

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

        # 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 = sipconfig.ModuleMakefile(configuration=config,
                                            build_file=build_file,
                                            installs=installs,
                                            export_all = True)
        
        makefile.extra_include_dirs = extraIncludes

        if platform.system() == 'Windows':
            makefile.extra_libs = ['liblima%s' % modName,'libprocesslib','libconfig++']
            if modName != 'core' :
                makefile.extra_libs += ['liblimacore']
            makefile.extra_cxxflags = ['/EHsc','/DWITH_CONFIG'] + extra_cxxflags
            if platform.machine() == 'AMD64':
                libpath = 'build\msvc\9.0\*\\x64\Release'
                makefile.extra_cxxflags.append('/DWITHOUT_GSL')
            else:
                libpath = 'build\msvc\9.0\*\Release'
            
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName(''),libpath))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('third-party\Processlib'), libpath))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('camera'),modName, libpath))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('third-party\libconfig'),'lib','libconfig++.Release'))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('third-party\libconfig'),'lib','x64','Release'))

            if(modName == 'basler') :
                makefile.extra_lib_dirs += ['%s\library\cpp\lib\win32_i86' % os.environ['PYLON_GENICAM_ROOT']]
                makefile.extra_lib_dirs += ['%s\lib\Win32' % os.environ['PYLON_ROOT']]
        else:
            makefile.extra_libs = ['pthread','lima%s' % modName]
            makefile.extra_cxxflags = ['-pthread', '-g','-DWITH_SPS_IMAGE'] + extra_cxxflags
            if 'config' not in excludeMods:
                makefile.extra_cxxflags.append('-DWITH_CONFIG')
            makefile.extra_lib_dirs = [rootName('build')]
        makefile.extra_cxxflags.extend(['-I"%s"' % x for x in extraIncludes])
        
        # 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).
        # None (for me)
        
        # 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.
            "lima_sip_dir":    config.default_sip_dir
            }

        # This creates the lima<mod>config.py module from the limaconfig.py.in
        # template and the dictionary.
        sipconfig.create_config_module("lima%sconfig.py" % modName,
                                       os.path.join("..","limaconfig.py.in"), content)

        # Fix SIP Exception handling
        for cpp_file in glob.glob('siplima*.cpp'):
            modify = checksipexc(cpp_file)
            cpp_file_out = '%s.out' % cpp_file
            if not modify:
                os.remove(cpp_file_out)
            else:
                os.remove(cpp_file)
                shutil.move(cpp_file_out,cpp_file)
            
        os.chdir('..')
        rootDir = orig_rootDir
Example #4
0
"/home/aashish/tools/uv-cdat/paraview/ParaView-3.11.1/build/VTK/Common/Core",
"/home/aashish/tools/uv-cdat/paraview/ParaView-3.11.1/ParaViewCore/ServerManager",
"/home/aashish/tools/uv-cdat/paraview/ParaView-3.11.1/ParaViewCore/ServerImplementation",
"/home/aashish/tools/qt/install-4.7.2/include",
"/home/aashish/tools/qt/install-4.7.2/include/QtCore",
"/home/aashish/tools/qt/install-4.7.2/include/QtGui",
"../"
]

# 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.
    "pvFileDialogModelWrapper_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.
    "pvFileDialogModelWrapper_sip_flags":  pyqt_sip_flags
}

# This creates the pvFileDialogModelWrapperconfig.py module from the pvFileDialogModelWrapperconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pvFileDialogModelWrapperconfig.py", "pvFileDialogModelWrapperconfig.py.in", content)
Example #5
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 = "stonegui.sbf"

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

    sipOutputDir = "sipStonegui"
    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.


#	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
        ret = os.system(" ".join([
            sip_bin, "-e", "-k", "-c", sipOutputDir, "-b",
            sipOutputDir + "/" + build_file, "-I", config.pyqt_sip_dir, "-I",
            config.default_sip_dir, "-I", config.sip_mod_dir,
            config.pyqt_sip_flags, "sip/stonegui.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 = StoneguiModuleMakefile(
        configuration=config,
        build_file=build_file,
        static=opt_static,
        debug=opt_debug,
        # Use the sip mod dir instead 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 = []

    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 instead for DESTDIR adherance
    #installs.append(["stoneguiconfig.py", config.sip_mod_ri])
    #installs.append(["stoneguiconfig.py", config.default_mod_dir])

    if opt_static == 0:
        if os.name == 'nt':
            installs.append(
                ["stonegui.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", "stonegui", "Mpr"
        ]
    elif sys.platform == "darwin":
        makefile.extra_libs = ["stone", "stonegui"]
    else:
        makefile.extra_libs = [
            "stone", "QtSql", "QtXml", "QtNetwork", "stonegui"
        ]

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

    # 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
    }

    # This creates the helloconfig.py module from the helloconfig.py.in
    # template and the dictionary.
    sipconfig.create_config_module("stoneguiconfig.py", "stoneguiconfig.py.in",
                                   content)
Example #6
0
)

# -I (include directories):

#Directories with wrapped heades
makefile.extra_include_dirs.append('..')
for jrDir in jrElementDirs:
  makefile.extra_include_dirs.append(jrRoot+jrDir)

#Directories of headers, which are not wrapped but part of jr-library
for jrDir in ['views', 'gui', ""]:
  makefile.extra_include_dirs.append(jrRoot+jrDir)
  
#headers of libraries jr requires:
for jrDir in ['/usr/include/dxflib']:
  makefile.extra_include_dirs.append(jrDir)

makefile.extra_libs = ["jr","dxflib"]
makefile.extra_lib_dirs = [jrRoot]
 
makefile.generate()
#-----------------------------------------------
#-----------------------------------------------

content = {
  "pyJR_sip_dir":    config.default_sip_dir,
  "pyJR_sip_flags":  pyqt_sip_flags
}
	
sipconfig.create_config_module("pyJRConfig.py", "pyJRConfig.py.in", content)
    installs=installs
)

# 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_lib_dirs = ["build/release"]
makefile.extra_libs = ["build/release/crayfishViewer"]

# 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.
    "crayfish_viewer_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.
    "crayfish_viewer_sip_flags":  pyqt_sip_flags
}

# This creates the helloconfig.py module from the helloconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("crayfish_viewer_config.py", "crayfish_viewer_config.py.in", content)
Example #8
0
    configuration=config,
    build_file=build_file,
    installs=installs)

# 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_lib_dirs.append("..")
makefile.extra_libs = ["qtermwidget"]

# 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.
    "qtermwidget_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.
    "qtermwidget_sip_flags": qt_sip_flags}

# This creates the qtermwidgetconfig.py module from the qtermwidgetconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("qtermwidgetconfig.py", "config.py.in", content)
Example #9
0
if __name__ == "__main__":
    for mname in mlist:
        generate_code(mname)

    makefile_out = []
    for sect in ["all", "install", "clean"]:
        makefile_out.append("\n" + sect + ":")
        for mname in mlist:
            makefile_out.append("\t@(cd %s; $(MAKE) %s)" % (mname, sect))
        if sect == "install":
            makefile_out.append(
                "\t@test -d $(DESTDIR)%s || mkdir -p $(DESTDIR)%s" %
                (pyonyx_modroot, pyonyx_modroot))
            makefile_out.append("\ttouch $(DESTDIR)%s" %
                                (os.path.join(pyonyx_modroot, "__init__.py")))
            makefile_out.append(
                "\tcp -f pyonyxconfig.py $(DESTDIR)%s" %
                (os.path.join(pyonyx_modroot, "pyonyxconfig.py")))

    mkfile = open("Makefile", "w")
    mkfile.writelines([s + "\n" for s in makefile_out])

    content = {
        "pyonyx_sip_dir": config.default_sip_dir,
        "pyonyx_sip_flags": pyqt_sip_flags
    }
    confname = "pyonyxconfig.py"
    sipconfig.create_config_module(confname,
                                   os.path.join(src_dir, confname + ".in"),
                                   content)
Example #10
0
    installs=installs
  )
makefile.extra_include_dirs = [numpy.get_include()]

# 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).
# None (for me)

# 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.
    "pixmaptools_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.
    "pixmaptools_sip_flags":  qt_sip_flags
}

# This creates the pixmaptoolsconfig.py module from the pixmaptoolsconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pixmaptoolsconfig.py", "pixmaptoolsconfig.py.in", content)
Example #11
0
  )
makefile.CXXFLAGS.append('-I/segfs/bliss/depot/pythonbliss/builddir/suse82/PyQt4/PyQwt-5.0.0/qwt-5.0/src')
# 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).
# None (for me)
#os.system('ar rcs libQwt.a %s' % os.path.join(os.path.dirname(Qwt5.__file__),'Qwt.so'))
makefile.LFLAGS.append('-L.')
makefile.extra_libs.append('Qwt')
# 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.
    "qwttools_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.
    "qwttools_sip_flags":  qt_sip_flags
}

# This creates the qwttoolsconfig.py module from the qwttoolsconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("qwttoolsconfig.py", "qwttoolsconfig.py.in", content)
Example #12
0
def main():
    excludeMods = set()

    config = sipconfig.Configuration()

    fn = rootName('config.inc')
    confFile = open(rootName('config.inc'))
    for line in confFile:
        if line.startswith('export'): break
        line = line.strip('\n ')
        if line.startswith('COMPILE_'):
            var, value = line.split('=')
            try:
                value = int(value)
            except ValueError:
                continue
            if not value:
                modname = '_'.join([x.lower() for x in var.split('_')[1:]])
                excludeMods.add(modname)

    for modName, modDirs in modules:

        extra_cxxflags = []
        if modName in excludeMods:
            continue

        if os.path.exists(modName):
            if not os.path.isdir(modName):
                raise 'Error: %s exists and is not a directory' % modName
        else:
            os.mkdir(modName)

        os.chdir('%s' % modName)

        global rootDir
        orig_rootDir = rootDir
        rootDir = os.path.join('..', rootDir)

        sipFileNameSrc = "lima%s.sip" % modName
        if modName != 'core':
            if major == 4 and minor < 12:
                sipFileNameIn = os.path.join("..",
                                             "limamodules_before_4_12.sip.in")
            else:
                sipFileNameIn = os.path.join("..", "limamodules.sip.in")
            f = file(sipFileNameIn)
            lines = f.read()
            f.close()
            newlines = lines.replace('%NAME', modName)
            d = file(sipFileNameSrc, 'w')
            d.write(newlines)
            d.close()
        elif major == 4 and minor < 12:
            sipFileNameSrc = "limacore_before_4_12.sip"

        sipFileName = "lima%s_tmp.sip" % modName
        shutil.copyfile(sipFileNameSrc, sipFileName)

        initNumpy = 'lima_init_numpy.cpp'
        shutil.copyfile(os.path.join('..', initNumpy), initNumpy)

        dirProcesslib = rootName(os.path.join('third-party', 'Processlib'))
        sipProcesslib = os.path.join(dirProcesslib, 'sip')
        extraIncludes = [
            '.',
            os.path.join('..', 'core'), sipProcesslib,
            numpy.get_include(), config.sip_inc_dir
        ]

        extraIncludes += findIncludes(dirProcesslib)
        if platform.system() == 'Windows':
            extraIncludes += [
                os.path.join(dirProcesslib, "core", "include",
                             "WindowSpecific")
            ]

        coreDirs = modules[0][1]
        extraIncludes += findModuleIncludes('core')

        if (modName in espiaModules) and ('espia' not in excludeMods):
            espia_base = '/segfs/bliss/source/driver/linux-2.6/espia'
            espia_incl = os.path.join(espia_base, 'src')
            extraIncludes += [espia_incl]

        if (modName == 'basler'):
            if platform.system() != 'Windows':
                extraIncludes += ['%s/include' % os.environ['PYLON_ROOT']]
                extraIncludes += [
                    '%s/library/CPP/include' % os.environ['GENICAM_ROOT_V2_1']
                ]
                extra_cxxflags += ['-DUSE_GIGE']
            else:
                extraIncludes += [
                    '%s\library\cpp\include' % os.environ['PYLON_GENICAM_ROOT']
                ]
                extraIncludes += ['%s\include' % os.environ['PYLON_ROOT']]
                extra_cxxflags += ['-DUSE_GIGE']
        elif (modName == 'ueye') and platform.system() != 'Windows':
            extra_cxxflags += ['-D__LINUX__']
        elif (modName == 'andor'):
            extraIncludes += ['/usr/local/include']
        elif (modName == 'xpad'):
            extraIncludes += [
                '../../third-party/yat/include',
                '/home/xpix_user/PCI_VALIDATED/trunk/sw/xpci_lib'
            ]
        elif (modName == 'xspress3'):
            extraIncludes += ['../../third-party/hdf5/include']
        elif (modName == 'pco'):
            extraIncludes += [
                'R:/bliss/projects/LIMA/package/WIN32/PCO/sdkPco/include'
            ]
        elif (modName == 'marccd'):
            extraIncludes += ['../../../include/DiffractionImage']
            extraIncludes += ['../../third-party/yat/include']
        elif (modName == 'pointgrey'):
            extraIncludes += ['/usr/include/flycapture']
        elif (modName == 'rayonixhs'):
            extraIncludes += [
                '/opt/rayonix/include/craydl', '/opt/rayonix/include',
                '/opt/rayonix/include/marccd'
            ]
        elif (modName == 'aviex'):
            extra_cxxflags += ['-DOS_UNIX']
        extraIncludes += findModuleIncludes(modName)

        sipFile = open(sipFileName, "a")
        sipFile.write('\n')

        sipProcesslib = sipProcesslib.replace(
            os.sep, '/')  # sip don't manage windows path
        sipFile.write('%%Import %s/processlib_tmp.sip\n' % sipProcesslib)

        if modName != 'core':
            sipFile.write('%Import ../core/limacore_tmp.sip\n')
        if (modName in espiaModules) and (modName != 'espia'):
            sipFile.write('%Import ../espia/limaespia_tmp.sip\n')
            extraIncludes += findModuleIncludes('espia')

        for sdir in modDirs:
            srcDir = rootName(sdir)
            for root, dirs, files in os.walk(srcDir):
                dir2rmove = excludeMods.intersection(dirs)
                for dname in dir2rmove:
                    dirs.remove(dname)

                for filename in files:
                    base, ext = os.path.splitext(filename)
                    if ext != '.sip':
                        continue
                    if major == 4 and minor < 12:
                        if os.access(os.path.join(root, filename + "_4_12"),
                                     os.R_OK):
                            filename += "_4_12"

                    incl = os.path.join(root, filename)
                    incl = incl.replace(os.sep,
                                        '/')  # sip don't manage windows path.
                    sipFile.write('%%Include %s\n' % incl)

        sipFile.close()

        # The name of the SIP build file generated by SIP and used by the build
        # system.
        build_file = "lima%s.sbf" % modName

        # Run SIP to generate the code.
        # module's specification files using the -I flag.
        if platform.system() == 'Windows':
            if platform.machine() == 'AMD64':
                plat = 'WIN64_PLATFORM'
            else:
                plat = 'WIN32_PLATFORM'
        else:
            plat = 'POSIX_PLATFORM'
        cmdargs = [config.sip_bin, "-g", "-e", "-c", '.', '-t', plat]
        if 'config' in excludeMods:
            cmdargs.extend(['-x', 'WITH_CONFIG'])
        cmdargs.extend(["-b", build_file, sipFileName])
        cmd = " ".join(cmdargs)
        print cmd
        os.system(cmd)

        #little HACK for adding source
        bfile = open(build_file)
        whole_line = ''
        for line in bfile:
            if 'sources' in line:
                begin, end = line.split('=')
                line = '%s = lima_init_numpy.cpp %s' % (begin, end)
            whole_line += line
        bfile.close()
        bfile = open(build_file, 'w')
        bfile.write(whole_line)
        bfile.close()

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

        installs.append(
            [sipFileNameSrc,
             os.path.join(config.default_sip_dir, "lima")])

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

        # 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 = sipconfig.ModuleMakefile(configuration=config,
                                            build_file=build_file,
                                            installs=installs,
                                            export_all=True)

        makefile.extra_include_dirs = extraIncludes

        if platform.system() == 'Windows':
            makefile.extra_libs = [
                'liblima%s' % modName, 'libprocesslib', 'libconfig++'
            ]
            if modName != 'core':
                makefile.extra_libs += ['liblimacore']
            makefile.extra_cxxflags = ['/EHsc', '/DWITH_CONFIG'
                                       ] + extra_cxxflags
            if platform.machine() == 'AMD64':
                libpath = 'build\msvc\9.0\*\\x64\Release'
                makefile.extra_cxxflags.append('/DWITHOUT_GSL')
            else:
                libpath = 'build\msvc\9.0\*\Release'

            makefile.extra_lib_dirs += glob.glob(
                os.path.join(rootName(''), libpath))
            makefile.extra_lib_dirs += glob.glob(
                os.path.join(rootName('third-party\Processlib'), libpath))
            makefile.extra_lib_dirs += glob.glob(
                os.path.join(rootName('camera'), modName, libpath))
            makefile.extra_lib_dirs += glob.glob(
                os.path.join(rootName('third-party\libconfig'), 'lib',
                             'libconfig++.Release'))
            makefile.extra_lib_dirs += glob.glob(
                os.path.join(rootName('third-party\libconfig'), 'lib', 'x64',
                             'Release'))

            if (modName == 'basler'):
                makefile.extra_lib_dirs += [
                    '%s\library\cpp\lib\win32_i86' %
                    os.environ['PYLON_GENICAM_ROOT']
                ]
                makefile.extra_lib_dirs += [
                    '%s\lib\Win32' % os.environ['PYLON_ROOT']
                ]
        else:
            makefile.extra_libs = ['pthread', 'lima%s' % modName]
            makefile.extra_cxxflags = ['-pthread', '-g', '-DWITH_SPS_IMAGE'
                                       ] + extra_cxxflags
            if 'config' not in excludeMods:
                makefile.extra_cxxflags.append('-DWITH_CONFIG')
            makefile.extra_lib_dirs = [rootName('build')]
        makefile.extra_cxxflags.extend(['-I"%s"' % x for x in extraIncludes])

        # 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).
        # None (for me)

        # 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.
            "lima_sip_dir": config.default_sip_dir
        }

        # This creates the lima<mod>config.py module from the limaconfig.py.in
        # template and the dictionary.
        sipconfig.create_config_module("lima%sconfig.py" % modName,
                                       os.path.join("..", "limaconfig.py.in"),
                                       content)

        # Fix SIP Exception handling
        for cpp_file in glob.glob('siplima*.cpp'):
            modify = checksipexc(cpp_file)
            cpp_file_out = '%s.out' % cpp_file
            if not modify:
                os.remove(cpp_file_out)
            else:
                os.remove(cpp_file)
                shutil.move(cpp_file_out, cpp_file)

        os.chdir('..')
        rootDir = orig_rootDir
Example #13
0
def main():
    excludeMods = set()

    config = sipconfig.Configuration()

    fn = rootName('config.inc')
    confFile = open(rootName('config.inc'))
    for line in confFile:
        if line.startswith('export') : break
        line = line.strip('\n ')
        if line.startswith('COMPILE_'):
            var, value = line.split('=')
            try:
                value = int(value)
            except ValueError:
                continue
            if not value:
                excludeMods.add(var.split('_')[-1].lower())

    for modName, modDirs in modules:
    
        extra_cxxflags = []
        if modName in excludeMods:
            continue
    
        if os.path.exists(modName):
            if not os.path.isdir(modName):
                raise 'Error: %s exists and is not a directory' % modName
        else:
            os.mkdir(modName)

        os.chdir('%s' % modName)

        global rootDir
        orig_rootDir = rootDir
        rootDir = os.path.join('..', rootDir)
    
        sipFileNameSrc = "lima%s.sip" % modName
        if modName != 'core':
            sipFileNameIn = os.path.join("..","limamodules.sip.in")
            f = file(sipFileNameIn)
            lines = f.read()
            f.close()
            newlines = lines.replace('%NAME',modName)
            d = file(sipFileNameSrc,'w')
            d.write(newlines)
            d.close()

        sipFileName = "lima%s_tmp.sip" % modName
        shutil.copyfile(sipFileNameSrc, sipFileName)

        initNumpy = 'lima_init_numpy.cpp'
        shutil.copyfile(os.path.join('..',initNumpy), initNumpy)


        dirProcesslib = rootName(os.path.join('third-party','Processlib'))
        sipProcesslib = os.path.join(dirProcesslib,'sip')
        extraIncludes = ['.', os.path.join('..','core'),
                         sipProcesslib, numpy.get_include(),
                         config.sip_inc_dir]

        extraIncludes += findIncludes(dirProcesslib)
        if platform.system() == 'Windows':
            extraIncludes += [os.path.join(dirProcesslib,"core","include","WindowSpecific")]
            
        coreDirs = modules[0][1]
        extraIncludes += findModuleIncludes('core')
        
        if (modName in espiaModules) and ('espia' not in excludeMods):
            espia_base = '/segfs/bliss/source/driver/linux-2.6/espia'
            espia_incl = os.path.join(espia_base,'src')
            extraIncludes += [espia_incl]
            
        if(modName == 'basler') :
            extraIncludes += ['/opt/pylon/include','/opt/pylon/include/genicam','/opt/pylon/genicam/library/CPP/include']
            extra_cxxflags += ['-DUSE_GIGE']
        elif(modName == 'ueye') and platform.system() != 'Windows':
            extra_cxxflags += ['-D__LINUX__']

	if (modName == 'mythen') :
            extraIncludes += ['../../camera/mythen/sdk/slsDetectorSoftware/multiSlsDetector',
                              '../../camera/mythen/sdk/slsDetectorSoftware/slsDetector',
                              '../../camera/mythen/sdk/slsDetectorSoftware/MySocketTCP',
                              '../../camera/mythen/sdk/slsDetectorSoftware/slsDetectorAnalysis',
                              '../../camera/mythen/sdk/slsDetectorSoftware/commonFiles',]

        elif(modName == 'marccd'):
	    extraIncludes += ['../../../include/DiffractionImage']
	    extraIncludes += ['../../third-party/yat/include']
        elif(modName == 'andor') :
            extraIncludes += ['/usr/local/include']
#	elif(modName == 'xpad'):
#            extraIncludes += ['../../third-party/yat/include','/home/xpix_user/PCI_VALIDATED/trunk/sw/xpci_lib']

        extraIncludes += findModuleIncludes(modName)
        
        sipFile = open(sipFileName,"a")
        sipFile.write('\n')

        sipProcesslib = sipProcesslib.replace(os.sep,'/') # sip don't manage windows path
        sipFile.write('%%Import %s/processlib_tmp.sip\n' % sipProcesslib)
    
        if modName != 'core':
            sipFile.write('%Import ../core/limacore_tmp.sip\n')
        if (modName in espiaModules) and (modName != 'espia'):
            sipFile.write('%Import ../espia/limaespia_tmp.sip\n')
            extraIncludes += findModuleIncludes('espia')
            
        for sdir in modDirs:
            srcDir = rootName(sdir)
            for root,dirs,files in os.walk(srcDir) :
                dir2rmove = excludeMods.intersection(dirs)
                for dname in dir2rmove:
                    dirs.remove(dname)
        
                for filename in files:
                    base,ext = os.path.splitext(filename)
                    if ext != '.sip':
                        continue
                    incl = os.path.join(root,filename)
                    incl = incl.replace(os.sep,'/') # sip don't manage windows path.
                    sipFile.write('%%Include %s\n' % incl)

        sipFile.close()

        # The name of the SIP build file generated by SIP and used by the build
        # system.
        build_file = "lima%s.sbf" % modName

        # Run SIP to generate the code.
        # module's specification files using the -I flag.
        if platform.system() == 'Windows':
            plat = 'WIN32_PLATFORM'
        else:
            plat = 'POSIX_PLATFORM'
        cmd = " ".join([config.sip_bin,"-g", "-e","-c", '.','-t',plat,
                        "-b", build_file,sipFileName])
        print cmd
        os.system(cmd)

        #little HACK for adding source
        bfile = open(build_file)
        whole_line = ''
        for line in bfile :
            if 'sources' in line :
                begin,end = line.split('=')
                line = '%s = lima_init_numpy.cpp %s' % (begin,end)
            whole_line += line
        bfile.close()
        bfile = open(build_file,'w')
        bfile.write(whole_line)
        bfile.close()

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

        installs.append([sipFileNameSrc, os.path.join(config.default_sip_dir,
                                                      "lima")])

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

        # 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 = sipconfig.ModuleMakefile(configuration=config,
                                            build_file=build_file,
                                            installs=installs,
                                            export_all = True)
        
        makefile.extra_include_dirs = extraIncludes

        if platform.system() == 'Windows':
            makefile.extra_libs = ['liblima%s' % modName,'libprocesslib']
            if modName != 'core' :
                makefile.extra_libs += ['liblimacore']
            makefile.extra_cxxflags = ['/EHsc'] + extra_cxxflags
            #libpath = 'build\msvc\9.0\*\Debug'
            libpath = 'build\msvc\9.0\*\Release'
            #makefile.extra_lib_dirs = glob.glob(os.path.join(rootName('build'),'msvc','9.0','*','Release'))
            
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName(''),libpath))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('third-party\Processlib'), libpath))
            makefile.extra_lib_dirs += glob.glob(os.path.join(rootName('camera'),modName, libpath))

        else:
            makefile.extra_libs = ['pthread','lima%s' % modName]
            makefile.extra_cxxflags = ['-pthread', '-g','-DWITH_SPS_IMAGE'] + extra_cxxflags
            makefile.extra_lib_dirs = [rootName('build')]
        makefile.extra_cxxflags.extend(['-I' + x for x in extraIncludes])
        
        # 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).
        # None (for me)
        
        # 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.
            "lima_sip_dir":    config.default_sip_dir
            }

        # This creates the lima<mod>config.py module from the limaconfig.py.in
        # template and the dictionary.
        sipconfig.create_config_module("lima%sconfig.py" % modName,
                                       os.path.join("..","limaconfig.py.in"), content)

        # Fix SIP Exception handling
        for cpp_file in glob.glob('siplima*.cpp'):
            modify = checksipexc(cpp_file)
            cpp_file_out = '%s.out' % cpp_file
            if not modify:
                os.remove(cpp_file_out)
            else:
                os.remove(cpp_file)
                shutil.move(cpp_file_out,cpp_file)
            
        os.chdir('..')
        rootDir = orig_rootDir
Example #14
0
# Add library path locations for where libQxt is installed
# -
# /usr/local/Qxt/lib - this location is for those who manually installed libQxt
# using "./configure && make" from source
# -
makefile.extra_lib_dirs = ["/usr/local/Qxt/lib"]

# 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.
    "qxtglobalshortcut_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.
    "qxtglobalshortcut_sip_flags":  qt_sip_flags
}

# This creates the qxtglobalshortcutconfig.py module from the qxtglobalshortcutconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("qxtglobalshortcutconfig.py", "config.py.in", content)

Example #15
0
    configuration=config, build_file=build_file, installs=installs,  qt=["QtCore", "QtGui", "QtWidgets"])

# 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_lib_dirs.append("../lib/")
makefile.extra_lib_dirs.append("..")
makefile.extra_libs = ["qtermwidget5"]

# Support for C++11
makefile.extra_cxxflags.append('-std=c++11')

# Generate the Makefile itself.
makefile.generate()

content = {
    # Publish where the SIP specifications for this module will be
    # installed.
    "qtermwidget_sip_dir": config.pyqt_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.
    "qtermwidget_sip_flags": config.pyqt_sip_flags
}

# This creates the qtermwidgetconfig.py module from the qtermwidgetconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("qtermwidgetconfig.py", "config.py.in", content)
Example #16
0
 
os.system(" ".join([ \
    config.sip_bin, \
    "-c", ".", \
    "-b", build_file, \
    "-I", config.pyqt_sip_dir, \
    pyqt_sip_flags, \
    "shortcut.sip" \
]))
 
installs = []
installs.append(["shortcut.sip", os.path.join(config.default_sip_dir, "pyqxtgs")])
installs.append(["shortcut.py", config.default_mod_dir])
 
makefile = pyqtconfig.QtGuiModuleMakefile(
    configuration=config,
    build_file=build_file,
    installs=installs
)
 
makefile.extra_libs = ["pyqxtgs"]
makefile.extra_lib_dirs = [".."]
 
makefile.generate()
 
content = {
    "pyqxtgs_sip_dir":    config.default_sip_dir,
    "pyqxtgs_sip_flags":  pyqt_sip_flags
}
sipconfig.create_config_module("pyqxtgs.py", "pyqxtgs.py.in", content) 
Example #17
0
makefile = pyqtconfig.QtGuiModuleMakefile(configuration=config,
                                          build_file=build_file,
                                          installs=installs)

# 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 = ["qtcontrols"]
makefile.extra_lib_dirs = ["../../"]

# 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.
    "qtcontrols_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.
    "qtcontrols_sip_flags": qt_sip_flags
}

# This creates the qtcontrolsconfig.py module from the qtcontrolsconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("qtcontrolsconfig.py", "config.py.in", content)
Example #18
0
			       os.path.join(PROCESSLIB, 'core', 'include')]
makefile.extra_cxxflags = ['-pthread', '-I' + numpy.get_include(), '-g']
makefile.extra_libs = ['pthread', 'gldisplay', 'limacore', 'processlib',
		       'QtCore', 'QtGui', 'QtOpenGL', 'GL']
makefile.extra_lib_dirs = [os.path.join('..', 'build'), 
			   os.path.join(LIMA, 'build'),
			   os.path.join(PROCESSLIB, 'build'),
			   os.path.join(QTDIR, 'lib')]

# 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).
# None (for me)

# 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.
    'gldisplay_sip_dir':    config.default_sip_dir
}

# This creates the pixmaptoolsconfig.py module from the pixmaptoolsconfig.py.in
# template and the dictionary.
sipconfig.create_config_module('gldisplayconfig.py', 'gldisplayconfig.py.in', content)

Example #19
0
# Generate the Makefile itself.
makefile.generate()

#----------------------------------------------------------------------
# Module config
#----------------------------------------------------------------------




# 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.
    "CaFramework_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.
    "CaFramework_sip_flags":  config.pyqt_sip_flags
}

# This creates the ca_frameworkconfig.py module from the CaFramework_config.py.in
# template and the dictionary.
sipconfig.create_config_module(sipcode_dir + "/CaFramework_config.py", sip_top + "/CaFramework_config.py.in", content)

Example #20
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 = "stonegui.sbf"

	# Get the PyQt configuration information.
	config = pyqtconfig.Configuration()
	config.pyqt_modules = []
	config.__dict__["AR"] = "ar r"
    
	sipOutputDir = "sipStonegui"
	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.
#	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
		ret = os.system(" ".join([sip_bin, "-e", "-k", "-c", sipOutputDir, "-b", sipOutputDir+"/" + build_file, "-I", config.pyqt_sip_dir, "-I", config.default_sip_dir, "-I", config.sip_mod_dir, config.pyqt_sip_flags, "sip/stonegui.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 = StoneguiModuleMakefile(
		configuration=config,
		build_file=build_file,
		static=opt_static,
		debug=opt_debug,
		# Use the sip mod dir instead 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 = []

	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 instead for DESTDIR adherance
	#installs.append(["stoneguiconfig.py", config.sip_mod_ri])
	#installs.append(["stoneguiconfig.py", config.default_mod_dir])
	
	if opt_static == 0:
		if os.name == 'nt':
			installs.append(["stonegui.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","stonegui","Mpr"]
	elif sys.platform == "darwin":
		makefile.extra_libs = ["stone","stonegui"]
	else:
		makefile.extra_libs = ["stone","QtSql","QtXml","QtNetwork","stonegui"]

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

	# 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
	}

	# This creates the helloconfig.py module from the helloconfig.py.in
	# template and the dictionary.
	sipconfig.create_config_module("stoneguiconfig.py", "stoneguiconfig.py.in", content)
Example #21
0
    qt = 1
)

# 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.extend(["nuwidgets"])
makefile.extra_lib_dirs.extend(['.'])

# 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.
    "pynuwidgets_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.
    "pynuwidgets_sip_flags":  qt_sip_flags
}

# This creates the helloconfig.py module from the helloconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pynuwidgetsconfig.py", "pynuwidgetsconfig.py.in", content)
Example #22
0
)

# 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_lib_dirs = [config.qt_lib_dir]
makefile.extra_libs = ["poppler-qt4"]
makefile.extra_include_dirs = [config.qt_inc_dir+"/QtXml", "/usr/include/poppler"]

# 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.
    "pypopplerqt4_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.
    "pypopplerqt4_sip_flags":  qt_sip_flags
}

# This creates the helloconfig.py module from the helloconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pypopplerqt4config.py", "pypopplerqt4config.py.in", content)
Example #23
0
# 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 = ["fakevim"]

makefile.LFLAGS.append("-L../../build/fakevim")
makefile.CXXFLAGS.append("-I../..")

# 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.
    "fakevim_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.
    "fakevim_sip_flags":  pyqt_sip_flags
}

# This creates the fakevimconfig.py module from the fakevimconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("fakevimconfig.py", "../fakevimconfig.py.in", content)

Example #24
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"

    # 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", "sipStone", "-b", "sipStone/" + 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="sipStone")
    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])

    sipconfig.ParentMakefile(configuration=config,
                             installs=installs,
                             subdirs=["sipStone"]).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)
Example #25
0
                                          build_file=build_file,
                                          installs=installs)

# 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 = ["pyqtviewer"]

# 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.
    "pyqtviewer_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.
    "pyqtviewer_sip_flags": pyqt_sip_flags
}

# This creates the pyqtviewerconfig.py module from the pyqtviewerconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pyqtviewerconfig.py", "pyqtviewerconfig.py.in",
                               content)
Example #26
0
else:
    makefile.extra_cxxflags = ['-pthread']
    makefile.extra_include_dirs = ['../core/include',
                                   '../tasks/include',
                                   config.sip_inc_dir,
                                   numpy.get_include()]
    makefile.extra_libs = ['pthread','processlib']
    makefile.extra_lib_dirs = ['../build']

# 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).
# None (for me)

# 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.
    "processlib_sip_dir":    config.default_sip_dir
}

# This creates the pixmaptoolsconfig.py module from the pixmaptoolsconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("processlibconfig.py", "processlibconfig.py.in", content)

Example #27
0
# 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_lib_dirs = [config.qt_lib_dir]
makefile.extra_libs = ["poppler-qt4"]
makefile.extra_include_dirs = [
    config.qt_inc_dir + "/QtXml", "/usr/include/poppler"
]

# 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.
    "pypopplerqt4_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.
    "pypopplerqt4_sip_flags": qt_sip_flags
}

# This creates the helloconfig.py module from the helloconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pypopplerqt4config.py",
                               "pypopplerqt4config.py.in", content)
Example #28
0
config = pyqtconfig.Configuration() 

qt_sip_flags = config.pyqt_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.
os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, "-I", config.pyqt_sip_dir, qt_sip_flags, "qjuliancalendarwidget.sip"]))

installs = []

installs.append(["qjuliancalendarwidget.sip", os.path.join(config.pyqt_sip_dir, "qjuliancalendarwidget")])

installs.append(["qjuliancalendarwidgetconfig.py", config.pyqt_sip_dir])

makefile = pyqtconfig.QtGuiModuleMakefile(
    configuration=config,
    build_file=build_file,
    installs=installs
)

makefile.extra_lib_dirs.append(".")
makefile.extra_libs.append("qjuliancalendarwidget")

makefile.generate()

content = {
    "qjuliancalendarwidget_sip_dir":    config.pyqt_sip_dir,
    "qjuliancalendarwidget_sip_flags":  qt_sip_flags
}

sipconfig.create_config_module("qjuliancalendarwidgetconfig.py", "qjuliancalendarwidgetconfig.py.in", content)
Example #29
0
                                          build_file=build_file,
                                          installs=installs)

# 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 = ["pyqtgui"]

# 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.
    "pyqtgui_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.
    "pyqtgui_sip_flags": pyqt_sip_flags
}

# This creates the pyqtguiconfig.py module from the pyqtguiconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("pyqtguiconfig.py", "pyqtguiconfig.py.in",
                               content)
Example #30
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)
Example #31
0
#debug
##makefile.extra_cflags.append('-g')
##makefile.extra_cxxflags.append('-g')

# 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 = ["cv","cxcore"]
makefile.extra_lflags = [OpencvLib]
# 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.
    "opencv_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.
    "opencv_sip_flags":  qt_sip_flags
}

# This creates the opencvconfig.py module from the opencvconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("opencvconfig.py", "opencvconfig.py.in", content)
Example #32
0
       install_dir=pyonyx_modroot,
       dir=mname
   )
   if mname != "onyx":
      makefile.extra_libs = ["onyx_"+mname]
   makefile.generate()

if __name__ == "__main__":
   for mname in mlist: 
      generate_code(mname)

   makefile_out = []
   for sect in ["all","install","clean"]:
      makefile_out.append("\n" + sect + ":")
      for mname in mlist: 
         makefile_out.append("\t@(cd %s; $(MAKE) %s)" % (mname,sect))
      if sect == "install":
         makefile_out.append("\t@test -d $(DESTDIR)%s || mkdir -p $(DESTDIR)%s" % (pyonyx_modroot,pyonyx_modroot))
         makefile_out.append("\ttouch $(DESTDIR)%s" % (os.path.join(pyonyx_modroot,"__init__.py")))
         makefile_out.append("\tcp -f pyonyxconfig.py $(DESTDIR)%s" % (os.path.join(pyonyx_modroot,"pyonyxconfig.py")))

   mkfile = open("Makefile","w")
   mkfile.writelines([s + "\n" for s in makefile_out])
   
   content = {
       "pyonyx_sip_dir":    config.default_sip_dir,
       "pyonyx_sip_flags":  pyqt_sip_flags
   }
   confname = "pyonyxconfig.py"
   sipconfig.create_config_module(confname, os.path.join(src_dir,confname + ".in"), content)
Example #33
0
)

# 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_lib_dirs = [config.qt_lib_dir]
makefile.extra_libs = ["source-highlight-qt4"]
makefile.extra_include_dirs = [config.qt_inc_dir+"/QtXml", "/usr/include/srchiliteqt/"]

# 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.
    "sourcehighlight_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.
    "sourcehighlight_sip_flags":  qt_sip_flags
}

# This creates the helloconfig.py module from the helloconfig.py.in
# template and the dictionary.
sipconfig.create_config_module("sourcehighlightconfig.py", "sourcehighlightconfig.py.in", content)