Пример #1
0
 def setDependencies(self):
     self.buildDependencies['virtual/base'] = 'default'
     self.buildDependencies['dev-util/perl'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.dependencies['win32libs/zlib'] = 'default'
     elif compiler.isMSVC() and compiler.isX86():
         self.buildDependencies['dev-util/nasm'] = 'default'
Пример #2
0
    def unpack( self ):
        destdir = os.path.join( self.sourceDir(), "bin" )
        utils.createDir( self.sourceDir() )
        utils.createDir( destdir )

        postfix = ""
        if self.buildType() == "Debug":
            postfix = "d"

        srcdir = None
        files = []
        if compiler.isMinGW():
            if self.subinfo.options.features.legacyGCC:
                if compiler.isMinGW_W32():
                    srcdir = os.path.join( self.rootdir, "mingw", "bin" )
                elif compiler.isMinGW_W64():
                    srcdir = os.path.join( self.rootdir, "mingw64", "bin" )
                files = [ 'libgcc_s_sjlj-1.dll', 'libgomp-1.dll' ]
            else:
                files = [ 'libgomp-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll' ]
                if compiler.isMinGW_W32():
                    files.append('libgcc_s_sjlj-1.dll')
                    srcdir = os.path.join( self.rootdir, "mingw", "bin" )                    
                elif compiler.isMinGW_W64():
                    files.append('libgcc_s_seh-1.dll')
                    srcdir = os.path.join( self.rootdir, "mingw64", "bin" )

        elif compiler.isMSVC():
            if compiler.isX86() and os.environ["PROCESSOR_ARCHITECTURE"] == "AMD64":
                srcdir = os.path.join( os.environ["SystemRoot"], "SysWOW64") 
            else:
                srcdir = os.path.join( os.environ["SystemRoot"], "System32")

            if compiler.isMSVC2010():
                files = [
                    "msvcr100%s.dll" % postfix,
                    "msvcp100%s.dll" % postfix
                ]
            elif compiler.isMSVC2013():
                files = [
                    "msvcr120%s.dll" % postfix,
                    "msvcp120%s.dll" % postfix
                ]
            elif compiler.isMSVC2015():
                files = [
                    "concrt140%s.dll" % postfix,
                    "msvcp140%s.dll" % postfix,
                    "vccorlib140%s.dll" % postfix,
                    "vcruntime140%s.dll" % postfix
                ]
        for file in files:
            utils.copyFile( os.path.join( srcdir, file ), os.path.join( destdir, file ), False )

        return True
    def printEnv( self ):
        self.env = self.getEnv( )
        self.version = int(emergeSettings.get("Version", "EMERGE_SETTINGS_VERSION"))

        self.addEnvVar( "KDEROOT", EmergeStandardDirs.emergeRoot( ) )

        if emergeSettings.getboolean( "Compile", "UseCCache", False ):
            self.addEnvVar( "CCACHE_DIR",
                            emergeSettings.get( "Paths", "CCACHE_DIR", os.path.join( EmergeStandardDirs.emergeRoot( ),
                                                                                     "build", "CCACHE" ) ) )

        if self.version < 2:
            self.addEnvVar( "GIT_SSH", "plink" )
            self.addEnvVar( "SVN_SSH", "plink" )

        if not "HOME" in self.env.keys():
            self.addEnvVar( "HOME", os.getenv( "USERPROFILE" ) )

        self.addEnvVar( "PKG_CONFIG_PATH", os.path.join( EmergeStandardDirs.emergeRoot( ), "lib", "pkgconfig" ) )

        self.addEnvVar( "QT_PLUGIN_PATH", "%s;%s;%s" % (
            os.path.join( EmergeStandardDirs.emergeRoot( ), "plugins" ),
            os.path.join( EmergeStandardDirs.emergeRoot( ), "lib", "plugins" ),
            os.path.join( EmergeStandardDirs.emergeRoot( ), "lib", "plugin" )) )
        self.addEnvVar( "XDG_DATA_DIRS", os.path.join( EmergeStandardDirs.emergeRoot( ), "share" ) )

        if emergeSettings.getboolean("QtSDK", "Enabled", "false"):
            self.prependPath( "Path", os.path.join( emergeSettings.get("QtSDK", "Path") , emergeSettings.get("QtSDK", "Version"), emergeSettings.get("QtSDK", "Compiler"), "bin"))
        
        if compiler.isMinGW( ):
            if not emergeSettings.getboolean("QtSDK", "Enabled", "false"):
                if compiler.isX86( ):
                    self.prependPath( "Path", os.path.join( EmergeStandardDirs.emergeRoot( ), "mingw", "bin" ) )
                else:
                    self.prependPath( "Path", os.path.join( EmergeStandardDirs.emergeRoot( ), "mingw64", "bin" ) )
            else:
                self.prependPath( "Path", os.path.join( emergeSettings.get("QtSDK", "Path") ,"Tools", emergeSettings.get("QtSDK", "Compiler"), "bin" ))
        
        if self.args.mode == "bat":  #don't put emerge.bat in path when using powershell
            self.prependPath( "Path", os.path.join( EmergeStandardDirs.emergeRoot( ), "emerge", "bin" ) )
        self.prependPath( "Path", os.path.join( EmergeStandardDirs.emergeRoot( ), "dev-utils", "bin" ) )

        #make sure thate emergeroot bin is the first to look for dlls etc
        self.prependPath( "Path", os.path.join( EmergeStandardDirs.emergeRoot( ), "bin" ) )

        # add python site packages to pythonpath
        self.prependPath( "PythonPath",  os.path.join( EmergeStandardDirs.emergeRoot( ), "lib", "site-packages"))

        for var, value in emergeSettings.getSection( "Environment" ):  #set and overide existing values
            self.addEnvVar( var, value )
        for key, val in self.env.items( ):
            print( "%s=%s" % (key, val) )