예제 #1
0
    def getEnv( self ):
        out = dict( )
        if compiler.isMSVC( ):
            compilerDirs = {
                "msvc2010": "VS100COMNTOOLS",
                "msvc2012": "VS110COMNTOOLS",
                "msvc2013": "VS120COMNTOOLS",
                "msvc2015": "VS140COMNTOOLS"
            }
            architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" }
            crossmodifier = ""
            if not compiler.isNative(): crossmodifier="_cross"
            status, result = subprocess.getstatusoutput( "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" % (
                os.getenv( compilerDirs[ compiler.getCompilerName( ) ] ), architectures[ compiler.architecture( ) + crossmodifier ]) )
            if status != 0:
                print( "Failed to setup msvc compiler", file = sys.stderr )
            out = self.stringToEnv( result )

        elif compiler.isIntel( ):
            architectures = { "x86": "ia32", "x64": "intel64" }
            programFiles = os.getenv( "ProgramFiles(x86)" ) or os.getenv( "ProgramFiles" )
            status, result = subprocess.getstatusoutput(
                "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % (
                    programFiles, architectures[ compiler.architecture( ) ]) )
            if status != 0:
                print( "Failed to setup intel compiler", file = sys.stderr )
            out = self.stringToEnv( result )
        elif compiler.isMinGW( ):
            out = { "Path": os.getenv( "Path" ) }
        return out
예제 #2
0
    def getEnv(self):
        out = dict()
        if compiler.isMSVC():
            compilerDirs = {
                "msvc2010": "VS100COMNTOOLS",
                "msvc2012": "VS110COMNTOOLS",
                "msvc2013": "VS120COMNTOOLS",
                "msvc2015": "VS140COMNTOOLS"
            }
            architectures = {
                "x86": "x86",
                "x64": "amd64",
                "x64_cross": "x86_amd64"
            }
            crossmodifier = ""
            if not compiler.isNative(): crossmodifier = "_cross"
            status, result = subprocess.getstatusoutput(
                "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" %
                (os.getenv(compilerDirs[compiler.getCompilerName()]),
                 architectures[compiler.architecture() + crossmodifier]))
            if status != 0:
                print("Failed to setup msvc compiler", file=sys.stderr)
                exit(1)
            out = self.stringToEnv(result)

        elif compiler.isIntel():
            architectures = {"x86": "ia32", "x64": "intel64"}
            programFiles = os.getenv("ProgramFiles(x86)") or os.getenv(
                "ProgramFiles")
            status, result = subprocess.getstatusoutput(
                "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set"
                % (programFiles, architectures[compiler.architecture()]))
            if status != 0:
                print("Failed to setup intel compiler", file=sys.stderr)
                exit(1)
            out = self.stringToEnv(result)
        elif compiler.isMinGW():
            out = {"Path": os.getenv("Path")}
        return out
예제 #3
0
    def binaryArchiveName(self,
                          pkgSuffix=None,
                          fileType=emergeSettings.get("Packager",
                                                      "7ZipArchiveType",
                                                      "7z")):
        if not pkgSuffix:
            pkgSuffix = ''
            if hasattr(self.subinfo.options.package, 'packageSuffix'
                       ) and self.subinfo.options.package.packageSuffix:
                pkgSuffix = self.subinfo.options.package.packageSuffix

        return "%s-%s-%s-%s%s.%s" % (
            self.package, compiler.architecture(), self.getPackageVersion()[0],
            compiler.getShortName(), pkgSuffix, fileType)
예제 #4
0
    def __init__(self):
        AutoToolsPackageBase.__init__(self)
        self.subinfo.options.make.supportsMultijob = False
        self.subinfo.options.package.packageName = 'openssl'
        self.subinfo.options.package.packSources = False
        if compiler.architecture() == "x64":
            self.platform = "mingw64"
        else:
            self.platform = "mingw"
        self.supportsCCACHE = False

        self.buildInSource = True

        # target install needs perl with native path on configure time
        self.subinfo.options.configure.defines = " shared zlib-dynamic enable-camellia enable-idea enable-mdc2 enable-tlsext enable-rfc3779"
예제 #5
0
    def __init__(self):
        AutoToolsPackageBase.__init__(self)
        self.subinfo.options.make.supportsMultijob = False
        self.subinfo.options.package.packageName = 'openssl'
        self.subinfo.options.package.packSources = False
        if compiler.architecture() == "x64":
            self.platform = "mingw64"
        else:
            self.platform = "mingw"
        self.supportsCCACHE = False

        self.buildInSource = True

        # target install needs perl with native path on configure time
        self.subinfo.options.configure.defines = " shared zlib-dynamic enable-camellia enable-idea enable-mdc2 enable-tlsext enable-rfc3779"
예제 #6
0
 def buildArchitecture(self):
     """return the target CPU architecture"""
     compiler.architecture()
예제 #7
0
파일: info.py 프로젝트: TheOneRing/emerge
 def getArchitecture():
     return "-%s" % compiler.architecture()
예제 #8
0

def _replaceSetting(reg,new,text):
        return re.compile(reg, re.MULTILINE).sub(new,text)

def resetSettings():
    with open( os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini.backup"),"rt+") as fin:
        text = fin.read()
    text = _replaceSetting("^PACKAGE_IGNORES.*$", "PACKAGE_IGNORES =", text)
    text = _replaceSetting("^EMERGE_USE_CCACHE.*$", "#EMERGE_USE_CCACHE = True", text)
    text = _replaceSetting("^Python =.*$", "Python = C:\python34", text)
    text = _replaceSetting("^DOWNLOADDIR =.*$", "#DOWNLOADDIR = C:\kde\download", text)
    with open( os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini"),"wt+") as fout:
        fout.write(text)

if __name__ == "__main__":
    EmergeDebug.setVerbose(3)
    # we don't use the db directly and the file must not be locked
    del InstallDB.installdb
    backup()
    removeFromDB("dev-util")
    removeFromDB("gnuwin32")
    # we cant use the ini support to modify the settings as it would kill the comments
    resetSettings()
    utils.system("cd %s && git clean -xdf" % os.path.join(EmergeStandardDirs.emergeRoot(), "emerge"))
    utils.createDir(EmergeStandardDirs.tmpDir())
    archiveName = os.path.join(EmergeStandardDirs.tmpDir(), "framewroks-sdk-%s-%s-%s.7z" % (compiler.getCompilerName(), compiler.architecture(), datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d')))
    utils.deleteFile(archiveName)
    utils.system("7za  a %s %s -x!build -x!msys -x!dev-utils -x!tmp -x!mingw* -x!etc/kdesettings.ini.backup -x!etc/portage/install.db.backup" % ( archiveName, EmergeStandardDirs.emergeRoot()))
    #utils.copyFile(os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini"), os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini.backup2"),linkOnly=False)
    restore()
예제 #9
0
 def getArchitecture() -> str:
     return "-%s" % compiler.architecture()
예제 #10
0
 def buildArchitecture(self):
     """return the target CPU architecture"""
     compiler.architecture()