def check_minimal_config(self): if sys.platform.startswith("win"): log.info("Found MSBuild.exe : {0}".format( self.os_options['msbuild_path'])) log.info("Found arch : {0}".format(self.os_options['arch'])) log.info("Found build configuration : {0}".format( self.os_options['build_type'])) log.info("Found Visual Studio project : {0}".format( self.os_options['solution_path'])) log.info("Found build path : {0}".format( self.os_options['build_path'])) log.info("Found cython : {0}".format(find_executable("cython"))) else: log.info("Found g++ : {0}".format(find_executable("g++"))) log.info("Found gcc : {0}".format(find_executable("gcc"))) log.info("Found make : {0}".format(find_executable("make"))) log.info("Found gmake : {0}".format(find_executable("gmake"))) log.info("Found cython : {0}".format(find_executable("cython"))) exe = find_executable("pkg-config") log.info("Found pkg-config : {0}".format(exe)) if exe is not None: import pyozw_pkgconfig for lib in self.ctx['libraries'] + [ 'yaml-0.1', 'libopenzwave', 'python', 'python2', 'python3' ]: log.info("Found library {0} : {1}".format( lib, pyozw_pkgconfig.exists(lib)))
def parse_template(sysargv): tmpl = None flavor = None if '--flavor=dev' in sysargv: index = sysargv.index('--flavor=dev') flavor = sysargv.pop(index) tmpl = DevTemplate(sysargv=sysargv) elif '--flavor=git' in sysargv: index = sysargv.index('--flavor=git') flavor = sysargv.pop(index) tmpl = GitTemplate(sysargv=sysargv) elif '--flavor=git_shared' in sysargv: index = sysargv.index('--flavor=git_shared') flavor = sysargv.pop(index) tmpl = GitSharedTemplate(sysargv=sysargv) elif '--flavor=ozwdev' in sysargv: index = sysargv.index('--flavor=ozwdev') flavor = sysargv.pop(index) tmpl = OzwdevTemplate(sysargv=sysargv) elif '--flavor=ozwdev_shared' in sysargv: index = sysargv.index('--flavor=ozwdev_shared') flavor = sysargv.pop(index) tmpl = OzwdevSharedTemplate(sysargv=sysargv) elif '--flavor=embed' in sysargv: index = sysargv.index('--flavor=embed') flavor = sysargv.pop(index) tmpl = EmbedTemplate(sysargv=sysargv) elif '--flavor=embed_shared' in sysargv: index = sysargv.index('--flavor=embed_shared') flavor = sysargv.pop(index) tmpl = EmbedSharedTemplate(sysargv=sysargv) elif '--flavor=shared' in sysargv: index = sysargv.index('--flavor=shared') flavor = sysargv.pop(index) tmpl = SharedTemplate(sysargv=sysargv) if tmpl is None: flavor = 'embed' try: import pyozw_pkgconfig if pyozw_pkgconfig.exists('libopenzwave'): flavor = 'shared' except: log.exception("Can't use precompiled openzwave library") #Default template if flavor == 'embed': log.info("Use embeded package of openzwave") tmpl = EmbedTemplate(sysargv=sysargv) elif flavor == 'shared': log.info("Use precompiled library openzwave") tmpl = SharedTemplate(sysargv=sysargv) tmpl.flavor = flavor if '--cleanozw' in sysargv: index = sysargv.index('--cleanozw') sysargv.pop(index) tmpl.cleanozw = True return tmpl
def check_minimal_config(self): log.info("Found g++ : {0}".format(find_executable("g++"))) log.info("Found gcc : {0}".format(find_executable("gcc"))) log.info("Found make : {0}".format(find_executable("make"))) log.info("Found gmake : {0}".format(find_executable("gmake"))) exe = find_executable("pkg-config") log.info("Found pkg-config : {0}".format(exe)) if exe is not None: import pyozw_pkgconfig for lib in self.ctx['libraries'] + [ 'yaml-0.1', 'libopenzwave', 'python', 'python2', 'python3' ]: log.info("Found library {0} : {1}".format( lib, pyozw_pkgconfig.exists(lib)))
def parse_template(sysargv): tmpl = None flavor = None if '--flavor=dev' in sysargv: index = sysargv.index('--flavor=dev') flavor = sysargv.pop(index) tmpl = DevTemplate(sysargv=sysargv) elif '--flavor=git' in sysargv: index = sysargv.index('--flavor=git') flavor = sysargv.pop(index) tmpl = GitTemplate(sysargv=sysargv) elif '--flavor=git_shared' in sysargv: index = sysargv.index('--flavor=git_shared') flavor = sysargv.pop(index) tmpl = GitSharedTemplate(sysargv=sysargv) elif '--flavor=ozwdev' in sysargv: index = sysargv.index('--flavor=ozwdev') flavor = sysargv.pop(index) tmpl = OzwdevTemplate(sysargv=sysargv) elif '--flavor=ozwdev_shared' in sysargv: index = sysargv.index('--flavor=ozwdev_shared') flavor = sysargv.pop(index) tmpl = OzwdevSharedTemplate(sysargv=sysargv) elif '--flavor=embed' in sysargv: index = sysargv.index('--flavor=embed') flavor = sysargv.pop(index) tmpl = EmbedTemplate(sysargv=sysargv) elif '--flavor=embed_shared' in sysargv: index = sysargv.index('--flavor=embed_shared') flavor = sysargv.pop(index) tmpl = EmbedSharedTemplate(sysargv=sysargv) elif '--flavor=shared' in sysargv: index = sysargv.index('--flavor=shared') flavor = sysargv.pop(index) tmpl = SharedTemplate(sysargv=sysargv) if tmpl is None: flavor = 'embed' try: import pyozw_pkgconfig if pyozw_pkgconfig.exists('libopenzwave'): try: from Cython.Distutils import build_ext flavor = 'shared' except ImportError: log.info("Can't find cython") except: log.info("Can't find pkg-config") #Default template if flavor == 'embed': log.info("Use embeded package of openzwave") tmpl = EmbedTemplate(sysargv=sysargv) elif flavor == 'shared': log.info("Use precompiled library openzwave") tmpl = SharedTemplate(sysargv=sysargv) tmpl.flavor = flavor if '--cleanozw' in sysargv: index = sysargv.index('--cleanozw') sysargv.pop(index) tmpl.cleanozw = True log.info('sysargv', sysargv) print('sysargv', sysargv) return tmpl