diff --git a/bin/BuildSystem/BuildSystemBase.py b/bin/BuildSystem/BuildSystemBase.py index 73cd3caae..edf9b1466 100644 --- a/bin/BuildSystem/BuildSystemBase.py +++ b/bin/BuildSystem/BuildSystemBase.py @@ -1,132 +1,132 @@ # # copyright (c) 2009 Ralf Habacker # """ \package BuildSystemBase""" from CraftDebug import craftDebug from CraftBase import * import compiler from CraftOS.osutils import OsUtils import multiprocessing class BuildSystemBase(CraftBase): """provides a generic interface for build systems and implements all stuff for all build systems""" debug = True def __init__(self, typeName=""): """constructor""" CraftBase.__init__(self) self.supportsNinja = False self.supportsCCACHE = craftSettings.getboolean("Compile","UseCCache", False ) and compiler.isMinGW() self.supportsClang = True self.buildSystemType = typeName @property - def makeProgramm(self): + def makeProgram(self): if self.subinfo.options.make.supportsMultijob: if self.supportsNinja and craftSettings.getboolean("Compile", "UseNinja", False): return "ninja" if ("Compile", "MakeProgram") in craftSettings: craftDebug.log.debug("set custom make program: %s" % craftSettings.get("Compile", "MakeProgram", "" )) return craftSettings.get("Compile", "MakeProgram", "" ) elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if OsUtils.isWin(): if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: craftDebug.log.critical("unknown %s compiler" % self.compiler()) elif OsUtils.isUnix(): return "make" def compile(self): """convencience method - runs configure() and make()""" configure = getattr(self, 'configure') make = getattr(self, 'make') return configure() and make() def configureSourceDir(self): """returns source dir used for configure step""" # pylint: disable=E1101 # this class never defines self.source, that happens only # in MultiSource. sourcedir = self.sourceDir() if self.subinfo.hasConfigurePath(): sourcedir = os.path.join(sourcedir, self.subinfo.configurePath()) return sourcedir def configureOptions(self, defines=""): """return options for configure command line""" if self.subinfo.options.configure.defines != None: defines += " %s" % self.subinfo.options.configure.defines if self.supportsCCACHE: defines += " %s" % self.ccacheOptions() if compiler.isClang() and self.supportsClang: defines += " %s" % self.clangOptions() return defines def makeOptions(self, defines=""): """return options for make command line""" if self.subinfo.options.make.ignoreErrors: defines += " -i" if self.subinfo.options.make.makeOptions: defines += " %s" % self.subinfo.options.make.makeOptions - if self.makeProgramm == "make": + if self.makeProgram == "make": defines += " -j%s" % multiprocessing.cpu_count() if craftDebug.verbose() > 0: - if self.makeProgramm == "ninja": + if self.makeProgram == "ninja": defines += " -v " else: defines += " VERBOSE=1 V=1" return defines def configure(self): return True def make(self): return True def install(self): # create post (un)install scripts if OsUtils.isWin(): scriptExt = ".cmd" elif OsUtils.isUnix(): scriptExt = ".sh" for pkgtype in ['bin', 'lib', 'doc', 'src', 'dbg']: script = os.path.join( self.packageDir(), "post-install-%s.%s" ) % (pkgtype, scriptExt) scriptName = "post-install-%s-%s.%s" % ( self.package, pkgtype, scriptExt ) # are there any cases there installDir should be honored ? destscript = os.path.join( self.imageDir(), "manifest", scriptName ) if not os.path.exists( os.path.join( self.imageDir(), "manifest" ) ): utils.createDir( os.path.join( self.imageDir(), "manifest" ) ) if os.path.exists( script ): utils.copyFile( script, destscript ) script = os.path.join( self.packageDir(), "post-uninstall-%s.%s" ) % (pkgtype, scriptExt) scriptName = "post-uninstall-%s-%s.%s" % ( self.package, pkgtype, scriptExt ) # are there any cases there installDir should be honored ? destscript = os.path.join( self.imageDir(), "manifest", scriptName ) if not os.path.exists( os.path.join( self.imageDir(), "manifest" ) ): utils.createDir( os.path.join( self.imageDir(), "manifest" ) ) if os.path.exists( script ): utils.copyFile( script, destscript ) return True def unittest( self ): """running unittests""" return True def ccacheOptions(self): return "" def clangOptions(self): return "" diff --git a/bin/BuildSystem/CMakeBuildSystem.py b/bin/BuildSystem/CMakeBuildSystem.py index dbe6dcb05..94ce1b8bc 100644 --- a/bin/BuildSystem/CMakeBuildSystem.py +++ b/bin/BuildSystem/CMakeBuildSystem.py @@ -1,247 +1,247 @@ # # copyright (c) 2009 Ralf Habacker # """@package provides cmake build system""" import os from CraftDebug import craftDebug import utils from BuildSystem.CMakeDependencies import * from BuildSystem.BuildSystemBase import * import compiler import utils from CraftOS.osutils import OsUtils class CMakeBuildSystem(BuildSystemBase): """ cmake build support """ def __init__( self ): """constructor. configureOptions are added to the configure command line and makeOptions are added to the make command line""" BuildSystemBase.__init__(self, "cmake") self.supportsNinja = True def __makeFileGenerator(self): """return cmake related make file generator""" - if self.makeProgramm == "ninja": + 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(): 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(): return "Visual Studio 10" if compiler.isMinGW(): return "MinGW Makefiles" elif OsUtils.isUnix(): return "Unix Makefiles" else: craftDebug.log.critical("unknown %s compiler" % self.compiler()) def __onlyBuildDefines( self, buildOnlyTargets ): """This method returns a list of cmake defines to exclude targets from build""" defines = "" topLevelCMakeList = os.path.join(self.sourceDir(), "CMakeLists.txt") if os.path.exists(topLevelCMakeList): with open(topLevelCMakeList,'r') as f: lines = f.read().splitlines() for line in lines: if line.find("macro_optional_add_subdirectory") > -1: a = line.split("(") a = a[1].split(")") subdir = a[0].strip() if not subdir in buildOnlyTargets: defines += " -DBUILD_%s=OFF" % subdir #print defines return defines def __slnFileName(self): """ return solution file name """ slnname = "%s.sln" % self.package if os.path.exists(os.path.join(self.buildDir(), slnname)): return slnname topLevelCMakeList = os.path.join(self.configureSourceDir(), "CMakeLists.txt") if os.path.exists(topLevelCMakeList): with open(topLevelCMakeList,'r') as f: lines = f.read().splitlines() for line in lines: if line.find("project(") > -1: a = line.split("(") a = a[1].split(")") slnname = "%s.sln" % a[0].strip() if os.path.exists(os.path.join(self.buildDir(), slnname)): return slnname slnname = "%s.sln" % self.subinfo.options.make.slnBaseName if os.path.exists(os.path.join(self.buildDir(), slnname)): return slnname return "NO_NAME_FOUND" def configureOptions( self, defines=""): """returns default configure options""" options = BuildSystemBase.configureOptions(self) ## \todo why is it required to replace \\ by / ? options += " -DCMAKE_INSTALL_PREFIX=\"%s\"" % self.mergeDestinationDir().replace( "\\", "/" ) options += " -DCMAKE_PREFIX_PATH=\"%s\"" % \ self.mergeDestinationDir().replace( "\\", "/" ) 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 OsUtils.isWin(): options += " -DKDE_INSTALL_USE_QT_SYS_PATHS=ON" if OsUtils.isMac(): options += " -DKDE_INSTALL_BUNDLEDIR=\"%s/Applications/KDE\" -DAPPLE_SUPPRESS_X11_WARNING=ON" % \ self.mergeDestinationDir().replace( "\\", "/" ) if not self.buildTests: options += " -DBUILD_TESTING=OFF " if self.subinfo.options.buildTools: options += " " + self.subinfo.options.configure.toolsDefine + " " if self.subinfo.options.buildStatic and self.subinfo.options.configure.staticDefine: options += " " + self.subinfo.options.configure.staticDefine + " " if self.subinfo.options.configure.onlyBuildTargets : options += self.__onlyBuildDefines(self.subinfo.options.configure.onlyBuildTargets ) if self.subinfo.options.cmake.useCTest: options += " -DCMAKE_PROGRAM_PATH=\"%s\" " % \ ( os.path.join( self.mergeDestinationDir(), "dev-utils", "svn", "bin" ).replace( "\\", "/" ) ) if compiler.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( "\\", "/" ) options += " -DCMAKE_LINKER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "xilink.exe" ).replace( "\\", "/" ) options += " \"%s\"" % self.configureSourceDir() return options def configure( self, defines=""): """implements configure step for cmake projects""" self.enterBuildDir() command = r"""cmake -G "%s" %s""" % (self.__makeFileGenerator(), self.configureOptions(defines) ) craftDebug.step(command) with open(os.path.join(self.buildDir(), "cmake-command.bat"), "w") as fc: fc.write(command) return self.system( command, "configure", 0 ) def make( self ): """implements the make step for cmake projects""" self.enterBuildDir() if self.subinfo.options.cmake.openIDE: if compiler.isMSVC2010(): command = "start vcexpress %s" % self.__slnFileName() elif self.subinfo.options.cmake.useIDE: if compiler.isMSVC2015(): command = "msbuild /maxcpucount %s /t:ALL_BUILD /p:Configuration=\"%s\"" % (self.__slnFileName(), self.buildType()) elif compiler.isMSVC2010(): craftDebug.log.critical("has to be implemented"); elif self.subinfo.options.cmake.useCTest: # first make clean - self.system( self.makeProgramm + " clean", "make clean" ) + self.system( self.makeProgram + " clean", "make clean" ) command = "ctest -M " + "Nightly" + " -T Start -T Update -T Configure -T Build -T Submit" else: - command = ' '.join([self.makeProgramm, self.makeOptions()]) + command = ' '.join([self.makeProgram, self.makeOptions()]) return self.system( command, "make" ) def install( self): """install the target""" if not BuildSystemBase.install(self): return False self.enterBuildDir() fastString = "" if not self.noFast: fastString = "/fast" env = os.environ if self.subinfo.options.install.useMakeToolForInstall: if compiler.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() - command = "%s install%s" % ( self.makeProgramm, fastString ) + command = "%s install%s" % ( self.makeProgram, fastString ) else: command = "cmake -DCMAKE_INSTALL_PREFIX=%s -P cmake_install.cmake" % self.installDir() self.system( command, "install", env=env ) if self.subinfo.options.install.useMakeToolForInstall and not (self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE): self._fixCmakeImageDir(self.installDir(), self.mergeDestinationDir()) return True def unittest( self ): """running cmake based unittests""" self.enterBuildDir() return self.system("ctest --output-on-failure") def ccacheOptions(self): out = " -DCMAKE_CXX_COMPILER=ccache -DCMAKE_CXX_COMPILER_ARG1=g++ " out += " -DCMAKE_C_COMPILER=ccache -DCMAKE_C_COMPILER_ARG1=gcc " return out def clangOptions(self): if compiler.isMSVC(): return " -DCMAKE_CXX_COMPILER=clang-cl" \ " -DCMAKE_C_COMPILER=clang-cl" return out else: return " -DCMAKE_CXX_COMPILER=clang++" \ " -DCMAKE_C_COMPILER=clang" def _fixCmakeImageDir(self, imagedir, rootdir ): """ when using DESTDIR=foo under windows, it does not _replace_ CMAKE_INSTALL_PREFIX with it, but prepends destdir to it. so when we want to be able to install imagedir into KDEROOT, we have to move things around... """ craftDebug.log.debug("fixImageDir: %s %s" % (imagedir, rootdir)) # imagedir = e:\foo\thirdroot\tmp\dbus-0\image # rootdir = e:\foo\thirdroot # files are installed to # e:\foo\thirdroot\tmp\dbus-0\image\foo\thirdroot _, rootpath = os.path.splitdrive( rootdir ) #print "rp:", rootpath if ( rootpath.startswith( os.path.sep ) ): rootpath = rootpath[1:] # CMAKE_INSTALL_PREFIX = X:\ # -> files are installed to # x:\build\foo\dbus\image\ # --> all fine in this case #print("rp:", rootpath) if len(rootpath) == 0: return tmp = os.path.join( imagedir, rootpath ) if os.path.exists(tmp): utils.mergeTree(tmp, imagedir) utils.rmtree(os.path.join(tmp, rootpath.split(os.path.pathsep)[0])) if craftSettings.getboolean("QtSDK", "Enabled", "False"): qtDir = os.path.join(craftSettings.get("QtSDK", "Path"), craftSettings.get("QtSDK", "Version"), craftSettings.get("QtSDK", "Compiler")) #drop the drive letter and the first slash [3:] path = os.path.join(imagedir, qtDir[3:]) if os.path.exists(path): utils.mergeTree(path, imagedir) utils.rmtree(os.path.join(imagedir, craftSettings.get("QtSDK", "Path")[3:])) diff --git a/bin/BuildSystem/MakeFileBuildSystem.py b/bin/BuildSystem/MakeFileBuildSystem.py index 43d50d1ff..559ea84b4 100644 --- a/bin/BuildSystem/MakeFileBuildSystem.py +++ b/bin/BuildSystem/MakeFileBuildSystem.py @@ -1,46 +1,46 @@ # # copyright (c) 2010 Ralf Habacker # """@package provides simple makefile based build system without any configure step""" import utils from BuildSystem.BuildSystemBase import * class MakeFileBuildSystem(BuildSystemBase): """ make file build support """ def __init__( self ): """constructor. configureOptions are added to the configure command line and makeOptions are added to the make command line""" BuildSystemBase.__init__(self, "makefile") def configure( self, dummyDefines=""): """implements configure step for cmake projects""" return True def make( self ): """implements the make step for Makefile projects""" self.enterBuildDir() - command = ' '.join([self.makeProgramm, self.makeOptions()]) + command = ' '.join([self.makeProgram, self.makeOptions()]) return self.system( command, "make" ) def install( self): """install the target""" if not BuildSystemBase.install(self): return False self.enterBuildDir() - command = "%s install DESTDIR=%s" % (self.makeProgramm, self.installDir()) + command = "%s install DESTDIR=%s" % (self.makeProgram, self.installDir()) self.system( command, "install" ) return True def unittest( self ): """running make tests""" self.enterBuildDir() - return self.system( "%s test" % ( self.makeProgramm ), "test" ) + return self.system( "%s test" % ( self.makeProgram ), "test" ) diff --git a/bin/BuildSystem/QMakeBuildSystem.py b/bin/BuildSystem/QMakeBuildSystem.py index 65fefa967..e5b14896c 100644 --- a/bin/BuildSystem/QMakeBuildSystem.py +++ b/bin/BuildSystem/QMakeBuildSystem.py @@ -1,120 +1,120 @@ # # copyright (c) 2009 Ralf Habacker # # definitions for the qmake build system from CraftDebug import craftDebug import utils import compiler from CraftOS.osutils import OsUtils from BuildSystem.BuildSystemBase import * from CraftVersion import CraftVersion class QMakeBuildSystem(BuildSystemBase): def __init__( self ): BuildSystemBase.__init__(self, "qmake") self.platform = "" 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") else: self.platform = "win32-%s" % (self.compiler() if CraftVersion(self.subinfo.buildTarget) < CraftVersion("5.8") else "msvc") elif compiler.isMinGW(): self.platform = "win32-g++" elif compiler.isIntel(): self.platform = "win32-icc" else: craftDebug.log.critical("QMakeBuildSystem: unsupported compiler platform %s" % self.compiler()) elif OsUtils.isUnix(): if OsUtils.isMac(): osPart = "macx" elif OsUtils.isFreeBSD(): osPart = "freebsd" else: osPart = "linux" if compiler.isClang(): compilerPart = "clang" else: compilerPart = "g++" self.platform = osPart + "-" + compilerPart def configure( self, configureDefines="" ): """inplements configure step for Qt projects""" if not self.subinfo.options.useShadowBuild: self.enterSourceDir() else: self.enterBuildDir() proFile = self.configureSourceDir() if self.subinfo.options.configure.projectFile: proFile = os.path.join(self.configureSourceDir(), self.subinfo.options.configure.projectFile) command = "%s -makefile %s %s" % (utils.utilsCache.findApplication("qmake") , proFile, self.configureOptions(configureDefines)) return self.system( command, "configure" ) def make( self, options=""): """implements the make step for Qt projects""" if not self.subinfo.options.useShadowBuild: self.enterSourceDir() else: self.enterBuildDir() - command = ' '.join([self.makeProgramm, self.makeOptions(options)]) + command = ' '.join([self.makeProgram, self.makeOptions(options)]) return self.system( command, "make" ) def install( self, options=None ): """implements the make step for Qt projects""" if not BuildSystemBase.install(self): return False if OsUtils.isWin(): # 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(): installmake="nmake /NOLOGO" elif compiler.isMinGW(): installmake="mingw32-make" else: - installmake = self.makeProgramm + installmake = self.makeProgram if not self.subinfo.options.useShadowBuild: self.enterSourceDir() else: self.enterBuildDir() if options != None: command = "%s %s" % ( installmake, options ) else: command = "%s install" % ( installmake ) return self.system( command ) def runTest( self ): """running qmake based unittests""" return True def configureOptions( self, defines=""): """returns default configure options""" defines += BuildSystemBase.configureOptions(self, defines) if self.buildType() == "Release" or self.buildType() == "RelWithDebInfo": defines += ' "CONFIG -= debug"' defines += ' "CONFIG += release"' 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" ' return '' diff --git a/portage/libs/qt5/qtbase/qtbase.py b/portage/libs/qt5/qtbase/qtbase.py index 07af60b58..7284f95b5 100644 --- a/portage/libs/qt5/qtbase/qtbase.py +++ b/portage/libs/qt5/qtbase/qtbase.py @@ -1,201 +1,201 @@ # -*- coding: utf-8 -*- import os import utils import info import portage import compiler from CraftOS.osutils import OsUtils from Package.Qt5CorePackageBase import * class subinfo(info.infoclass): def setTargets( self ): self.versionInfo.setDefaultValues( ) for ver in self.versionInfo.tarballs() + self.versionInfo.branches() + self.versionInfo.tags(): qtVer = CraftVersion(ver) if ver == "dev": self.patchToApply[ver] = [ ("fix-angle-mingw.patch", 1), ("qtbase-5.8.patch", 1),#https://codereview.qt-project.org/#/c/149550/ ] elif qtVer >= CraftVersion("5.9"): self.patchToApply[ver] = [ ("fix-angle-mingw.patch", 1), ("qtbase-5.8.patch", 1), # https://codereview.qt-project.org/#/c/149550/ ("qdbus-manager-quit-5.9.patch", 1), # https://phabricator.kde.org/D2545#69186 ("hack-fix-syncqt.patch", 1), ("0001-Fix-private-headers.patch", 1)#https://bugreports.qt.io/browse/QTBUG-37417 ] if qtVer < CraftVersion("5.10"): self.patchToApply[ver] += [("0001-Add-APPDIR-data-APPNAME-to-the-non-Generic-paths-on-.patch", 1)] # https://codereview.qt-project.org/#/c/197855/ elif qtVer >= CraftVersion("5.8"): self.patchToApply[ver] = [ ("fix-angle-mingw.patch", 1), ("qtbase-5.8.patch", 1), # https://codereview.qt-project.org/#/c/141254/ # https://codereview.qt-project.org/#/c/149550/ ("qdbus-manager-quit-5.8.patch", 1) # https://phabricator.kde.org/D2545#69186 ] elif qtVer >= CraftVersion("5.7"): self.patchToApply[ver] = [ ("fix-angle-mingw.patch", 1), ("qtbase-5.7.patch", 1), # https://codereview.qt-project.org/#/c/141254/ # https://codereview.qt-project.org/#/c/149550/ ("do-not-spawn-console-qprocess-startdetached.patch", 1), # https://codereview.qt-project.org/#/c/162585/ ("qdbus-manager-quit-5.7.patch", 1) # https://phabricator.kde.org/D2545#69186 ] else: self.patchToApply[ ver ] = [ ("qmake-fix-install-root.patch", 1), ("qtbase-5.6.patch" , 1),#https://codereview.qt-project.org/#/c/141254/ #https://codereview.qt-project.org/#/c/149550/ ("do-not-spawn-console-qprocess-startdetached.patch", 1),#https://codereview.qt-project.org/#/c/162585/ ("fix-angle-mingw-5.6.2-20161027.diff", 1), ("qdbus-manager-quit-5.7.patch", 1) # https://phabricator.kde.org/D2545#69186 ] self.shortDescription = "a cross-platform application framework" def setDependencies( self ): if craftSettings.getboolean("Packager", "UseCache") and not craftSettings.getboolean("QtSDK", "Enabled", False): self.buildDependencies['dev-util/qtbinpatcher'] = 'default' self.runtimeDependencies['virtual/base'] = 'default' self.buildDependencies['dev-util/perl'] = 'default' self.buildDependencies['dev-util/winflexbison'] = 'default' if not self.options.buildStatic: self.runtimeDependencies['win32libs/openssl'] = 'default' self.runtimeDependencies['win32libs/dbus'] = 'default' self.runtimeDependencies['binary/mysql'] = 'default' self.runtimeDependencies['win32libs/icu'] = 'default' self.runtimeDependencies['win32libs/zlib'] = 'default' class QtPackage(Qt5CorePackageBase): def __init__( self, **args ): Qt5CorePackageBase.__init__(self) def compile(self): with self.getQtBaseEnv(): return Qt5CorePackageBase.compile(self) def configure( self, unused1=None, unused2=""): if compiler.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 self.enterBuildDir() if OsUtils.isWin(): configure = os.path.join( self.sourceDir() ,"configure.bat" ).replace( "/", "\\" ) if not os.path.exists(os.path.join(self.sourceDir(), ".gitignore")): # force bootstrap of configure.exe with open(os.path.join(self.sourceDir(), ".gitignore"), "wt+") as bootstrap: bootstrap.write("Force Bootstrap") if os.path.exists(os.path.join(self.sourceDir(), "configure.exe")): os.remove(os.path.join(self.sourceDir(), "configure.exe")) elif OsUtils.isUnix(): configure = os.path.join( self.sourceDir() ,"configure" ) command = " %s -opensource -confirm-license -prefix %s -platform %s " % ( configure, CraftStandardDirs.craftRoot(), self.platform ) command += "-headerdir %s " % os.path.join(CraftStandardDirs.craftRoot(), "include", "qt5") command += "-qt-libpng " command += "-qt-libjpeg " # can we drop that in general? version = CraftVersion(self.subinfo.buildTarget) if version <= CraftVersion("5.6"): command += "-c++11 " if version >= CraftVersion("5.8"): command += "-mp " else: command += "-qt-pcre " if OsUtils.isWin(): command += "-opengl dynamic " command += "-plugin-sql-odbc " if not (OsUtils.isFreeBSD() or compiler.isMinGW()): command += "-ltcg " if self.buildType() == "RelWithDebInfo": command += "-force-debug-info " if self.buildType() == "Debug": command += "-debug " else: command += "-release " if not self.subinfo.options.buildStatic: command += "-I \"%s\" -L \"%s\" " % (os.path.join(CraftStandardDirs.craftRoot(), "include"), os.path.join(CraftStandardDirs.craftRoot(), "lib")) if self.subinfo.options.isActive("win32libs/openssl"): command += " -openssl-linked " if self.subinfo.options.isActive("binary/mysql"): command += " -plugin-sql-mysql " if self.subinfo.options.isActive("win32libs/dbus"): command += " -qdbus -dbus-linked " if self.subinfo.options.isActive("win32libs/icu"): command += " -icu " if self.subinfo.options.isActive("win32libs/zlib"): command += " -system-zlib " if compiler.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: command += "-no-pch " return utils.system( command ) def install( self ): with self.getQtBaseEnv(): if not Qt5CorePackageBase.install(self): return False 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(): srcdir = os.path.join( self.buildDir(), "lib" ) destdir = os.path.join( self.installDir(), "lib" ) filelist = os.listdir( srcdir ) for file in filelist: if file.endswith( ".pdb" ): utils.copyFile( os.path.join( srcdir, file ), os.path.join( destdir, file ) ) return True def qmerge( self ): if not Qt5CorePackageBase.qmerge(self): return False if craftSettings.getboolean("Packager", "UseCache"): patcher = utils.utilsCache.findApplication("qtbinpatcher") binRoot = os.path.join(CraftStandardDirs.craftRoot(), "bin") return self.system(f"\"{patcher}\" --nobackup --qt-dir=\"{binRoot}\"") return True @property - def makeProgramm(self): + 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(): return f"mingw32-make -j{os.environ['NUMBER_OF_PROCESSORS']}" - return super(Qt5CorePackageBase, self).makeProgramm + return super(Qt5CorePackageBase, self).makeProgram def getQtBaseEnv(self): envs = {} envs["PATH"] = os.pathsep.join([os.path.join(self.buildDir(), "bin"), os.environ["PATH"]]) if CraftVersion(self.subinfo.buildTarget) < CraftVersion("5.9"): # so that the mkspecs can be found, when -prefix is set envs["QMAKEPATH"] = self.sourceDir() if CraftVersion(self.subinfo.buildTarget) < CraftVersion("5.8"): envs["QMAKESPEC"] = os.path.join(self.sourceDir(), 'mkspecs', self.platform) else: envs["QMAKESPEC"] = None return utils.ScopedEnv(envs) class Package( Qt5CoreSdkPackageBase ): def __init__(self): Qt5CoreSdkPackageBase.__init__(self, classA=QtPackage)