diff --git a/bin/BuildSystem/AutoToolsBuildSystem.py b/bin/BuildSystem/AutoToolsBuildSystem.py --- a/bin/BuildSystem/AutoToolsBuildSystem.py +++ b/bin/BuildSystem/AutoToolsBuildSystem.py @@ -12,15 +12,15 @@ def __init__( self ): BuildSystemBase.__init__(self, "autotools") self._shell = MSysShell() - if compiler.isX86(): + if craftCompiler.isX86(): self.platform = "--host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 " else: self.platform = "--host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 " @property def makeProgram(self): make = "make " - if self.subinfo.options.make.supportsMultijob and not compiler.isMSVC(): + if self.subinfo.options.make.supportsMultijob and not craftCompiler.isMSVC(): make += " -j%s" % os.getenv("NUMBER_OF_PROCESSORS") return make @@ -45,7 +45,7 @@ self.shell.environment[ "CFLAGS" ] = self.subinfo.options.configure.cflags + self.shell.environment[ "CFLAGS" ] self.shell.environment[ "CXXFLAGS" ] = self.subinfo.options.configure.cxxflags + self.shell.environment[ "CXXFLAGS" ] self.shell.environment[ "LDFLAGS" ] = self.subinfo.options.configure.ldflags + self.shell.environment[ "LDFLAGS" ] - if compiler.isMSVC() or self.subinfo.options.configure.bootstrap == True: + if craftCompiler.isMSVC() or self.subinfo.options.configure.bootstrap == True: autogen = os.path.join(self.sourceDir(), "autogen.sh") if os.path.exists(autogen): self.shell.execute(self.sourceDir(), autogen) diff --git a/bin/BuildSystem/BoostBuildSystem.py b/bin/BuildSystem/BoostBuildSystem.py --- a/bin/BuildSystem/BoostBuildSystem.py +++ b/bin/BuildSystem/BoostBuildSystem.py @@ -23,28 +23,28 @@ def configureOptions( self, defines="" ): """returns default configure options""" options = BuildSystemBase.configureOptions(self) - + if OsUtils.isWin(): options += " -j"+ os.getenv("NUMBER_OF_PROCESSORS") options += " --build-dir=" + self.buildDir() else: # TODO: real value options += " install --prefix=%s" % self.buildDir() options += " -j10" - - + + options += (" --build-type=minimal" # " --debug-configuration" " threading=multi" ) - + if not self.subinfo.options.buildStatic: options += (" link=shared" " runtime-link=shared") else: options += (" link=static" " runtime-link=static") - if compiler.isX64(): + if craftCompiler.isX64(): options += " address-model=64 architecture=x86" else: options += " address-model=32 architecture=x86" @@ -55,19 +55,19 @@ options += " variant=release" options += " toolset=" - if compiler.isClang(): + if craftCompiler.isClang(): options += "clang" - if compiler.isGCC(): + if craftCompiler.isGCC(): options += " threadapi=pthread" - elif compiler.isMinGW(): + elif craftCompiler.isMinGW(): options += "gcc" - elif compiler.isMSVC(): - platform = str(compiler.msvcPlatformToolset()) - if compiler.isMSVC2017(): + elif craftCompiler.isMSVC(): + platform = str(craftCompiler.msvcPlatformToolset()) + if craftCompiler.isMSVC2017(): options += f"msvc-{platform[:2]}.0" else: options += f"msvc-{platform[:2]}.{platform[2:]}" - elif compiler.isIntel(): + elif craftCompiler.isIntel(): options += "intel" options += " -sINTEL_PATH=\"%s\"" % os.path.join( os.getenv( "INTELDIR" ), "bin", os.getenv( "TARGET_ARCH" ) ) options += " -sINTEL_BASE_MSVC_TOOLSET=vc-%s" % ({ "vs2008" : "9_0", "vs2010" : "10_0", "vs2012" : "11_0" }[os.getenv("INTEL_VSSHELL")]) @@ -84,7 +84,7 @@ """implements the make step for cmake projects""" self.boost = portage.getPackageInstance('win32libs', 'boost-headers') self.subinfo.targetInstSrc[ self.subinfo.buildTarget ] = os.path.join(self.boost.sourceDir(),"libs",self.subinfo.targetInstSrc[ self.subinfo.buildTarget ],"build") - + self.enterSourceDir() cmd = "bjam" cmd += self.configureOptions(self.subinfo.options.configure.args) @@ -101,18 +101,18 @@ else: if not BuildSystemBase.install(self): return False - + for root, dirs, files in os.walk( self.buildDir() ): for f in files: if f.endswith( ".dll" ): utils.copyFile( os.path.join( root, f ),os.path.join( self.imageDir(), "lib", f ) ) utils.copyFile( os.path.join( root, f ),os.path.join( self.imageDir(), "bin", f ) ) elif f.endswith( ".a" ) or f.endswith( ".lib" ): utils.copyFile( os.path.join( root, f ), os.path.join( self.imageDir(), "lib", f ) ) - - - + + + return True def unittest( self ): diff --git a/bin/BuildSystem/BuildSystemBase.py b/bin/BuildSystem/BuildSystemBase.py --- a/bin/BuildSystem/BuildSystemBase.py +++ b/bin/BuildSystem/BuildSystemBase.py @@ -5,7 +5,7 @@ """ \package BuildSystemBase""" from CraftDebug import craftDebug from CraftBase import * -import compiler +from compiler import craftCompiler from CraftOS.osutils import OsUtils @@ -19,7 +19,7 @@ """constructor""" CraftBase.__init__(self) self.supportsNinja = False - self.supportsCCACHE = craftSettings.getboolean("Compile","UseCCache", False ) and compiler.isMinGW() + self.supportsCCACHE = craftSettings.getboolean("Compile","UseCCache", False ) and craftCompiler.isMinGW() self.supportsClang = True self.buildSystemType = typeName @@ -37,12 +37,12 @@ del os.environ["MAKE"] if OsUtils.isWin(): - if compiler.isMSVC() or compiler.isIntel() : + if craftCompiler.isMSVC() or craftCompiler.isIntel() : return "nmake /NOLOGO" - elif compiler.isMinGW(): + elif craftCompiler.isMinGW(): return "mingw32-make" else: - craftDebug.log.critical("unknown %s compiler" % self.compiler()) + craftDebug.log.critical(f"unknown {craftCompiler} compiler") elif OsUtils.isUnix(): return "make" @@ -70,7 +70,7 @@ if self.supportsCCACHE: defines += " %s" % self.ccacheOptions() - if compiler.isClang() and self.supportsClang: + if craftCompiler.isClang() and self.supportsClang: defines += " %s" % self.clangOptions() return defines diff --git a/bin/BuildSystem/CMakeBuildSystem.py b/bin/BuildSystem/CMakeBuildSystem.py --- a/bin/BuildSystem/CMakeBuildSystem.py +++ b/bin/BuildSystem/CMakeBuildSystem.py @@ -10,7 +10,7 @@ import utils from BuildSystem.CMakeDependencies import * from BuildSystem.BuildSystemBase import * -import compiler +from compiler import craftCompiler import utils from CraftOS.osutils import OsUtils @@ -28,21 +28,21 @@ if self.makeProgram == "ninja": return "Ninja" if OsUtils.isWin(): - if compiler.isMSVC() and not (self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE) or compiler.isIntel(): + if craftCompiler.isMSVC() and not (self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE) or craftCompiler.isIntel(): return "NMake Makefiles" else: - if compiler.isMSVC2017(): - return "Visual Studio 15 2017" + (" Win64" if compiler.isX64() else "") - elif compiler.isMSVC2015(): - return "Visual Studio 14 2015" + (" Win64" if compiler.isX64() else "") - elif compiler.isMSVC2010(): + if craftCompiler.isMSVC2017(): + return "Visual Studio 15 2017" + (" Win64" if craftCompiler.isX64() else "") + elif craftCompiler.isMSVC2015(): + return "Visual Studio 14 2015" + (" Win64" if craftCompiler.isX64() else "") + elif craftCompiler.isMSVC2010(): return "Visual Studio 10" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): return "MinGW Makefiles" elif OsUtils.isUnix(): return "Unix Makefiles" else: - craftDebug.log.critical("unknown %s compiler" % self.compiler()) + craftDebug.log.critical(f"unknown {craftCompiler} compiler") def __onlyBuildDefines( self, buildOnlyTargets ): """This method returns a list of cmake defines to exclude targets from build""" @@ -95,8 +95,8 @@ if( not self.buildType() == None ): options += " -DCMAKE_BUILD_TYPE=%s" % self.buildType() - if compiler.isGCC() and not compiler.isNative(): - options += " -DCMAKE_TOOLCHAIN_FILE=%s" % os.path.join( CraftStandardDirs.craftRoot(), "craft", "bin", "toolchains", "Toolchain-cross-mingw32-linux-%s.cmake" % compiler.architecture()) + if craftCompiler.isGCC() and not craftCompiler.isNative(): + options += " -DCMAKE_TOOLCHAIN_FILE=%s" % os.path.join(CraftStandardDirs.craftRoot(), "craft", "bin", "toolchains", "Toolchain-cross-mingw32-linux-%s.cmake" % craftCompiler.architecture) if OsUtils.isWin(): options += " -DKDE_INSTALL_USE_QT_SYS_PATHS=ON" @@ -117,7 +117,7 @@ if self.subinfo.options.cmake.useCTest: options += " -DCMAKE_PROGRAM_PATH=\"%s\" " % \ ( os.path.join( self.mergeDestinationDir(), "dev-utils", "svn", "bin" ).replace( "\\", "/" ) ) - if compiler.isIntel(): + if craftCompiler.isIntel(): # this is needed because otherwise it'll detect the MSVC environment options += " -DCMAKE_CXX_COMPILER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "icl.exe" ).replace( "\\", "/" ) options += " -DCMAKE_C_COMPILER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "icl.exe" ).replace( "\\", "/" ) @@ -143,12 +143,12 @@ self.enterBuildDir() if self.subinfo.options.cmake.openIDE: - if compiler.isMSVC2010(): + if craftCompiler.isMSVC2010(): command = "start vcexpress %s" % self.__slnFileName() elif self.subinfo.options.cmake.useIDE: - if compiler.isMSVC2015(): + if craftCompiler.isMSVC2015(): command = "msbuild /maxcpucount %s /t:ALL_BUILD /p:Configuration=\"%s\"" % (self.__slnFileName(), self.buildType()) - elif compiler.isMSVC2010(): + elif craftCompiler.isMSVC2010(): craftDebug.log.critical("has to be implemented"); elif self.subinfo.options.cmake.useCTest: # first make clean @@ -173,7 +173,7 @@ env = os.environ if self.subinfo.options.install.useMakeToolForInstall: - if compiler.isMSVC2015() and (self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE): + if craftCompiler.isMSVC2015() and (self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE): command = "msbuild INSTALL.vcxproj /p:Configuration=\"%s\"" % self.buildType() else: env["DESTDIR"] = self.installDir() @@ -200,7 +200,7 @@ return out def clangOptions(self): - if compiler.isMSVC(): + if craftCompiler.isMSVC(): return " -DCMAKE_CXX_COMPILER=clang-cl" \ " -DCMAKE_C_COMPILER=clang-cl" return out diff --git a/bin/BuildSystem/MSBuildBuildSystem.py b/bin/BuildSystem/MSBuildBuildSystem.py --- a/bin/BuildSystem/MSBuildBuildSystem.py +++ b/bin/BuildSystem/MSBuildBuildSystem.py @@ -16,7 +16,7 @@ for target in self.msbuildTargets: if not utils.system(f"msbuild /m /t:{target} \"{self.subinfo.options.configure.projectFile}\"" f" /p:Configuration={buildType}" - f" /tv:{compiler.internalVerison()}.0 /property:PlatformToolset=v{compiler.msvcPlatformToolset()}" + f" /tv:{craftCompiler.internalVerison()}.0 /property:PlatformToolset=v{craftCompiler.msvcPlatformToolset()}" f" {defines}"): return False return True diff --git a/bin/BuildSystem/QMakeBuildSystem.py b/bin/BuildSystem/QMakeBuildSystem.py --- a/bin/BuildSystem/QMakeBuildSystem.py +++ b/bin/BuildSystem/QMakeBuildSystem.py @@ -4,7 +4,7 @@ # definitions for the qmake build system from CraftDebug import craftDebug import utils -import compiler +from compiler import craftCompiler from CraftOS.osutils import OsUtils @@ -15,28 +15,30 @@ class QMakeBuildSystem(BuildSystemBase): def __init__( self ): BuildSystemBase.__init__(self, "qmake") + self.qtVer = CraftVersion(portage.getPackageInstance("libs", "qt5").subinfo.buildTarget) self.platform = "" + #todo: use new craftCompiler platform code if OsUtils.isWin(): - if compiler.isMSVC(): - if compiler.isClang(): - self.platform = "win32-clang-%s" % (self.compiler() if CraftVersion(self.subinfo.buildTarget) < CraftVersion("5.8") else "msvc") + if craftCompiler.isMSVC(): + if craftCompiler.isClang(): + self.platform = "win32-clang-%s" % (craftCompiler.abi.split("_")[0] if self.qtVer < CraftVersion("5.8") else "msvc") else: - self.platform = "win32-%s" % (self.compiler() if CraftVersion(self.subinfo.buildTarget) < CraftVersion("5.8") else "msvc") - elif compiler.isMinGW(): + self.platform = "win32-%s" % (craftCompiler.abi.split("_")[0] if self.qtVer < CraftVersion("5.8") else "msvc") + elif craftCompiler.isMinGW(): self.platform = "win32-g++" - elif compiler.isIntel(): + elif craftCompiler.isIntel(): self.platform = "win32-icc" else: - craftDebug.log.critical("QMakeBuildSystem: unsupported compiler platform %s" % self.compiler()) + craftDebug.log.critical(f"QMakeBuildSystem: unsupported compiler platform {craftCompiler}") elif OsUtils.isUnix(): if OsUtils.isMac(): osPart = "macx" elif OsUtils.isFreeBSD(): osPart = "freebsd" else: osPart = "linux" - if compiler.isClang(): + if craftCompiler.isClang(): compilerPart = "clang" else: compilerPart = "g++" @@ -75,9 +77,9 @@ # There is a bug in jom that parallel installation of qmake projects # does not work. So just use the usual make programs. It's hacky but # this was decided on the 2012 Windows sprint. - if compiler.isMSVC() or compiler.isIntel(): + if craftCompiler.isMSVC() or craftCompiler.isIntel(): installmake="nmake /NOLOGO" - elif compiler.isMinGW(): + elif craftCompiler.isMinGW(): installmake="mingw32-make" else: installmake = self.makeProgram @@ -97,8 +99,8 @@ def runTest( self ): """running qmake based unittests""" return True - - + + def configureOptions( self, defines=""): """returns default configure options""" defines += BuildSystemBase.configureOptions(self, defines) @@ -108,12 +110,12 @@ elif self.buildType() == "Debug": defines += ' "CONFIG += debug"' defines += ' "CONFIG -= release"' - + return defines - + def ccacheOptions(self): return ' "QMAKE_CC=ccache gcc" "QMAKE_CXX=ccache g++" "CONFIG -= precompile_header" ' - + def clangOptions(self): if OsUtils.isUnix(): return ' "CONFIG -= precompile_header" ' diff --git a/bin/CraftBase.py b/bin/CraftBase.py --- a/bin/CraftBase.py +++ b/bin/CraftBase.py @@ -12,7 +12,7 @@ from CraftDebug import craftDebug import utils import portage -import compiler +from compiler import craftCompiler from CraftConfig import * import utils @@ -116,20 +116,15 @@ """return currently selected build type""" return craftSettings.get("Compile","BuildType") - def compiler(self): - """deprecated""" - """return currently selected compiler""" - return compiler.getCompilerName() - def buildArchitecture(self): """return the target CPU architecture""" - compiler.architecture() + craftCompiler.architecture() def workDirPattern(self): """return base directory name for package related work directory""" directory = "" if self.subinfo.options.useCompilerType == True: - directory += "%s-" % compiler.getCompilerName() + directory += "%s-" % craftCompiler.getCompilerName() if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: directory += "ide-" if self.subinfo.options.useBuildType == False: @@ -145,7 +140,7 @@ directory = "image" if self.subinfo.options.useCompilerType == True: - directory += '-' + compiler.getCompilerName() + directory += '-' + craftCompiler.getCompilerName() if self.subinfo.options.useBuildType == True: directory += '-' + self.buildType() directory += '-' + self.buildTarget @@ -281,7 +276,7 @@ fileType = f".{fileType}" else: fileType = "" - return f"{self.package}-{compiler.architecture()}-{version}-{compiler.getShortName()}{pkgSuffix}{fileType}" + return f"{self.package}-{craftCompiler.architecture}-{version}-{craftCompiler.getShortName()}{pkgSuffix}{fileType}" def cacheLocation(self) -> str: if craftSettings.getboolean("QtSDK", "Enabled", "False"): @@ -291,14 +286,14 @@ version = "Qt_%s" % version cacheDir = craftSettings.get("Packager", "CacheDir", os.path.join(CraftStandardDirs.downloadDir(), "binary")) return os.path.join(cacheDir, sys.platform, version, - compiler.getCompilerName(), self.buildType()) + craftCompiler.getCompilerName(), self.buildType()) def cacheRepositoryUrls(self) -> [str]: if craftSettings.getboolean("QtSDK", "Enabled", "False"): version = "QtSDK_%s" % craftSettings.get("QtSDK", "Version") else: version = portage.getPackageInstance("libs", "qtbase").subinfo.buildTarget version = "Qt_%s" % version return ["/".join([url, sys.platform, version, - compiler.getCompilerName(), self.buildType()]) for url in craftSettings.get("Packager", "RepositoryUrl").split(";")] + craftCompiler.getCompilerName(), self.buildType()]) for url in craftSettings.get("Packager", "RepositoryUrl").split(";")] diff --git a/bin/CraftSetupHelper.py b/bin/CraftSetupHelper.py --- a/bin/CraftSetupHelper.py +++ b/bin/CraftSetupHelper.py @@ -11,7 +11,7 @@ from CraftConfig import * from CraftOS.osutils import OsUtils -import compiler +from compiler import craftCompiler # The minimum python version for craft please edit here @@ -59,7 +59,7 @@ blackList = [] if OsUtils.isWin(): blackList += ["sh"] - if compiler.isMSVC(): + if craftCompiler.isMSVC(): blackList += ["gcc", "g++"] for app in blackList: location = shutil.which(app) @@ -104,7 +104,7 @@ with TemporaryUseShortpath(False): printRow("Craft Root", CraftStandardDirs.craftRoot()) printRow("Craft", CraftStandardDirs.craftRoot( )) - printRow("Compiler", compiler.getCompilerName( )) + printRow("ABI", craftCompiler) printRow("Svn directory", CraftStandardDirs.svnDir( )) printRow("Git directory", CraftStandardDirs.gitDir( )) printRow("Download directory", CraftStandardDirs.downloadDir( )) @@ -132,13 +132,13 @@ os.environ[ key ] = value def getEnv( self ): - if compiler.isMSVC( ): + if craftCompiler.isMSVC(): architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" } - version = compiler.internalVerison() + version = craftCompiler.internalVerison() vswhere = os.path.join(CraftStandardDirs.craftBin(), "3rdparty", "vswhere", "vswhere.exe") path = subprocess.getoutput(f"\"{vswhere}\"" f" -version \"[{version},{version+1})\" -property installationPath -legacy -nologo -latest") - arg = architectures[ compiler.architecture() ] + ("_cross" if not compiler.isNative() else "") + arg = architectures[ craftCompiler.architecture] + ("_cross" if not craftCompiler.isNative() else "") path = os.path.join(path, "VC") if version >= 15: path = os.path.join(path, "Auxiliary","Build") @@ -149,12 +149,12 @@ exit(1) return self.stringToEnv( result ) - elif compiler.isIntel( ): + elif craftCompiler.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( ) ]) ) + programFiles, architectures[ craftCompiler.architecture]) ) if status != 0: print( "Failed to setup intel compiler", file = sys.stderr ) exit(1) @@ -218,9 +218,9 @@ if craftSettings.getboolean("QtSDK", "Enabled", "false"): self.prependPath( "PATH", os.path.join( craftSettings.get("QtSDK", "Path") , craftSettings.get("QtSDK", "Version"), craftSettings.get("QtSDK", "Compiler"), "bin")) - if compiler.isMinGW( ): + if craftCompiler.isMinGW(): if not craftSettings.getboolean("QtSDK", "Enabled", "false"): - if compiler.isX86( ): + if craftCompiler.isX86(): self.prependPath( "PATH", os.path.join( CraftStandardDirs.craftRoot( ), "mingw", "bin" ) ) else: self.prependPath( "PATH", os.path.join( CraftStandardDirs.craftRoot( ), "mingw64", "bin" ) ) diff --git a/bin/Packager/CollectionPackagerBase.py b/bin/Packager/CollectionPackagerBase.py --- a/bin/Packager/CollectionPackagerBase.py +++ b/bin/Packager/CollectionPackagerBase.py @@ -87,7 +87,7 @@ directory = "image" if package.subinfo.options.useCompilerType == True: - directory += '-' + compiler.getCompilerName() + directory += '-' + craftCompiler.getCompilerName() if package.subinfo.options.useBuildType == True: directory += '-' + package.buildType() directory += '-' + buildTarget diff --git a/bin/Packager/InnoSetupPackager.py b/bin/Packager/InnoSetupPackager.py --- a/bin/Packager/InnoSetupPackager.py +++ b/bin/Packager/InnoSetupPackager.py @@ -80,7 +80,7 @@ # srcCmd = "" if( self.subinfo.options.package.withCompiler ): - pkgName += "-%s" % compiler.getShortName() + pkgName += "-%s" % craftCompiler.getShortName() dstpath = self.packageDestinationDir() diff --git a/bin/Packager/NullsoftInstallerPackager.py b/bin/Packager/NullsoftInstallerPackager.py --- a/bin/Packager/NullsoftInstallerPackager.py +++ b/bin/Packager/NullsoftInstallerPackager.py @@ -53,9 +53,9 @@ def _setDefaults(self): - self.defines.setdefault( "architecture", compiler.architecture()) + self.defines.setdefault( "architecture", craftCompiler.architecture) self.defines.setdefault( "company", "KDE") - self.defines.setdefault( "defaultinstdir", "$PROGRAMFILES64" if compiler.isX64() else "$PROGRAMFILES") + self.defines.setdefault( "defaultinstdir", "$PROGRAMFILES64" if craftCompiler.isX64() else "$PROGRAMFILES") self.defines.setdefault( "executable", "") self.defines.setdefault( "icon", "") self.defines.setdefault( "license", "") @@ -123,15 +123,15 @@ return _path def getVCRedistLocation(self): - if not compiler.isMSVC(): + if not craftCompiler.isMSVC(): return "none" _file = None - if compiler.isMSVC(): + if craftCompiler.isMSVC(): arch = "x86" - if compiler.isX64(): arch = "x64" - if compiler.isMSVC2015(): + if craftCompiler.isX64(): arch = "x64" + if craftCompiler.isMSVC2015(): _file = os.path.join( self.getVCRuntimeLibrariesLocation(), "1033", f"vcredist_{arch}.exe" ) - elif compiler.isMSVC2017(): + elif craftCompiler.isMSVC2017(): _file = os.path.join(self.getVCRuntimeLibrariesLocation(), "..", "14.10.25008", f"vcredist_{arch}.exe") if not os.path.isfile(_file): craftDebug.new_line() diff --git a/bin/compiler.py b/bin/compiler.py --- a/bin/compiler.py +++ b/bin/compiler.py @@ -7,181 +7,204 @@ import subprocess import re -from CraftDebug import craftDebug +from CraftDebug import craftDebug, deprecated import utils from CraftConfig import * +class Compiler(object): + __supportedPlatforms = ["windows", "linux", "macos", "freebsd"] + + def __init__(self): + compiler = craftSettings.get("General","KDECOMPILER", "") + if compiler != "": + arch = "32" if craftSettings.get("General", "Architecture") == "x86" else "64" + if compiler.startswith("msvc"): + split = ["windows", f"{compiler}_{arch}" , "cl"] + elif compiler.startswith("mingw"): + split = ["windows", f"mingw_{arch}", "gcc"] + if not craftSettings.getboolean("ContinuousIntegration", "Enabled", False): + print(f"Your using the old compiler setting\n" + f"\t[General]\n" + f"\tKDECOMPILER={compiler}\n" + f"please update your settings to\n" + f"\t[General]\n" + f"\tABI=" + "-".join(split), + file=sys.stderr) + else: + split = craftSettings.get("General","ABI").split("-") + if len(split) != 3: + raise Exception("Invalid compiler: " + craftSettings.get("General","ABI")) + + self._platform, self._abi, self._compiler = split + + self._architecture = "x86" if self._abi.endswith("32") else "x64" + + if not self._platform in Compiler.__supportedPlatforms: + raise Exception("Unsupported platform: " + self._platform) + + def __str__(self): + return f"{self.platform}-{self.abi}-{self.compiler}" + + @property + def platform(self): + return self._platform + + @property + def abi(self): + return self._abi + + @property + def compiler(self): + return self._compiler + + @property + def architecture(self): + return self._architecture + + def _getGCCTarget(self): + result = utils.utilsCache.getCommandOutput("gcc", "-dumpmachine") + if result: + result = result.strip() + craftDebug.log.debug(f"GCC Target Processor: {result}") + else: + # if no mingw is installed return mingw-w32 it is part of base + if self.isX64(): + result = "x86_64-w64-mingw32" + else: + result = "i686-w64-mingw32" + return result + + def isNative(self): + # TODO: any reason to keep that? + return craftSettings.getboolean("General", "Native", True) + + def isX64(self): + return self.architecture == "x64" + + def isX86(self): + return self.architecture == "x86" + + def isGCC(self): + return self.compiler == "gcc" + + def isClang(self): + return self.compiler == "clang" + def isGCCLike(self): + return self.isGCC() or self.isClang() -def _getGCCTarget(): - result = utils.utilsCache.getCommandOutput("gcc", "-dumpmachine") - if result: - result = result.strip() - craftDebug.log.debug(f"GCC Target Processor: {result}") - else: - #if no mingw is installed return mingw-w32 it is part of base - if isX64(): - result = "x86_64-w64-mingw32" + def isCl(self): + return self.compiler == "cl" + + def isMinGW(self): + return self.abi == "mingw" + + def isMinGW_W32(self): + return self.isMinGW() and self.isX86() + + def isMinGW_W64(self): + return self.isMinGW() and self.isX64() + + def isMSVC(self): + return self.abi.startswith("msvc") + + def isMSVC2010(self): + return self.abi == "msvc10" + + def isMSVC2012(self): + return self.abi == "msvc12" + + def isMSVC2013(self): + return self.abi == "msvc13" + + def isMSVC2015(self): + return self.abi == "msvc15" + + def isMSVC2017(self): + return self.abi == " msvc17" + + def isIntel(self): + return self.compiler == "intel" + + @deprecated("self.compiler") + def getCompilerExecutableName(self): + return self.compiler + + @deprecated("craftCompiler") + def getCompilerName(self): + return str(craftCompiler) + + @deprecated("craftCompiler") + def getSimpleCompilerName(self): + return str(craftCompiler) + + def getGCCLikeVersion(self, compilerExecutable): + result = utils.utilsCache.getCommandOutput(compilerExecutable, "--version") + if result: + result = re.findall("\d+\.\d+\.?\d*", result)[0] + craftDebug.log.debug("{0} Version: {1}".format(compilerExecutable, result)) + return result or "0" + + def getVersion(self): + if self.isGCCLike(): + return self.getGCCLikeVersion(self.getCompilerExecutableName()) + elif self.isMSVC(): + return self.internalVerison() + else: + return None + + def getVersionWithName(self): + if self.isGCCLike(): + return f"{self.getCompilerName()} {self.getVersion()}" + elif self.isIntel(): + return os.getenv("PRODUCT_NAME_FULL") + elif self.isMSVC(): + return f"Microsoft Visual Studio {self.getVersion()}" else: - result = "i686-w64-mingw32" - return result - -def architecture(): - return craftSettings.get("General", "Architecture" ) - -def isNative(): - return craftSettings.getboolean("General", "Native", True) - -def isX64(): - return architecture() == "x64" - -def isX86(): - return architecture() == "x86" - - -def _compiler(): - return craftSettings.get("General","KDECOMPILER") - -def isGCC(): - return isMinGW() or _compiler().endswith("-gcc") - -def isClang(): - return _compiler().endswith("-clang") - -def isGCCLike(): - return (isGCC() or isClang()) - -def isMinGW(): - return _compiler().startswith("mingw") - -def isMinGW_W32(): - return isMinGW() and _getGCCTarget() == "i686-w64-mingw32" - -def isMinGW_W64(): - return isMinGW() and isX64() - -def isMSVC(): - return _compiler().startswith("msvc") - -def isMSVC2010(): - return _compiler().startswith("msvc2010") - -def isMSVC2012(): - return _compiler().startswith("msvc2012") - -def isMSVC2013(): - return _compiler().startswith("msvc2013") - -def isMSVC2015(): - return _compiler().startswith("msvc2015") - -def isMSVC2017(): - return _compiler().startswith("msvc2017") - -def isIntel(): - return _compiler() == "intel" - -def getCompilerExecutableName(): - if isGCC(): - return "gcc" - elif isClang(): - return "clang" - elif isMSVC(): - return "cl" - else: - craftDebug.log.critical(f"Unsupported Compiler {_compiler()}") - -def getCompilerName(): - if isMinGW(): - return "mingw-w64" - elif isMSVC(): - return _compiler() - elif isIntel(): - return "intel-%s-%s" % (os.getenv("TARGET_ARCH"), os.getenv("TARGET_VS")) - elif isGCC(): - return "gcc" - elif isClang(): - return "clang" - else: - craftDebug.log.critical("Unknown Compiler %s" % _compiler()) - -def getSimpleCompilerName(): - if isMinGW(): - return "mingw64" - elif isMSVC(): - return "msvc" - elif isIntel(): - return "intel" - else: - return getCompilerName() - -def getGCCLikeVersion(compilerExecutable): - result = utils.utilsCache.getCommandOutput(compilerExecutable, "--version") - if result: - result = re.findall("\d+\.\d+\.?\d*",result)[0] - craftDebug.log.debug("{0} Version: {1}".format(compilerExecutable, result)) - return result or "0" - -def getVersion(): - if isGCCLike(): - return getGCCLikeVersion(getCompilerExecutableName()) - elif isMSVC(): - return "20{0}".format(_compiler()[len(_compiler())-2:]) - else: - return None - -def getVersionWithName(): - if isGCCLike(): - return f"{getCompilerName()} {getVersion()}" - elif isIntel(): - return os.getenv("PRODUCT_NAME_FULL") - elif isMSVC(): - return f"Microsoft Visual Studio {getVersion()}" - else: - return None - -def getShortName(): - if not isMSVC(): - return getCompilerName() - return f"vc{internalVerison()}" - - -def internalVerison(): - if not isMSVC(): - return getVersion() - versions = { - "msvc2010": 10, - "msvc2012": 11, - "msvc2013": 12, - "msvc2015": 14, - "msvc2017": 15 - } - c = _compiler().split("-", 1)[0] - if c not in versions: - craftDebug.log.critical(f"Unknown MSVC Compiler {c}") - return versions[c] - - -def msvcPlatformToolset(): - versions = { - "msvc2010": 100, - "msvc2012": 110, - "msvc2013": 120, - "msvc2015": 140, - "msvc2017": 141 - } - c = _compiler().split("-", 1)[0] - if c not in versions: - craftDebug.log.critical(f"Unknown MSVC Compiler {c}") - return versions[c] + return None + + def getShortName(self): + if not self.isMSVC(): + return self.getCompilerName() + return f"vc{self.internalVerison()}" + + def internalVerison(self): + if not self.isMSVC(): + return self.getVersion() + versions = { + "msvc2010": 10, + "msvc2012": 11, + "msvc2013": 12, + "msvc2015": 14, + "msvc2017": 15 + } + c = self.abi.split("_")[0] + if c not in versions: + craftDebug.log.critical(f"Unknown MSVC Compiler {self.abi}") + return versions[c] + + def msvcPlatformToolset(self): + versions = { + "msvc2010": 100, + "msvc2012": 110, + "msvc2013": 120, + "msvc2015": 140, + "msvc2017": 141 + } + c = self.abi.split("_")[0] + if c not in versions: + craftDebug.log.critical(f"Unknown MSVC Compiler {self.abi}") + return versions[c] + +craftCompiler = Compiler() if __name__ == '__main__': print("Testing Compiler.py") - print("Configured compiler (KDECOMPILER): %s" % _compiler()) - print("Version: %s" % getVersionWithName()) - print("Compiler Name: %s" % getCompilerName()) - print("Native compiler: %s" % ("No", "Yes")[isNative()]) - if isGCCLike(): - print("Compiler Version: %s" % getGCCLikeVersion(getCompilerExecutableName())) - print("Compiler Target: %s" % _getGCCTarget()) + print(f"Configured compiler (ABI): {craftCompiler}") + print("Version: %s" % craftCompiler.getVersionWithName()) + print("Compiler Name: %s" % craftCompiler.getCompilerName()) + print("Native compiler: %s" % ("No", "Yes")[craftCompiler.isNative()]) + if craftCompiler.isGCCLike(): + print("Compiler Version: %s" % craftCompiler.getGCCLikeVersion(craftCompiler.getCompilerExecutableName())) + print("Compiler Target: %s" % craftCompiler._getGCCTarget()) diff --git a/bin/craft.py b/bin/craft.py --- a/bin/craft.py +++ b/bin/craft.py @@ -22,7 +22,7 @@ import collections import copy -import compiler +from compiler import craftCompiler import portageSearch import InstallDB import portage @@ -159,7 +159,7 @@ print( "%s-%s" % ( packageName, package.sourceVersion( ) ) ) success = True elif buildAction == "print-package-version": - print( "%s-%s-%s" % ( packageName, compiler.getCompilerName( ), package.sourceVersion( ) ) ) + print( "%s-%s-%s" % (packageName, craftCompiler.getCompilerName(), package.sourceVersion())) success = True else: success = craftDebug.log.error("could not understand this buildAction: %s" % buildAction) diff --git a/bin/info.py b/bin/info.py --- a/bin/info.py +++ b/bin/info.py @@ -11,7 +11,7 @@ from collections import OrderedDict import utils -import compiler +from compiler import craftCompiler from options import * import VersionInfo import CraftHash diff --git a/bin/shells.py b/bin/shells.py --- a/bin/shells.py +++ b/bin/shells.py @@ -9,7 +9,7 @@ from CraftDebug import craftDebug import utils -import compiler +from compiler import craftCompiler from options import * @@ -24,10 +24,10 @@ self._sh = os.path.join( self.msysdir, "usr", "bin", "bash.exe" ) mergeroot = self.toNativePath(CraftStandardDirs.craftRoot()) - if compiler.isMSVC(): + if craftCompiler.isMSVC(): ldflags = "" cflags = " -O2 -MD -GR -W3 -EHsc -D_USE_MATH_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS" # dynamic and exceptions enabled - if compiler.msvcPlatformToolset() > 120: + if craftCompiler.msvcPlatformToolset() > 120: cflags += " -FS" else: ldflags = "-L%s/lib " % mergeroot @@ -45,17 +45,17 @@ if "make" in self.environment: del self.environment[ "make" ] arch = "32" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "64" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.environment[ "MSYSTEM" ] = f"MINGW{arch}_CRAFT" - elif compiler.isMSVC(): + elif craftCompiler.isMSVC(): self.environment["MSYSTEM"] = f"CYGWIN{arch}_CRAFT" self.environment[ "CFLAGS" ] = cflags self.environment[ "CXXFLAGS" ] = cflags self.environment[ "LDFLAGS" ] = ldflags - if compiler.isMSVC(): + if craftCompiler.isMSVC(): if False: cl = "clang-cl" else: diff --git a/bin/test/test_Portage.py b/bin/test/test_Portage.py --- a/bin/test/test_Portage.py +++ b/bin/test/test_Portage.py @@ -27,13 +27,13 @@ class TestAPI(CraftPortageTest): def test_mingw_x86(self): - self.portageTest("mingw4", "x86") + self.portageTest("windows-mingw-gcc", "x86") def test_mingw_x64(self): - self.portageTest("mingw4", "x64") + self.portageTest("windows-mingw-gcc", "x64") def test_msvc2015_x86(self): - self.portageTest("msvc2015", "x86") + self.portageTest("windows-msvc2015-cl", "x86") def test_msvc2015_x64(self): - self.portageTest("msvc2015", "x64") + self.portageTest("windows-msvc2015-cl", "x64") diff --git a/kdesettings.ini b/kdesettings.ini --- a/kdesettings.ini +++ b/kdesettings.ini @@ -6,14 +6,15 @@ [General] -## Here you set the compiler to be used. -## mingw4 - use the mingw gcc compiler (recommended) -## msvc2015 or msvc2017 - use the Microsoft Visual C++ compiler -## on macOS: use mac-clang -## on Linux: use linux-gcc or linux-clang -KDECompiler = msvc2015 -## possible values x86 or x64 -Architecture = x64 +## Here you set the ABI to be used. +## #platform-#abi-#compiler +## Valid combinations are: +## windows-msvc[2015, 2017]_[32, 64]-[cl, clang] +## windows-mingw_[32, 64]-[gcc, clang] +## linux-[32, 64]-[gcc, clang] +## macos-[32, 64]-clang +## freebsd-[32, 64]-clang +ABI = windows-msvc2015_64-cl ## This option should be set to False if you use the msvc 201X Express Edition 64bit compiler ## in all other cases, simply keep this option commented out #Native=False diff --git a/portage/binary/gpg4win-e5/gpg4win-e5.py b/portage/binary/gpg4win-e5/gpg4win-e5.py --- a/portage/binary/gpg4win-e5/gpg4win-e5.py +++ b/portage/binary/gpg4win-e5/gpg4win-e5.py @@ -16,7 +16,7 @@ from Package.CMakePackageBase import * import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -44,7 +44,7 @@ return False # This package is built with MinGW gcc, since the msvc expects a different # Name it shall get it. - if compiler.isMSVC(): + if craftCompiler.isMSVC(): gcc_names = glob.glob( self.sourceDir() + '/lib/*.dll.a' ) for gcc_name in gcc_names: msvc_name = gcc_name.replace( ".dll.a", ".lib" ) diff --git a/portage/binary/mysql/mysql.py b/portage/binary/mysql/mysql.py --- a/portage/binary/mysql/mysql.py +++ b/portage/binary/mysql/mysql.py @@ -13,7 +13,7 @@ baseURL = "http://dev.mysql.com/get/Downloads/MySQL-5.7/" ver = '5.7.18' arch = "32" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "x64" self.targets[ ver ] = f"{baseURL}mysql-{ver}-win{arch}.zip" self.targetInstSrc[ ver ] = f"mysql-{ver}-win{arch}" @@ -38,7 +38,7 @@ shutil.copy( os.path.join( self.sourceDir() , "lib" , "libmysqld.dll" ) , os.path.join( self.installDir(), "bin" , "libmysqld.dll" ) ) shutil.copy( os.path.join( self.sourceDir() , "lib" , "libmysql.dll" ) , os.path.join( self.installDir(), "bin" , "libmysql.dll" ) ) shutil.copytree( os.path.join( self.sourceDir() , "lib" ) , os.path.join( self.installDir(), "lib") , ignore=shutil.ignore_patterns('*.pdb','*.map','debug*','libmysqld.dll','libmysql.dll','mysql*') ) - if compiler.isMinGW(): + if craftCompiler.isMinGW(): utils.createImportLibs( "libmysqld" , self.installDir() ) utils.createImportLibs( "libmysql" , self.installDir() ) shutil.copytree( os.path.join( self.sourceDir() , "include" ) , os.path.join( self.installDir(), "include" ) , ignore=shutil.ignore_patterns('*.def') ) diff --git a/portage/binary/php/php.py b/portage/binary/php/php.py --- a/portage/binary/php/php.py +++ b/portage/binary/php/php.py @@ -11,7 +11,7 @@ versions = utils.utilsCache.getNightlyVersionsFromUrl("http://windows.php.net/downloads/releases", re.compile(r"7\.\d\.\d\d")) versions.sort(key=lambda v: StrictVersion(v)) for ver in versions: - self.targets[ver] = "http://windows.php.net/downloads/releases/php-%s-Win32-VC14-%s.zip" % (ver, compiler.architecture()) + self.targets[ver] = "http://windows.php.net/downloads/releases/php-%s-Win32-VC14-%s.zip" % (ver, craftCompiler.architecture) self.targetDigestUrls[ver] = ("http://windows.php.net/downloads/releases/sha1sum.txt", CraftHash.HashAlgorithm.SHA1) self.targetInstallPath[ver] = os.path.join("dev-utils", "php") self.defaultTarget = ver diff --git a/portage/binary/python-libs/python-libs.py b/portage/binary/python-libs/python-libs.py --- a/portage/binary/python-libs/python-libs.py +++ b/portage/binary/python-libs/python-libs.py @@ -4,7 +4,7 @@ class subinfo(info.infoclass): def setTargets( self ): arch = "win32" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "amd64" self.targets["default"] = "" diff --git a/portage/binary/python/python.py b/portage/binary/python/python.py --- a/portage/binary/python/python.py +++ b/portage/binary/python/python.py @@ -4,7 +4,7 @@ class subinfo(info.infoclass): def setTargets( self ): arch = "win32" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "amd64" for ver in ["3.5.1", "3.6.0"]: diff --git a/portage/binary/virtuoso/virtuoso.py b/portage/binary/virtuoso/virtuoso.py --- a/portage/binary/virtuoso/virtuoso.py +++ b/portage/binary/virtuoso/virtuoso.py @@ -6,7 +6,7 @@ class subinfo(info.infoclass): def setTargets( self ): - if compiler.isX64(): + if craftCompiler.isX64(): self.targets[ '20100330' ] = 'http://downloads.sourceforge.net/project/virtuoso/virtuoso/6.1.1/vos6-win64-20100330.zip' self.targets['6.1.6'] = \ "http://downloads.sourceforge.net/project/virtuoso/virtuoso/6.1.6/virtuoso-opensource-win64-20120802.zip" diff --git a/portage/binary/vlc/vlc.py b/portage/binary/vlc/vlc.py --- a/portage/binary/vlc/vlc.py +++ b/portage/binary/vlc/vlc.py @@ -4,14 +4,14 @@ from Package.BinaryPackageBase import * import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): vlc_ver = None def setTargets( self ): vlcArch = "32" - if compiler.isX64(): + if craftCompiler.isX64(): vlcArch = "64" vlcBaseUrl = "http://nightlies.videolan.org/build/win"+vlcArch+"/last/" vlcTagName = "3.0.0" @@ -48,7 +48,7 @@ def install( self ): utils.copyDir( self.sourceDir() , os.path.join( self.installDir(), "bin" ) ) - if compiler.isMinGW(): + if craftCompiler.isMinGW(): utils.deleteFile(os.path.join( self.installDir(), "bin", "libgcc_s_seh-1.dll" ) ) shutil.move( os.path.join( self.installDir() , "bin" , "sdk" , "include") , os.path.join( self.installDir(), "include" ) ) shutil.move( os.path.join( self.installDir() , "bin" , "sdk" , "lib") , os.path.join( self.installDir(), "lib" ) ) diff --git a/portage/binary/xerces-c-bin/xerces-c-bin.py b/portage/binary/xerces-c-bin/xerces-c-bin.py --- a/portage/binary/xerces-c-bin/xerces-c-bin.py +++ b/portage/binary/xerces-c-bin/xerces-c-bin.py @@ -35,13 +35,13 @@ from Package.VirtualPackageBase import * -if compiler.isMSVC(): +if craftCompiler.isMSVC(): class Package(PackageBin): def __init__( self ): PackageBin.__init__( self ) else: class Package(VirtualPackageBase): def __init__( self ): VirtualPackageBase.__init__( self ) - + diff --git a/portage/dev-util/7zip/7zip.py b/portage/dev-util/7zip/7zip.py --- a/portage/dev-util/7zip/7zip.py +++ b/portage/dev-util/7zip/7zip.py @@ -26,7 +26,7 @@ def install( self ): utils.utilsCache.clear() - if compiler.isX64(): + if craftCompiler.isX64(): return utils.copyFile(os.path.join(self.sourceDir(), "x64", "7za.exe"), os.path.join(self.installDir(), "7za.exe"), linkOnly=False) else: return utils.copyFile(os.path.join(self.sourceDir(), "7za.exe"), os.path.join(self.installDir(), "7za.exe"), linkOnly=False) diff --git a/portage/dev-util/ccache/ccache.py b/portage/dev-util/ccache/ccache.py --- a/portage/dev-util/ccache/ccache.py +++ b/portage/dev-util/ccache/ccache.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setTargets( self ): @@ -11,7 +11,7 @@ def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' @@ -24,7 +24,7 @@ self.subinfo.options.configure.args = "--with-bundled-zlib " self.supportsCCACHE = False -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/dev-util/clazy/clazy.py b/portage/dev-util/clazy/clazy.py --- a/portage/dev-util/clazy/clazy.py +++ b/portage/dev-util/clazy/clazy.py @@ -19,7 +19,7 @@ def __init__( self, **args ): CMakePackageBase.__init__(self) self.supportsClang = False - if compiler.isMSVC(): + if craftCompiler.isMSVC(): clangLib = os.path.join(portage.getPackageInstance('win32libs', 'llvm').buildDir(), "lib", "clang.lib") self.subinfo.options.configure.args = f"-DCLANG_LIBRARY_IMPORT='{clangLib}'" diff --git a/portage/dev-util/depends/depends.py b/portage/dev-util/depends/depends.py --- a/portage/dev-util/depends/depends.py +++ b/portage/dev-util/depends/depends.py @@ -4,7 +4,7 @@ class subinfo( info.infoclass ): def setTargets( self ): arch = "x86" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "x64" self.targets['2.2'] = 'http://www.dependencywalker.com/depends22_'+arch+'.zip' self.targetInstallPath['2.2'] = "dev-utils/bin" @@ -14,4 +14,4 @@ class Package(BinaryPackageBase): def __init__( self): - BinaryPackageBase.__init__(self) \ No newline at end of file + BinaryPackageBase.__init__(self) diff --git a/portage/dev-util/git/git.py b/portage/dev-util/git/git.py --- a/portage/dev-util/git/git.py +++ b/portage/dev-util/git/git.py @@ -13,7 +13,7 @@ def setTargets( self ): ver = "2.11.0" arch = 32 - if compiler.isX64(): + if craftCompiler.isX64(): arch = 64 self.targets[ver] ="https://github.com/git-for-windows/git/releases/download/v%s.windows.1/PortableGit-%s-%s-bit.7z.exe" % (ver, ver, arch) diff --git a/portage/dev-util/mingw-w64-crt/mingw-w64-crt.py b/portage/dev-util/mingw-w64-crt/mingw-w64-crt.py --- a/portage/dev-util/mingw-w64-crt/mingw-w64-crt.py +++ b/portage/dev-util/mingw-w64-crt/mingw-w64-crt.py @@ -5,7 +5,7 @@ def setTargets( self ): self.svnTargets['master'] = 'git://git.code.sf.net/p/mingw-w64/mingw-w64' - if compiler.isX64(): + if craftCompiler.isX64(): self.targetInstallPath["master"] = "mingw64/x86_64-w64-mingw32" else: self.targetInstallPath["master"] = "mingw/i686-w64-mingw32" @@ -24,7 +24,7 @@ def __init__( self ): AutoToolsPackageBase.__init__( self ) self.supportsCCACHE = False - if compiler.isX64(): + if craftCompiler.isX64(): disable = "--disable-lib32 --enable-lib64" else: disable = "--disable-lib64 --enable-lib32" diff --git a/portage/dev-util/mingw-w64-headers/mingw-w64-headers.py b/portage/dev-util/mingw-w64-headers/mingw-w64-headers.py --- a/portage/dev-util/mingw-w64-headers/mingw-w64-headers.py +++ b/portage/dev-util/mingw-w64-headers/mingw-w64-headers.py @@ -5,7 +5,7 @@ def setTargets( self ): self.svnTargets['master'] = 'git://git.code.sf.net/p/mingw-w64/mingw-w64' - if compiler.isX64(): + if craftCompiler.isX64(): self.targetInstallPath["master"] = "mingw64/x86_64-w64-mingw32" else: self.targetInstallPath["master"] = "mingw/i686-w64-mingw32" diff --git a/portage/dev-util/mingw-w64/mingw-w64.py b/portage/dev-util/mingw-w64/mingw-w64.py --- a/portage/dev-util/mingw-w64/mingw-w64.py +++ b/portage/dev-util/mingw-w64/mingw-w64.py @@ -8,8 +8,8 @@ class subinfo(info.infoclass): def setTargets( self ): for ver, rev, rt in [("5.3.0", "0", "4"), ("5.4.0", "0", "5"), ("6.2.0", "0", "5"), ("7.1.0", "0", "5")]: - arch = "i686" if compiler.isX86() else "x86_64" - exceptionType = "sjlj" if compiler.isX86() else "seh" + arch = "i686" if craftCompiler.isX86() else "x86_64" + exceptionType = "sjlj" if craftCompiler.isX86() else "seh" self.targets[f"{ver}-{rev}"] = f"http://downloads.sourceforge.net/sourceforge/mingw-w64/{arch}-{ver}-release-posix-{exceptionType}-rt_v{rt}-rev{rev}.7z" self.defaultTarget = "7.1.0-0" @@ -26,7 +26,7 @@ def install(self): if not BinaryPackageBase.install(self): return False - if compiler.isX86(): + if craftCompiler.isX86(): return utils.moveDir( os.path.join( self.installDir() , "mingw32" ) , os.path.join( self.installDir(), "mingw" ) ) return True @@ -36,4 +36,4 @@ class Package( Qt5CoreSdkPackageBase ): def __init__(self): - Qt5CoreSdkPackageBase.__init__(self, condition=compiler.isMinGW(), classA=PackageMinGW) + Qt5CoreSdkPackageBase.__init__(self, condition=craftCompiler.isMinGW(), classA=PackageMinGW) diff --git a/portage/dev-util/msys/msys.py b/portage/dev-util/msys/msys.py --- a/portage/dev-util/msys/msys.py +++ b/portage/dev-util/msys/msys.py @@ -8,7 +8,7 @@ def setTargets( self ): ver = "20161025" arch = "i686" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "x86_64" # don't set an actual version instead of base. Msys must be manually updated so doing a craft update of msys wil break things. self.targets[ "base" ] = f"http://repo.msys2.org/distrib/{arch}/msys2-base-{arch}-{ver}.tar.xz" @@ -33,7 +33,7 @@ self.shell = shells.MSysShell() def install( self ): - if compiler.isX64(): + if craftCompiler.isX64(): utils.copyDir(os.path.join( self.sourceDir(), "msys64"), os.path.join( self.installDir(), "msys")) else: utils.copyDir(os.path.join( self.sourceDir(), "msys32"), os.path.join( self.installDir(), "msys")) diff --git a/portage/dev-util/nasm/nasm.py b/portage/dev-util/nasm/nasm.py --- a/portage/dev-util/nasm/nasm.py +++ b/portage/dev-util/nasm/nasm.py @@ -1,5 +1,5 @@ import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setTargets( self ): diff --git a/portage/dev-util/ninja/ninja.py b/portage/dev-util/ninja/ninja.py --- a/portage/dev-util/ninja/ninja.py +++ b/portage/dev-util/ninja/ninja.py @@ -18,7 +18,7 @@ self.targetDigests['1.7.2'] = (['2edda0a5421ace3cf428309211270772dd35a91af60c96f93f90df6bc41b16d9'], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = "1.7.2" - if compiler.isMSVC2017(): + if craftCompiler.isMSVC2017(): self.defaultTarget = "master" def setDependencies( self ): @@ -31,15 +31,15 @@ def configure(self): return True - + def make(self): self.enterSourceDir() command = "python3 configure.py --bootstrap" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): command += " --platform=mingw" print(command) return self.system( command, "make" ) - + def install(self): utils.copyFile(os.path.join(self.sourceDir(),"ninja.exe"),os.path.join(self.installDir(),"bin","ninja.exe")) return True diff --git a/portage/dev-util/perl/perl.py b/portage/dev-util/perl/perl.py --- a/portage/dev-util/perl/perl.py +++ b/portage/dev-util/perl/perl.py @@ -8,7 +8,7 @@ ver = "5.24.1.2402" build = "401627" arch = "x86-64int" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "x64" self.targets[ver] = "http://downloads.activestate.com/ActivePerl/releases/{ver}/ActivePerl-{ver}-MSWin32-{arch}-{build}.exe".format( ver=ver, arch=arch, build=build) @@ -45,4 +45,4 @@ class Package(VirtualIfSufficientVersion): def __init__(self): - VirtualIfSufficientVersion.__init__(self, app="perl", version="5.20.0", classA=PerlPackage) \ No newline at end of file + VirtualIfSufficientVersion.__init__(self, app="perl", version="5.20.0", classA=PerlPackage) diff --git a/portage/dev-util/python2/python2.py b/portage/dev-util/python2/python2.py --- a/portage/dev-util/python2/python2.py +++ b/portage/dev-util/python2/python2.py @@ -1,7 +1,7 @@ import os import info -import compiler +from compiler import craftCompiler from Package.BinaryPackageBase import * diff --git a/portage/dev-util/python3/python3.py b/portage/dev-util/python3/python3.py --- a/portage/dev-util/python3/python3.py +++ b/portage/dev-util/python3/python3.py @@ -1,7 +1,7 @@ import os import info -import compiler +from compiler import craftCompiler from Package.BinaryPackageBase import * diff --git a/portage/dev-util/yasm/yasm.py b/portage/dev-util/yasm/yasm.py --- a/portage/dev-util/yasm/yasm.py +++ b/portage/dev-util/yasm/yasm.py @@ -1,17 +1,17 @@ import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setTargets( self ): - if compiler.isX64(): - if compiler.isMinGW(): + if craftCompiler.isX64(): + if craftCompiler.isMinGW(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win64.exe" - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win64.zip" else: - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win32.exe" - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win32.zip" self.targetInstallPath["1.2.0"] = os.path.join("dev-utils", "bin") self.shortDescription = "The Yasm Modular Assembler Project" @@ -29,9 +29,9 @@ def install(self): if not BinaryPackageBase.install(self): return False - if compiler.isMinGW_W32(): + if craftCompiler.isMinGW_W32(): shutil.move(os.path.join(self.imageDir(),"yasm-1.2.0-win32.exe"),os.path.join(self.imageDir(),"yasm.exe")) - if compiler.isMinGW_W64(): + if craftCompiler.isMinGW_W64(): shutil.move(os.path.join(self.imageDir(),"yasm-1.2.0-win64.exe"),os.path.join(self.imageDir(),"yasm.exe")) return True diff --git a/portage/extragear/rkward/rkward.py b/portage/extragear/rkward/rkward.py --- a/portage/extragear/rkward/rkward.py +++ b/portage/extragear/rkward/rkward.py @@ -52,12 +52,12 @@ ] if OsUtils.isWin(): - if compiler.isX64(): + if craftCompiler.isX64(): self.r_dir = os.path.join( self.mergeDestinationDir(), "lib", "R", "bin", "x64" ) else: self.r_dir = os.path.join( self.mergeDestinationDir(), "lib", "R", "bin", "i386" ) self.subinfo.options.configure.args = " -DR_EXECUTABLE=" + os.path.join (self.r_dir, "R.exe").replace( "\\\\", "/" ) - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.realconfigure = self.configure self.configure = self.msvcconfigure # NOTE: On Mac, we'll let RKWard try to auto-detect R (installed with officlal installer, or MacPorts, or something else) @@ -73,7 +73,7 @@ if OsUtils.isWin(): # Make installation movable, by providing rkward.ini with relative path to R rkward_ini = open( os.path.join( self.imageDir(), "bin", "rkward.ini" ), "w" ) - if compiler.isX64(): + if craftCompiler.isX64(): rkward_ini.write( "R executable=../lib/R/bin/x64/R.exe\n" ) else: rkward_ini.write( "R executable=../lib/R/bin/i386/R.exe\n" ) diff --git a/portage/frameworks/tier1/karchive/karchive.py b/portage/frameworks/tier1/karchive/karchive.py --- a/portage/frameworks/tier1/karchive/karchive.py +++ b/portage/frameworks/tier1/karchive/karchive.py @@ -6,16 +6,16 @@ self.versionInfo.setDefaultValues( ) self.shortDescription = "Qt 5 addon providing access to numerous types of archives" - + def setDependencies( self ): self.buildDependencies["virtual/base"] = "default" self.buildDependencies["frameworks/extra-cmake-modules"] = "default" self.runtimeDependencies["libs/qtbase"] = "default" self.runtimeDependencies["libs/qttools"] = "default" self.runtimeDependencies["win32libs/libbzip2"] = "default" self.runtimeDependencies["win32libs/zlib"] = "default" - if not compiler.isMSVC2010() and not compiler.isMSVC2012(): + if not craftCompiler.isMSVC2010() and not craftCompiler.isMSVC2012(): self.runtimeDependencies["win32libs/liblzma"] = "default" for ver in ('5.0.0', '5.1.0', '5.2.0'): @@ -28,5 +28,5 @@ CMakePackageBase.__init__( self ) - + diff --git a/portage/gnuwin32/patch/patch.py b/portage/gnuwin32/patch/patch.py --- a/portage/gnuwin32/patch/patch.py +++ b/portage/gnuwin32/patch/patch.py @@ -2,7 +2,7 @@ import info import utils -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -13,7 +13,7 @@ self.defaultTarget = '2.5.9' def setDependencies( self ): - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.runtimeDependencies['dev-util/uactools'] = 'default' self.runtimeDependencies['virtual/bin-base'] = 'default' @@ -29,4 +29,4 @@ manifest = os.path.join( self.packageDir(), "patch.exe.manifest" ) patch = os.path.join( self.installDir(), "bin", "patch.exe" ) return utils.embedManifest(patch, manifest) - + diff --git a/portage/gnuwin32/wget/wget.py b/portage/gnuwin32/wget/wget.py --- a/portage/gnuwin32/wget/wget.py +++ b/portage/gnuwin32/wget/wget.py @@ -18,9 +18,9 @@ def __init__( self): BinaryPackageBase.__init__(self) def install( self ): - if compiler.isX64(): + if craftCompiler.isX64(): utils.copyFile(os.path.join(self.sourceDir(), "wget64.exe"), os.path.join(self.installDir(), "bin", "wget.exe")) else: utils.copyFile(os.path.join(self.sourceDir(), "wget.exe"), os.path.join(self.installDir(), "bin", "wget.exe")) utils.copyFile(os.path.join(self.sourceDir(), "curl-ca-bundle.crt"), os.path.join(self.installDir(), "bin", "curl-ca-bundle.crt")) - return True \ No newline at end of file + return True diff --git a/portage/internal/CMakeBuildSystem/CMakeBuildSystem.py b/portage/internal/CMakeBuildSystem/CMakeBuildSystem.py --- a/portage/internal/CMakeBuildSystem/CMakeBuildSystem.py +++ b/portage/internal/CMakeBuildSystem/CMakeBuildSystem.py @@ -1,12 +1,12 @@ import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setDependencies( self ): self.buildDependencies['dev-util/cmake'] = 'default' self.buildDependencies['dev-util/jom'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/mingw-w64'] = 'default' from Package.InternalPackageBase import * diff --git a/portage/internal/QMakeBuildSystem/QMakeBuildSystem.py b/portage/internal/QMakeBuildSystem/QMakeBuildSystem.py --- a/portage/internal/QMakeBuildSystem/QMakeBuildSystem.py +++ b/portage/internal/QMakeBuildSystem/QMakeBuildSystem.py @@ -2,7 +2,7 @@ from CraftDebug import craftDebug import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -12,7 +12,7 @@ #self.runtimeDependencies['libs/qt'] = 'default' self.buildDependencies['dev-util/jom'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/mingw-w64'] = 'default' from Package.InternalPackageBase import * diff --git a/portage/kdesupport/kdewin/kdewin.py b/portage/kdesupport/kdewin/kdewin.py --- a/portage/kdesupport/kdewin/kdewin.py +++ b/portage/kdesupport/kdewin/kdewin.py @@ -1,6 +1,6 @@ import info import utils -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setDependencies( self ): @@ -32,9 +32,9 @@ # self.subinfo.options.package.version = '0.5.4' self.subinfo.options.configure.args = '-DBUILD_BASE_LIB_WITH_QT=ON -DBUILD_QT_LIB=ON -DBUILD_PNG2ICO=OFF ' self.subinfo.options.configure.args += ' -DBUILD_TOOLS=ON ' - if compiler.isMinGW_W32(): + if craftCompiler.isMinGW_W32(): self.subinfo.options.configure.args += ' -DMINGW_W32=ON ' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.subinfo.options.configure.args += ' -DKDEWIN_DEFINITIONS="-DKDEWIN_NO_LOCALTIME_R -DKDEWIN_NO_GMTIME_R" ' diff --git a/portage/kdesupport/qwt6/qwt6.py b/portage/kdesupport/qwt6/qwt6.py --- a/portage/kdesupport/qwt6/qwt6.py +++ b/portage/kdesupport/qwt6/qwt6.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -import compiler +from compiler import craftCompiler import info class subinfo(info.infoclass): - def setTargets( self ): + def setTargets( self ): self.shortDescription = "The Qwt library contains GUI Components and utility classes which are primarily useful for programs with a technical background" for ver in ["6.0.1","6.0.2"]: self.targets[ver] = "http://downloads.sourceforge.net/sourceforge/qwt/qwt-%s.tar.bz2" % ver @@ -24,9 +24,9 @@ def __init__( self, **args ): QMakePackageBase.__init__( self ) self.subinfo.options.configure.args = ' "QWT_INSTALL_PREFIX = %s" ' % self.imageDir().replace("\\","/") - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.subinfo.options.make.supportsMultijob = False - + def install( self ): if not QMakePackageBase.install( self ): return False @@ -37,6 +37,6 @@ if file.endswith( ".dll" ): utils.copyFile( os.path.join( self.installDir(), "lib" , file ), os.path.join( self.installDir(), "bin" , file ) ) return True - - + + diff --git a/portage/libs/qt5/qtbase/qtbase.py b/portage/libs/qt5/qtbase/qtbase.py --- a/portage/libs/qt5/qtbase/qtbase.py +++ b/portage/libs/qt5/qtbase/qtbase.py @@ -5,7 +5,7 @@ import utils import info import portage -import compiler +from compiler import craftCompiler from CraftOS.osutils import OsUtils from Package.Qt5CorePackageBase import * @@ -80,7 +80,7 @@ return Qt5CorePackageBase.compile(self) def configure( self, unused1=None, unused2=""): - if compiler.isMinGW() and "DXSDK_DIR" not in os.environ: + if craftCompiler.isMinGW() and "DXSDK_DIR" not in os.environ: craftDebug.log.critical("Failed to detec a DirectX SDK") craftDebug.log.critical("Please visite https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows#Direct_X_SDK for instructions") return False @@ -131,16 +131,16 @@ command += " -icu " if self.subinfo.options.isActive("win32libs/zlib"): command += " -system-zlib " - if compiler.isMSVC(): + if craftCompiler.isMSVC(): command += " ZLIB_LIBS=zlib.lib " else: command += " -static -static-runtime " command += "-nomake examples " command += "-nomake tests " - if (compiler.isMSVC() and compiler.isClang()) or OsUtils.isUnix() or self.supportsCCACHE: + if (craftCompiler.isMSVC() and craftCompiler.isClang()) or OsUtils.isUnix() or self.supportsCCACHE: command += "-no-pch " return utils.system( command ) @@ -152,7 +152,7 @@ utils.copyFile( os.path.join( self.buildDir(), "bin", "qt.conf"), os.path.join( self.imageDir(), "bin", "qt.conf" ) ) # install msvc debug files if available - if compiler.isMSVC(): + if craftCompiler.isMSVC(): srcdir = os.path.join( self.buildDir(), "lib" ) destdir = os.path.join( self.installDir(), "lib" ) @@ -177,7 +177,7 @@ def makeProgram(self): if CraftVersion(self.subinfo.buildTarget) >= CraftVersion("5.9"): # workaround for broken qmake make file.... building with mingw and jom is broken - if self.subinfo.options.make.supportsMultijob and compiler.isMinGW(): + if self.subinfo.options.make.supportsMultijob and craftCompiler.isMinGW(): return f"mingw32-make -j{os.environ['NUMBER_OF_PROCESSORS']}" return super(Qt5CorePackageBase, self).makeProgram diff --git a/portage/libs/qt5/qtwebkit/qtwebkit.py b/portage/libs/qt5/qtwebkit/qtwebkit.py --- a/portage/libs/qt5/qtwebkit/qtwebkit.py +++ b/portage/libs/qt5/qtwebkit/qtwebkit.py @@ -45,7 +45,7 @@ self.subinfo.options.configure.args = "" if OsUtils.isWin(): self.subinfo.options.configure.args += """ "QT_CONFIG+=no-pkg-config" """ - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.subinfo.options.configure.args += """ "QMAKE_CXXFLAGS += -g0 -O3" """ def configure( self, configureDefines="" ): diff --git a/portage/libs/runtime/runtime.py b/portage/libs/runtime/runtime.py --- a/portage/libs/runtime/runtime.py +++ b/portage/libs/runtime/runtime.py @@ -11,17 +11,17 @@ def setDependencies( self ): self.buildDependencies[ 'virtual/base' ] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies[ "dev-util/mingw-w64" ] = "default" from Package.BinaryPackageBase import * -import compiler +from compiler import craftCompiler class PackageMinGW( BinaryPackageBase ): def __init__( self ): BinaryPackageBase.__init__( self ) - self.subinfo.options.package.version = compiler.getVersion() + self.subinfo.options.package.version = craftCompiler.getVersion() def fetch(self): return True @@ -35,10 +35,10 @@ return True files = [ 'libgomp-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll' ] - if compiler.isMinGW_W32(): + if craftCompiler.isMinGW_W32(): files.append('libgcc_s_sjlj-1.dll') srcdir = os.path.join( self.rootdir, "mingw", "bin" ) - elif compiler.isMinGW_W64(): + elif craftCompiler.isMinGW_W64(): files.append('libgcc_s_seh-1.dll') srcdir = os.path.join( self.rootdir, "mingw64", "bin" ) @@ -50,4 +50,4 @@ class Package( Qt5CoreSdkPackageBase ): def __init__(self): - Qt5CoreSdkPackageBase.__init__(self, condition=compiler.isMinGW(), classA=PackageMinGW) + Qt5CoreSdkPackageBase.__init__(self, condition=craftCompiler.isMinGW(), classA=PackageMinGW) diff --git a/portage/qt-libs/phonon-vlc/phonon-vlc.py b/portage/qt-libs/phonon-vlc/phonon-vlc.py --- a/portage/qt-libs/phonon-vlc/phonon-vlc.py +++ b/portage/qt-libs/phonon-vlc/phonon-vlc.py @@ -2,26 +2,26 @@ import os import info -import compiler +from compiler import craftCompiler from Package.CMakePackageBase import * class subinfo(info.infoclass): def setDependencies( self ): self.runtimeDependencies['qt-libs/phonon'] = 'default' self.runtimeDependencies['binary/vlc'] = 'default' - if compiler.isMSVC() or compiler.isIntel(): + if craftCompiler.isMSVC() or craftCompiler.isIntel(): self.runtimeDependencies['kdesupport/kdewin'] = 'default' def setTargets( self ): for ver in ['0.9.0']: self.targets[ ver ] = "http://download.kde.org/stable/phonon/phonon-backend-vlc/%s/phonon-backend-vlc-%s.tar.xz" % ( ver ,ver ) self.targetInstSrc[ ver ] = "phonon-vlc-%s" % ver - + self.targetDigests['0.9.0'] = (['c0ced7ca571acc22211eecf5158241714fa9ccdb82d4fe0a970ad702860ccdbe'], CraftHash.HashAlgorithm.SHA256) self.svnTargets['master'] = '[git]kde:phonon-vlc' - + self.shortDescription = "the vlc based phonon multimedia backend" self.defaultTarget = '0.9.0' diff --git a/portage/virtual/base/base.py b/portage/virtual/base/base.py --- a/portage/virtual/base/base.py +++ b/portage/virtual/base/base.py @@ -1,7 +1,7 @@ import os import info -import compiler +from compiler import craftCompiler from Package.VirtualPackageBase import * @@ -19,7 +19,7 @@ self.buildDependencies['dev-util/git'] = 'default' self.buildDependencies['dev-util/putty'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/mingw-w64'] = 'default' if craftSettings.get("Compile","MakeProgram" ,"" ) == "jom": self.buildDependencies['dev-util/jom'] = 'default' diff --git a/portage/win32libs/boost/boost-bjam/boost-bjam.py b/portage/win32libs/boost/boost-bjam/boost-bjam.py --- a/portage/win32libs/boost/boost-bjam/boost-bjam.py +++ b/portage/win32libs/boost/boost-bjam/boost-bjam.py @@ -23,7 +23,7 @@ BoostPackageBase.__init__(self) def install(self): - if OsUtils.isUnix(): + if OsUtils.isUnix(): return utils.copyFile( os.path.join(portage.getPackageInstance('win32libs', 'boost-headers').sourceDir(),"tools","build", "bjam" ), os.path.join( self.imageDir(), "bin", "bjam" ) ) else: @@ -34,18 +34,18 @@ def make(self): if OsUtils.isUnix(): cmd = "./bootstrap.sh --with-toolset=" - if compiler.isClang(): + if craftCompiler.isClang(): cmd += "clang" - elif compiler.isGCC(): + elif craftCompiler.isGCC(): cmd += "gcc" else: cmd = "bootstrap.bat " - if compiler.isClang(): + if craftCompiler.isClang(): cmd += "clang" - elif compiler.isMinGW(): + elif craftCompiler.isMinGW(): cmd += "mingw" - elif compiler.isMSVC(): - platform = str(compiler.msvcPlatformToolset()) + elif craftCompiler.isMSVC(): + platform = str(craftCompiler.msvcPlatformToolset()) cmd += f"vc{platform[:2]}" utils.system(cmd, cwd = os.path.join(portage.getPackageInstance('win32libs', 'boost-headers').sourceDir(),"tools","build")) or craftDebug.log.critical( diff --git a/portage/win32libs/dbus/dbus.py b/portage/win32libs/dbus/dbus.py --- a/portage/win32libs/dbus/dbus.py +++ b/portage/win32libs/dbus/dbus.py @@ -16,7 +16,7 @@ self.patchToApply['1.8.4'] = [('dont_include_afxres.diff', 1)] self.patchToApply['1.10.4'] = [('dont_include_afxres.diff', 1)] self.patchToApply['1.11.4'] = [('dbus-1.11.4-20160903.diff', 1)] - + self.targetDigests['1.10.4'] = 'ec1921a09199c81ea20b20448237146a414d51ae' self.targetDigests['1.11.4'] = (['474de2afde8087adbd26b3fc5cbf6ec45559763c75b21981169a9a1fbac256c9'], CraftHash.HashAlgorithm.SHA256) @@ -57,12 +57,12 @@ # TODO: fix if self.buildType() == "Debug": imagedir = os.path.join( self.installDir(), "lib" ) - if compiler.isMSVC(): + if craftCompiler.isMSVC(): if os.path.exists(os.path.join(imagedir, "dbus-1d.lib")): utils.copyFile(os.path.join(imagedir, "dbus-1d.lib"), os.path.join(imagedir, "dbus-1.lib")) if not os.path.exists(os.path.join(imagedir, "dbus-1d.lib")): utils.copyFile(os.path.join(imagedir, "dbus-1.lib"), os.path.join(imagedir, "dbus-1d.lib")) - if compiler.isMinGW(): + if craftCompiler.isMinGW(): if os.path.exists(os.path.join(imagedir, "libdbus-1.dll.a")): utils.copyFile( os.path.join(imagedir, "libdbus-1.dll.a"), os.path.join(imagedir, "libdbus-1d.dll.a") ) diff --git a/portage/win32libs/eigen3/eigen3.py b/portage/win32libs/eigen3/eigen3.py --- a/portage/win32libs/eigen3/eigen3.py +++ b/portage/win32libs/eigen3/eigen3.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import info -import compiler +from compiler import craftCompiler from Package.CMakePackageBase import * class subinfo(info.infoclass): @@ -21,5 +21,5 @@ class Package(CMakePackageBase): def __init__( self, **args ): CMakePackageBase.__init__( self ) - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.subinfo.options.configure.args = "-DBUILD_TESTS=OFF" diff --git a/portage/win32libs/ghostscript/ghostscript.py b/portage/win32libs/ghostscript/ghostscript.py --- a/portage/win32libs/ghostscript/ghostscript.py +++ b/portage/win32libs/ghostscript/ghostscript.py @@ -1,13 +1,13 @@ import info -import compiler +from compiler import craftCompiler import os import utils class subinfo(info.infoclass): def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' self.runtimeDependencies['win32libs/zlib'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' self.runtimeDependencies['win32libs/lcms'] = 'default' self.runtimeDependencies['win32libs/lcms2'] = 'default' @@ -23,7 +23,7 @@ self.targetInstSrc[ver] = 'ghostscript-%s' % ver self.targetDigestUrls[ver] = (["https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/SHA1SUMS" % ver.replace(".","")], CraftHash.HashAlgorithm.SHA1) - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.patchToApply['9.19'] = [ #("mingw-build.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript #("ghostscript-sys-zlib.patch", 1),# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript @@ -45,10 +45,10 @@ self.enterSourceDir() _win64 = "" _rcomp = "" - if compiler.isX64(): _win64 = " WIN64=" + if craftCompiler.isX64(): _win64 = " WIN64=" # because ghostscript doesn't know about msvc2015, it guesses wrong on this. But, # because of where we are, rc /should/ be in the path, so we'll just use that. - if compiler.isMSVC(): _rcomp = " RCOMP=rc.exe" + if craftCompiler.isMSVC(): _rcomp = " RCOMP=rc.exe" self.system( "nmake -f psi\\msvc.mak" + _rcomp + _win64 ) return True @@ -67,7 +67,7 @@ if not os.path.isdir(os.path.join(dst, "include", "ghostscript")): os.mkdir(os.path.join(dst, "include", "ghostscript")) - if compiler.isX64(): + if craftCompiler.isX64(): _bit = "64" else: _bit = "32" @@ -118,7 +118,7 @@ return True -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: - class Package(PackageMSVC): pass \ No newline at end of file + class Package(PackageMSVC): pass diff --git a/portage/win32libs/glib/glib.py b/portage/win32libs/glib/glib.py --- a/portage/win32libs/glib/glib.py +++ b/portage/win32libs/glib/glib.py @@ -23,7 +23,7 @@ self.runtimeDependencies["win32libs/pcre"] = "default" self.runtimeDependencies["win32libs/zlib"] = "default" self.runtimeDependencies["win32libs/gettext"] = "default" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" class PackageCMake(MSBuildPackageBase): @@ -53,7 +53,7 @@ def install(self): self.cleanImage() arch = "x86" - if compiler.isX64(): + if craftCompiler.isX64(): arch = "x64" utils.mergeTree( os.path.join(self.sourceDir(), "..", self.toolset, arch, "lib", "glib-2.0", "include"), @@ -76,7 +76,7 @@ os.path.join(self.imageDir(), "include", "glib-2.0", "glibconfig.h"), False) return True -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: class Package(PackageCMake): pass diff --git a/portage/win32libs/gnutls/gnutls.py b/portage/win32libs/gnutls/gnutls.py --- a/portage/win32libs/gnutls/gnutls.py +++ b/portage/win32libs/gnutls/gnutls.py @@ -18,7 +18,7 @@ def setDependencies( self ): self.runtimeDependencies["win32libs/gcrypt"] = "default" self.runtimeDependencies["win32libs/nettle"] = "default" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" class PackageMinGW(AutoToolsPackageBase): @@ -28,7 +28,7 @@ self.subinfo.options.configure.cflags = "-I%s/usr/include " % utils.toMSysPath( self.shell.msysdir ) #could cause problems but we need the autotools headers self.subinfo.options.configure.ldflags = "-L%s/usr/lib " % utils.toMSysPath( self.shell.msysdir ) #could cause problems but we need the autotools libopt -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/win32libs/icu/icu.py b/portage/win32libs/icu/icu.py --- a/portage/win32libs/icu/icu.py +++ b/portage/win32libs/icu/icu.py @@ -3,7 +3,7 @@ import utils import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -15,18 +15,18 @@ self.targets[ver] = f"http://download.icu-project.org/files/icu4c/{ver}/icu4c-{ver2}-src.tgz" self.targetDigestUrls[ver] = ([f"https://ssl.icu-project.org/files/icu4c/{ver}/icu4c-src-{ver2}.md5"], CraftHash.HashAlgorithm.MD5) self.targetInstSrc[ver] = os.path.join("icu", "source") - if compiler.isMSVC2015() or compiler.isMinGW(): + if craftCompiler.isMSVC2015() or craftCompiler.isMinGW(): self.patchToApply["55.1"] = ("icu-20150414.diff", 2) - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.patchToApply["55.1"] = [("icu-20150414.diff", 2),("icu-msys.diff", 2)] self.patchToApply["58.2"] = ("0020-workaround-missing-locale.patch", 2)#https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-icu/0020-workaround-missing-locale.patch self.defaultTarget = "58.2" def setDependencies( self ): self.buildDependencies["virtual/base"] = "default" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" from Package.MSBuildPackageBase import * @@ -42,7 +42,7 @@ return False utils.copyDir(os.path.join(self.sourceDir(), "..", "include"), os.path.join(self.imageDir(), "include")) - if compiler.isMSVC() and self.buildType() == "Debug": + if craftCompiler.isMSVC() and self.buildType() == "Debug": imagedir = os.path.join( self.installDir(), "lib" ) filelist = os.listdir( imagedir ) for f in filelist: @@ -77,7 +77,7 @@ utils.copyFile( os.path.join( self.installDir() , "lib" ,dll) , os.path.join( self.installDir(), "bin" ,dll) ) return True -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: class Package(PackageCMake): pass diff --git a/portage/win32libs/libbfd/libbfd.py b/portage/win32libs/libbfd/libbfd.py --- a/portage/win32libs/libbfd/libbfd.py +++ b/portage/win32libs/libbfd/libbfd.py @@ -22,7 +22,7 @@ def __init__( self, **args ): AutoToolsPackageBase.__init__(self) -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/win32libs/libffi/libffi.py b/portage/win32libs/libffi/libffi.py --- a/portage/win32libs/libffi/libffi.py +++ b/portage/win32libs/libffi/libffi.py @@ -19,16 +19,16 @@ def setDependencies( self ): self.buildDependencies["virtual/base"] = "default" - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" class PackageCMake(MSBuildPackageBase): def __init__( self, **args ): MSBuildPackageBase.__init__( self ) self.arch = "x86" - if compiler.isX64(): + if craftCompiler.isX64(): self.arch = "x64" self.subinfo.options.configure.projectFile = os.path.join(self.sourceDir(), "win32", f"vc14_{self.arch}", "libffi-msvc.sln") @@ -49,7 +49,7 @@ AutoToolsPackageBase.__init__(self) self.subinfo.options.configure.args = "--enable-shared --disable-static " -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: class Package(PackageCMake): pass diff --git a/portage/win32libs/libgmp/libgmp.py b/portage/win32libs/libgmp/libgmp.py --- a/portage/win32libs/libgmp/libgmp.py +++ b/portage/win32libs/libgmp/libgmp.py @@ -2,7 +2,7 @@ import os import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -15,7 +15,7 @@ def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' @@ -30,7 +30,7 @@ self.subinfo.options.useShadowBuild = False -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/win32libs/liblame/liblame.py b/portage/win32libs/liblame/liblame.py --- a/portage/win32libs/liblame/liblame.py +++ b/portage/win32libs/liblame/liblame.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -23,6 +23,6 @@ def __init__( self, **args ): AutoToolsPackageBase.__init__(self) self.subinfo.options.package.withCompiler = False - self.subinfo.options.configure.args = "--disable-static --enable-shared " + self.subinfo.options.configure.args = "--disable-static --enable-shared " diff --git a/portage/win32libs/liblzma/liblzma.py b/portage/win32libs/liblzma/liblzma.py --- a/portage/win32libs/liblzma/liblzma.py +++ b/portage/win32libs/liblzma/liblzma.py @@ -4,7 +4,7 @@ import shutil import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): diff --git a/portage/win32libs/libofx/libofx.py b/portage/win32libs/libofx/libofx.py --- a/portage/win32libs/libofx/libofx.py +++ b/portage/win32libs/libofx/libofx.py @@ -1,14 +1,14 @@ import info -import compiler +from compiler import craftCompiler class subinfo( info.infoclass ): def setTargets( self ): self.targets['0.9.10'] = "http://downloads.sourceforge.net/project/libofx/libofx/0.9.10/libofx-0.9.10.tar.gz" self.targetDigests['0.9.10'] = '33f394c963c087217cb6c508af842d4844bc0823' self.targetInstSrc['0.9.10'] = "libofx-0.9.10" self.patchToApply['0.9.10'] = [("libofx-0.9.5-20120131.diff", 1)] - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.patchToApply['0.9.10'] += [("patch_daylight.diff", 1)] self.shortDescription = "a parser and an API for the OFX (Open Financial eXchange) specification" diff --git a/portage/win32libs/libopus/libopus.py b/portage/win32libs/libopus/libopus.py --- a/portage/win32libs/libopus/libopus.py +++ b/portage/win32libs/libopus/libopus.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): @@ -27,5 +27,5 @@ def __init__( self, **args ): AutoToolsPackageBase.__init__(self) self.subinfo.options.package.withCompiler = False - self.subinfo.options.configure.args = "--disable-static --enable-shared --disable-doc" + self.subinfo.options.configure.args = "--disable-static --enable-shared --disable-doc" diff --git a/portage/win32libs/libsparsehash/libsparsehash.py b/portage/win32libs/libsparsehash/libsparsehash.py --- a/portage/win32libs/libsparsehash/libsparsehash.py +++ b/portage/win32libs/libsparsehash/libsparsehash.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): diff --git a/portage/win32libs/llvm-meta/llvm/llvm.py b/portage/win32libs/llvm-meta/llvm/llvm.py --- a/portage/win32libs/llvm-meta/llvm/llvm.py +++ b/portage/win32libs/llvm-meta/llvm/llvm.py @@ -22,7 +22,7 @@ self.subinfo.options.configure.args = "-DLLVM_TARGETS_TO_BUILD='X86'" self.subinfo.options.configure.args += " -DLLVM_EXTERNAL_LLD_SOURCE_DIR=\"%s\"" % self.lld.sourceDir().replace("\\", "/") self.subinfo.options.configure.args += " -DLLVM_EXTERNAL_CLANG_SOURCE_DIR=\"%s\"" % self.clang.sourceDir().replace("\\", "/") - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.subinfo.options.configure.args += " -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON" else: self.subinfo.options.configure.args += " -DBUILD_SHARED_LIBS=ON" @@ -42,7 +42,7 @@ if not p.unpack(): return False return True - + def configureOptions(self, defines=""): options = CMakePackageBase.configureOptions(self, defines) # just expect that we don't want to debug our compiler @@ -52,7 +52,7 @@ def install(self): if not CMakePackageBase.install(self): return False - if compiler.isMinGW(): + if craftCompiler.isMinGW(): files = os.listdir(os.path.join(self.buildDir(), "lib")) for f in files: if f.endswith("dll.a"): @@ -68,9 +68,9 @@ # the build system is broken so.... src = os.path.join(self.imageDir(), "bin", "clang" + exeSuffix) - if compiler.isGCCLike(): + if craftCompiler.isGCCLike(): dest = os.path.join(self.imageDir(), "bin", "clang++" + exeSuffix) - elif compiler.isMSVC(): + elif craftCompiler.isMSVC(): dest = os.path.join(self.imageDir(), "bin", "clang-cl" + exeSuffix) else: craftDebug.log.error("Unknown compiler") diff --git a/portage/win32libs/mpir/mpir.py b/portage/win32libs/mpir/mpir.py --- a/portage/win32libs/mpir/mpir.py +++ b/portage/win32libs/mpir/mpir.py @@ -18,7 +18,7 @@ def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' else: self.buildDependencies['dev-util/yasm'] = 'default' @@ -30,7 +30,7 @@ def __init__( self, **args ): AutoToolsPackageBase.__init__(self) abi = "ABI=64" - if compiler.isX86(): + if craftCompiler.isX86(): abi = "ABI=32" self.platform = "" self.subinfo.options.configure.args = "--enable-shared --disable-static --enable-gmpcompat --enable-cxx " + abi @@ -53,7 +53,7 @@ utils.copyFile(os.path.join( self.installDir() , "lib" , "mpir.lib"), os.path.join( self.installDir() , "lib" , "gmp.lib") ) return True -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/win32libs/nettle/nettle.py b/portage/win32libs/nettle/nettle.py --- a/portage/win32libs/nettle/nettle.py +++ b/portage/win32libs/nettle/nettle.py @@ -17,7 +17,7 @@ self.defaultTarget = "2.7.1" def setDependencies( self ): - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' self.runtimeDependencies['win32libs/libgmp'] = 'default' self.runtimeDependencies['win32libs/openssl'] = 'default' @@ -27,7 +27,7 @@ AutoToolsPackageBase.__init__(self) self.subinfo.options.configure.args = " --enable-shared --enable-public-key --disable-documentation" -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMinGW): def __init__( self ): PackageMinGW.__init__( self ) diff --git a/portage/win32libs/opencv/opencv.py b/portage/win32libs/opencv/opencv.py --- a/portage/win32libs/opencv/opencv.py +++ b/portage/win32libs/opencv/opencv.py @@ -2,30 +2,30 @@ import info from Package.CMakePackageBase import * -import compiler +from compiler import craftCompiler class subinfo( info.infoclass ): def setTargets( self ): self.defaultTarget = '2.4.5' self.shortDescription = 'a library for real time computer vision' - + self.svnTargets['master'] = 'git://code.opencv.org/opencv.git' - + self.svnTargets['2.3'] = 'http://downloads.sourceforge.net/opencvlibrary/OpenCV-2.3.0-win-src.zip' self.targetInstSrc['2.3'] = 'OpenCV-2.3.0' - + # 2.4.5 is the first with .tar.gz, previous were .tar.bz2 for ver in [ '2.4.5' ]: self.targets[ ver ] = 'http://downloads.sourceforge.net/opencvlibrary/opencv-' + ver + '.tar.gz' self.targetInstSrc[ ver ] = 'opencv-' + ver - + self.targetDigests['2.3'] = '126787da5a3d71e80eb6e8d3bed126391e0549c9' self.targetDigests['2.4.5'] = '9e25f821db9e25aa454a31976ba6b5a3a50b6fa4' - + self.patchToApply['2.3'] = ('OpenCV-2.3.0-20110817.diff', 1) - + self.options.configure.args = "-DBUILD_NEW_PYTHON_SUPPORT=OFF" - + def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' diff --git a/portage/win32libs/openssl/openssl.py b/portage/win32libs/openssl/openssl.py --- a/portage/win32libs/openssl/openssl.py +++ b/portage/win32libs/openssl/openssl.py @@ -4,7 +4,7 @@ import utils import info -import compiler +from compiler import craftCompiler class subinfo(info.infoclass): def setTargets(self): @@ -31,10 +31,10 @@ def setDependencies(self): self.runtimeDependencies['virtual/base'] = 'default' self.buildDependencies['dev-util/perl'] = 'default' - if compiler.isMinGW(): + if craftCompiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' self.runtimeDependencies['win32libs/zlib'] = 'default' - elif compiler.isMSVC(): + elif craftCompiler.isMSVC(): self.buildDependencies['dev-util/nasm'] = 'default' @@ -49,15 +49,15 @@ def compile(self): os.chdir(self.sourceDir()) cmd = "" - if compiler.isX64(): + if craftCompiler.isX64(): config = "VC-WIN64A" else: config = "VC-WIN32" if not self.system("perl Configure %s" % config, "configure"): return False - if compiler.isX64(): + if craftCompiler.isX64(): if not self.system("ms\do_win64a.bat", "configure"): return False else: @@ -108,7 +108,7 @@ self.subinfo.options.make.supportsMultijob = False self.subinfo.options.package.packageName = 'openssl' self.subinfo.options.package.packSources = False - if compiler.architecture() == "x64": + if craftCompiler.isX64(): self.platform = "mingw64" else: self.platform = "mingw" @@ -137,7 +137,7 @@ return True -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: class Package(PackageCMake): pass diff --git a/portage/win32libs/pthreads/pthreads.py b/portage/win32libs/pthreads/pthreads.py --- a/portage/win32libs/pthreads/pthreads.py +++ b/portage/win32libs/pthreads/pthreads.py @@ -1,4 +1,4 @@ -import compiler +from compiler import craftCompiler import info class subinfo(info.infoclass): @@ -28,7 +28,7 @@ self.subinfo.options.configure.args = " -DBUILD_TESTS=OFF" -if compiler.isMSVC() or compiler.isIntel(): +if craftCompiler.isMSVC() or craftCompiler.isIntel(): class Package(PthreadsPackage): def __init__( self ): PthreadsPackage.__init__( self ) diff --git a/portage/win32libs/shared-mime-info/shared-mime-info.py b/portage/win32libs/shared-mime-info/shared-mime-info.py --- a/portage/win32libs/shared-mime-info/shared-mime-info.py +++ b/portage/win32libs/shared-mime-info/shared-mime-info.py @@ -5,7 +5,7 @@ import utils import info import info -import compiler +from compiler import craftCompiler from Package.CMakePackageBase import * # do not forget to update CMakeLists.txt! @@ -112,7 +112,7 @@ def install( self ): if not CMakePackageBase.install( self ): return False - if compiler.isMinGW(): + if craftCompiler.isMinGW(): manifest = os.path.join( self.packageDir(), "update-mime-database.exe.manifest" ) executable = os.path.join( self.installDir(), "bin", "update-mime-database.exe" ) utils.embedManifest( executable, manifest ) diff --git a/portage/win32libs/vc/vc.py b/portage/win32libs/vc/vc.py --- a/portage/win32libs/vc/vc.py +++ b/portage/win32libs/vc/vc.py @@ -23,5 +23,5 @@ self.subinfo.options.configure.args = " -DBUILD_TESTING=OFF " - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.subinfo.options.configure.args += " -DCMAKE_CXX_FLAGS=/FS " diff --git a/portage/win32libs/xerces-c/xerces-c.py b/portage/win32libs/xerces-c/xerces-c.py --- a/portage/win32libs/xerces-c/xerces-c.py +++ b/portage/win32libs/xerces-c/xerces-c.py @@ -13,7 +13,7 @@ def setDependencies( self ): self.runtimeDependencies['virtual/base'] = 'default' - if compiler.isMSVC(): + if craftCompiler.isMSVC(): self.buildDependencies['binary/xerces-c-bin'] = 'default' from Package.AutoToolsPackageBase import * @@ -24,9 +24,9 @@ AutoToolsPackageBase.__init__(self) -if compiler.isMinGW(): +if craftCompiler.isMinGW(): class Package(PackageMSys): pass else: class Package(VirtualPackageBase): pass - +