def setTargets( self ): if compiler.isX64(): if compiler.isMinGW(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win64.exe" if compiler.isMSVC(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win64.zip" else: if compiler.isMinGW(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win32.exe" if compiler.isMSVC(): self.targets['1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win32.zip" self.shortDescription = "The Yasm Modular Assembler Project" self.defaultTarget = '1.2.0'
def __init__(self): self.msysdir = os.path.join( EmergeStandardDirs.emergeRoot(), "msys" ) self.environment = os.environ.copy() self._sh = os.path.join( self.msysdir, "bin", "sh.exe" ) if not os.path.exists( self._sh ): self._sh = os.path.join( self.msysdir, "usr", "bin", "bash.exe" ) mergeroot = self.toNativePath(EmergeStandardDirs.emergeRoot()) if compiler.isMinGW(): ldflags = "-L%s/lib " % mergeroot cflags = "-I%s/include " % mergeroot if self.buildType == "RelWithDebInfo": cflags += " -O2 -g " elif self.buildType == "Debug": cflags += " -O0 -g3 " elif compiler.isMSVC(): ldflags = "" cflags = " -MD -Zi" if compiler.isMSVC2013(): cflags = " -FS" self.environment[ "MSYS2_PATH_TYPE" ] = "inherit"#inherit the windows path if "make" in self.environment: del self.environment[ "make" ] if compiler.isMinGW(): arch = "32" if compiler.isX64(): arch = "64" self.environment[ "MSYSTEM" ] = "MINGW%s_EMERGE" % arch self.environment[ "CFLAGS" ] = cflags self.environment[ "CXXFLAGS" ] = cflags if ldflags != "": self.environment[ "LDFLAGS" ] = ldflags if compiler.isMSVC(): self.environment[ "LIB" ] = "%s;%s\\lib" % ( os.getenv("LIB"), EmergeStandardDirs.emergeRoot()) self.environment[ "INCLUDE" ] = "%s;%s\\include" % ( os.getenv("INCLUDE"), EmergeStandardDirs.emergeRoot()) self.environment[ "LD" ] = "link" self.environment[ "CC" ] = "cl -nologo" self.environment[ "CXX" ] = "cl -nologo" self.environment[ "NM" ] = "dumpbin -symbols" self.environment[ "AR" ] = "lib" #self.environment[ "WINDRES","rc-windres" #self.environment[ "RC","rc-windres" self.environment[ "STRIP"] = ":" self.environment[ "RANLIB"] = ":" self.environment[ "F77" ] = "no" self.environment[ "FC" ] = "no"
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean("Compile","UseNinja", False): return "Ninja" if compiler.isMSVC2015(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 14 2015" + " Win64" if compiler.isX64() else "" else: return "NMake Makefiles" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def getEnv( self ): out = dict( ) if compiler.isMSVC( ): compilerDirs = { "msvc2010": "VS100COMNTOOLS", "msvc2012": "VS110COMNTOOLS", "msvc2013": "VS120COMNTOOLS", "msvc2015": "VS140COMNTOOLS" } architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" } crossmodifier = "" if not compiler.isNative(): crossmodifier="_cross" status, result = subprocess.getstatusoutput( "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" % ( os.getenv( compilerDirs[ compiler.getCompilerName( ) ] ), architectures[ compiler.architecture( ) + crossmodifier ]) ) if status != 0: print( "Failed to setup msvc compiler", file = sys.stderr ) out = self.stringToEnv( result ) elif compiler.isIntel( ): architectures = { "x86": "ia32", "x64": "intel64" } programFiles = os.getenv( "ProgramFiles(x86)" ) or os.getenv( "ProgramFiles" ) status, result = subprocess.getstatusoutput( "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % ( programFiles, architectures[ compiler.architecture( ) ]) ) if status != 0: print( "Failed to setup intel compiler", file = sys.stderr ) out = self.stringToEnv( result ) elif compiler.isMinGW( ): out = { "Path": os.getenv( "Path" ) } return out
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean( "Compile", "UseNinja", False): return "Ninja" if compiler.isMSVC2015(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 14 2015" + " Win64" if compiler.isX64( ) else "" else: return "NMake Makefiles" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def clangOptions(self): if compiler.isMinGW(): out = " -DCMAKE_CXX_COMPILER=clang++" out += " -DCMAKE_C_COMPILER=clang" elif compiler.isMSVC(): out = " -DCMAKE_CXX_COMPILER=clang-cl" out += " -DCMAKE_C_COMPILER=clang-cl" return out
def setTargets(self): if compiler.isX64(): if compiler.isMinGW(): self.targets[ '1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win64.exe" if compiler.isMSVC(): self.targets[ '1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win64.zip" else: if compiler.isMinGW(): self.targets[ '1.2.0'] = "http://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win32.exe" if compiler.isMSVC(): self.targets[ '1.2.0'] = "http://www.tortall.net/projects/yasm/releases/vsyasm-1.2.0-win32.zip" self.shortDescription = "The Yasm Modular Assembler Project" self.defaultTarget = '1.2.0'
def setDependencies(self): self.buildDependencies['virtual/base'] = 'default' self.buildDependencies['dev-util/perl'] = 'default' if compiler.isMinGW(): self.buildDependencies['dev-util/msys'] = 'default' self.dependencies['win32libs/zlib'] = 'default' elif compiler.isMSVC() and compiler.isX86(): self.buildDependencies['dev-util/nasm'] = 'default'
def setTargets( self ): self.targets['0.9.1'] = "http://downloads.sourceforge.net/project/libofx/libofx/0.9.1/libofx-0.9.1.tar.gz" self.targetInstSrc['0.9.1'] = "libofx-0.9.1" self.patchToApply['0.9.1'] = [] if compiler.isMSVC(): self.patchToApply['0.9.1'].append(("ofx-msvc.diff", 1)) self.patchToApply['0.9.1'].append(("libofx-0.9.1-20110107.diff", 1)) self.targets['0.9.2'] = "http://downloads.sourceforge.net/project/libofx/libofx/0.9.2/libofx-0.9.2.tar.gz" self.targetInstSrc['0.9.2'] = "libofx-0.9.2" self.patchToApply['0.9.2'] = [] if compiler.isMSVC(): self.patchToApply['0.9.2'].append(("ofx-msvc.diff", 1)) self.patchToApply['0.9.2'].append(("libofx-0.9.2-20110215.diff", 1)) self.shortDescription = "a parser and an API for the OFX (Open Financial eXchange) specification" self.defaultTarget = '0.9.2'
def unpack(self): destdir = os.path.join(self.sourceDir(), "bin") utils.createDir(self.sourceDir()) utils.createDir(destdir) postfix = "" if self.buildType() == "Debug": postfix = "d" srcdir = None files = [] if compiler.isMinGW(): if self.subinfo.options.features.legacyGCC: if compiler.isMinGW_W32(): srcdir = os.path.join(self.rootdir, "mingw", "bin") elif compiler.isMinGW_W64(): srcdir = os.path.join(self.rootdir, "mingw64", "bin") files = ['libgcc_s_sjlj-1.dll', 'libgomp-1.dll'] else: files = [ 'libgomp-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll' ] if compiler.isMinGW_W32(): files.append('libgcc_s_sjlj-1.dll') srcdir = os.path.join(self.rootdir, "mingw", "bin") elif compiler.isMinGW_W64(): files.append('libgcc_s_seh-1.dll') srcdir = os.path.join(self.rootdir, "mingw64", "bin") elif compiler.isMSVC(): if compiler.isX86( ) and os.environ["PROCESSOR_ARCHITECTURE"] == "AMD64": srcdir = os.path.join(os.environ["SystemRoot"], "SysWOW64") else: srcdir = os.path.join(os.environ["SystemRoot"], "System32") if compiler.isMSVC2010(): files = [ "msvcr100%s.dll" % postfix, "msvcp100%s.dll" % postfix ] elif compiler.isMSVC2013(): files = [ "msvcr120%s.dll" % postfix, "msvcp120%s.dll" % postfix ] elif compiler.isMSVC2015(): files = [ "concrt140%s.dll" % postfix, "msvcp140%s.dll" % postfix, "vccorlib140%s.dll" % postfix, "vcruntime140%s.dll" % postfix ] for file in files: utils.copyFile(os.path.join(srcdir, file), os.path.join(destdir, file), False) return True
def __init__( self, **args ): AutoToolsPackageBase.__init__(self) self.subinfo.options.package.withCompiler = False self.platform = "" self.subinfo.options.configure.defines = " --disable-static --enable-shared --enable-gpl --enable-libvorbis --disable-doc --enable-libmp3lame --enable-libopus --enable-w32threads" if compiler.isMSVC(): self.subinfo.options.configure.defines += " --toolchain=msvc" else: self.subinfo.options.configure.cflags = "-std=c99 "
def __init__(self): BuildSystemBase.__init__(self, "qmake") self.platform = "" if compiler.isMSVC(): self.platform = "win32-%s" % self.compiler() elif compiler.isMinGW(): self.platform = "win32-g++" elif compiler.isIntel(): self.platform = "win32-icc" else: utils.die("QMakeBuildSystem: unsupported compiler platform %s" % self.compiler())
def unpack( self ): destdir = os.path.join( self.sourceDir(), "bin" ) utils.createDir( self.sourceDir() ) utils.createDir( destdir ) postfix = "" if self.buildType() == "Debug": postfix = "d" srcdir = None files = [] if compiler.isMinGW(): if self.subinfo.options.features.legacyGCC: if compiler.isMinGW_W32(): srcdir = os.path.join( self.rootdir, "mingw", "bin" ) elif compiler.isMinGW_W64(): srcdir = os.path.join( self.rootdir, "mingw64", "bin" ) files = [ 'libgcc_s_sjlj-1.dll', 'libgomp-1.dll' ] else: files = [ 'libgomp-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll' ] if compiler.isMinGW_W32(): files.append('libgcc_s_sjlj-1.dll') srcdir = os.path.join( self.rootdir, "mingw", "bin" ) elif compiler.isMinGW_W64(): files.append('libgcc_s_seh-1.dll') srcdir = os.path.join( self.rootdir, "mingw64", "bin" ) elif compiler.isMSVC(): if compiler.isX86() and os.environ["PROCESSOR_ARCHITECTURE"] == "AMD64": srcdir = os.path.join( os.environ["SystemRoot"], "SysWOW64") else: srcdir = os.path.join( os.environ["SystemRoot"], "System32") if compiler.isMSVC2010(): files = [ "msvcr100%s.dll" % postfix, "msvcp100%s.dll" % postfix ] elif compiler.isMSVC2013(): files = [ "msvcr120%s.dll" % postfix, "msvcp120%s.dll" % postfix ] elif compiler.isMSVC2015(): files = [ "concrt140%s.dll" % postfix, "msvcp140%s.dll" % postfix, "vccorlib140%s.dll" % postfix, "vcruntime140%s.dll" % postfix ] for file in files: utils.copyFile( os.path.join( srcdir, file ), os.path.join( destdir, file ), False ) return True
def install(self): if not self.cleanImage(): return False # This package is built with MinGW gcc, since the msvc expects a different # Name it shall get it. if compiler.isMSVC(): gcc_names = glob.glob(self.sourceDir() + "/lib/*.dll.a") for gcc_name in gcc_names: msvc_name = gcc_name.replace(".dll.a", ".lib") shutil.move(gcc_name, msvc_name) shutil.copytree(self.sourceDir(), self.installDir()) return True
def __init__( self): BuildSystemBase.__init__(self, "qmake") self.platform = "" if compiler.isMSVC(): self.platform = "win32-%s" % self.compiler() if compiler.isMSVC2011(): print "Warning: using win32-msvc2010 instead of win32-msvc2011" self.platform = "win32-msvc2010" elif compiler.isMinGW(): self.platform = "win32-g++" else: utils.die( "QMakeBuildSystem: unsupported compiler platform %s" % self.compiler() )
def setTargets( self ): svnurl = "https://ebook-tools.svn.sourceforge.net/svnroot/ebook-tools/" self.svnTargets['svnHEAD'] = svnurl + 'trunk/ebook-tools' for ver in ['0.1.1', '0.2.1']: self.targets[ ver ] = 'http://downloads.sourceforge.net/ebook-tools/ebook-tools-' + ver + '.tar.gz' self.targetInstSrc[ ver ] = 'ebook-tools-' + ver self.patchToApply[ ver ] = [('ebook-tools-' + ver + '.diff', 1)] if compiler.isMSVC(): self.patchToApply['0.1.1'].append(('msvc-toC89.diff', 1)) self.targetDigests['0.2.1'] = '1340eb7141b453088d39e62bba771413053a6d18' self.shortDescription = "Tools for accessing and converting various ebook file formats" self.defaultTarget = '0.2.1'
def install(self): if (not self.cleanImage()): return False # This package is built with MinGW gcc, since the msvc expects a different # Name it shall get it. if compiler.isMSVC(): gcc_names = glob.glob(self.sourceDir() + '/lib/*.dll.a') for gcc_name in gcc_names: msvc_name = gcc_name.replace(".dll.a", ".lib") shutil.move(gcc_name, msvc_name) shutil.copytree(self.sourceDir(), self.installDir()) return True
def install(self): utils.copyDir(os.path.join(self.sourceDir(), "..", "bin"), os.path.join(self.imageDir(), "bin")) utils.copyDir(os.path.join(self.sourceDir(), "..", "bin64"), os.path.join(self.imageDir(), "bin")) utils.copyDir(os.path.join(self.sourceDir(), "..", "include"), os.path.join(self.imageDir(), "include")) utils.copyDir(os.path.join(self.sourceDir(), "..", "lib"), os.path.join(self.imageDir(), "lib")) utils.copyDir(os.path.join(self.sourceDir(), "..", "lib64"), os.path.join(self.imageDir(), "lib")) if compiler.isMSVC() and self.buildType() == "Debug": imagedir = os.path.join( self.installDir(), "lib" ) filelist = os.listdir( imagedir ) for f in filelist: if f.endswith( "d.lib" ): utils.copyFile( os.path.join( imagedir, f ), os.path.join( imagedir, f.replace( "d.lib", ".lib" ) ) ) return True
def _getmakeProgram(self): EMERGE_MAKE_PROGRAM = os.getenv( "EMERGE_MAKE_PROGRAM" ) if EMERGE_MAKE_PROGRAM and self.subinfo.options.make.supportsMultijob: utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) return EMERGE_MAKE_PROGRAM elif not self.subinfo.options.make.supportsMultijob: os.unsetenv("MAKE") if compiler.isMSVC(): return "nmake /NOLOGO" elif compiler.isMinGW_WXX(): return "gmake" elif compiler.isMinGW32(): return "mingw32-make" else: utils.die( "unknown %s compiler" % self.compiler() )
def _getmakeProgram(self): if self.supportsNinja and emergeSettings.getboolean("Compile","UseNinja", False): return "ninja" makeProgram = emergeSettings.get("Compile", "MakeProgram", "" ) if makeProgram != "" and self.subinfo.options.make.supportsMultijob: EmergeDebug.debug("set custom make program: %s" % makeProgram, 1) return makeProgram elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def __init__(self): BuildSystemBase.__init__(self, "qmake") self.platform = "" if compiler.isMSVC(): if compiler.isClang(): self.platform = "win32-clang-%s" % self.compiler() else: self.platform = "win32-%s" % self.compiler() elif compiler.isMinGW(): self.platform = "win32-g++" elif compiler.isIntel(): self.platform = "win32-icc" else: EmergeDebug.die( "QMakeBuildSystem: unsupported compiler platform %s" % self.compiler())
def _getmakeProgram(self): if self.supportsNinja and emergeSettings.getboolean("General","EMERGE_USE_NINJA", False): return "ninja" EMERGE_MAKE_PROGRAM = emergeSettings.get("General", "EMERGE_MAKE_PROGRAM", "" ) if EMERGE_MAKE_PROGRAM != "" and self.subinfo.options.make.supportsMultijob: utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) return EMERGE_MAKE_PROGRAM elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: utils.die( "unknown %s compiler" % self.compiler() )
def _getmakeProgram(self): if self.supportsNinja and utils.envAsBool("EMERGE_USE_NINJA"): return "ninja" EMERGE_MAKE_PROGRAM = os.getenv( "EMERGE_MAKE_PROGRAM" ) if EMERGE_MAKE_PROGRAM and self.subinfo.options.make.supportsMultijob: utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) return EMERGE_MAKE_PROGRAM elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: utils.die( "unknown %s compiler" % self.compiler() )
def __init__( self, **args ): self.subinfo = subinfo() CMakePackageBase.__init__( self ) self.subinfo.options.make.supportsMultijob = False mergeDir = self.mergeDestinationDir() self.subinfo.options.configure.defines = ("prefix=%s " % self.imageDir() + \ "include=%s " % os.path.join(mergeDir,"include") + \ "lib=%s " % os.path.join(mergeDir,"lib") + \ "zlib=yes ") if os.getenv("EMERGE_BUILDTYPE") == "Debug": self.subinfo.options.configure.defines += " debug=yes" if compiler.isMinGW(): self.subinfo.options.configure.defines += " compiler=mingw" elif compiler.isMSVC(): self.subinfo.options.configure.defines += " compiler=msvc"
def setDirectories( self ): """setting all important stuff that isn't coped with in the c'tor parts will probably go to infoclass""" utils.debug( "setdirectories called", 1 ) self.PV, dummyExt = os.path.splitext( os.path.basename( self.argv0 ) ) ( self.category, self.package, self.version ) = \ portage.getCategoryPackageVersion( self.argv0 ) utils.debug( "setdir category: %s, package: %s" % ( self.category, self.package ) ) self.cmakeInstallPrefix = ROOTDIR.replace( "\\", "/" ) utils.debug( "cmakeInstallPrefix: " + self.cmakeInstallPrefix ) if compiler.isMSVC(): self.cmakeMakefileGenerator = "NMake Makefiles" self.cmakeMakeProgramm = "nmake" elif compiler.isMinGW(): self.cmakeMakefileGenerator = "MinGW Makefiles" if compiler.isMinGW_WXX(): self.cmakeMakeProgramm = "gmake" else: self.cmakeMakeProgramm = "mingw32-make" else: utils.die( "KDECOMPILER: %s not understood" % COMPILER ) if EMERGE_MAKE_PROGRAM and self.subinfo.options.make.supportsMultijob: self.cmakeMakeProgramm = EMERGE_MAKE_PROGRAM utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) self.rootdir = ROOTDIR self.downloaddir = DOWNLOADDIR self.workdir = os.path.join( ROOTDIR, "tmp", self.PV, "work" ) self.imagedir = os.path.join( ROOTDIR, "tmp", self.PV, "image-" + COMPILER ) self.packagedir = os.path.join( portage.rootDirForPackage( self.category, self.package ), self.category, self.package ) self.kdesvndir = KDESVNDIR self.kdesvnserver = KDESVNSERVER self.kdesvnuser = KDESVNUSERNAME self.kdesvnpass = KDESVNPASSWORD self.svndir = os.path.join( self.downloaddir, "svn-src", self.package ) self.strigidir = os.getenv( "STRIGI_HOME" ) self.dbusdir = os.getenv( "DBUSDIR" )
def initEnvironment(self, cflags="", ldflags=""): mergeroot = self.toNativePath(os.getenv("KDEROOT")) if compiler.isMinGW(): ldflags = "-L%s/lib %s" % (mergeroot, ldflags) cflags = "-I%s/include %s" % (mergeroot, cflags) if self.buildType == "RelWithDebInfo": cflags += " -O2 -g " elif self.buildType == "Debug": cflags += " -O0 -g3 " elif compiler.isMSVC(): utils.putenv("LIB", "%s;%s\\lib" % ( os.getenv("LIB"), os.getenv("KDEROOT"))) utils.putenv("INCLUDE", "%s;%s\\include" % ( os.getenv("INCLUDE"), os.getenv("KDEROOT"))) utils.putenv("LD", "link") utils.putenv("CC", "/share/automake-1.13/compile cl -nologo") utils.putenv("CXX", "/share/automake-1.13/compile cl -nologo") utils.putenv("NM", "dumpbin -symbols") utils.putenv("AR", "/share/automake-1.13/ar-lib lib") utils.putenv("WINDRES","rc-windres") utils.putenv("RC","rc-windres") utils.putenv("STRIP",":") utils.putenv("RANLIB",":") utils.putenv("F77", "no") utils.putenv("FC", "no") cflags += " -MD -Zi" utils.putenv("PKG_CONFIG_PATH", "%s/lib/pkgconfig" % mergeroot) utils.putenv("CFLAGS", cflags) utils.putenv("LDFLAGS", ldflags) #unset make to remove things like jom if "MAKE" in os.environ: del os.environ["MAKE"] utils.putenv("PATH", "%s;%s" % ( os.environ.get( "PATH" ), os.path.join( os.environ.get( "KDEROOT" ), "dev-utils", "bin" ))) if not self.options.features.msys2: #seting perl to prevent msys from using msys-perl perl = self.toNativePath(os.path.join( os.environ.get( "KDEROOT" ), "dev-utils", "bin", "perl.exe" )) utils.putenv("PERL", perl) utils.putenv("INTLTOOL_PERL", perl) #prepare path to use autotools utils.putenv("PATH", "%s;%s" % ( os.environ.get( "PATH" ), os.path.join( self.msysdir, "opt", "autotools", "bin" ))) else: utils.putenv("MSYSTEM","MINGW32")
def install( self ): self.setPathes() 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 install(self, options=None): """implements the make step for Qt projects""" if not BuildSystemBase.install(self): return False # 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" self.enterBuildDir() if options != None: command = "%s %s" % (installmake, options) else: command = "%s install" % (installmake) return self.system(command)
def __init__(self): self.subinfo = subinfo() if not compiler.isMSVC(): utils.die("Only Microsoft Visual Studio is currently "+ "supported for packaging for WinCE.") CMakePackageBase.__init__( self ) self.whitelist = [] # Add here files that should be loaded into the high memory slots self.loader_executables = [ "bin\\kmail-mobile.exe", "bin\\kaddressbook-mobile.exe", "bin\\korganizer-mobile.exe", "bin\\notes-mobile.exe", "bin\\tasks-mobile.exe", "bin\\kleopatra.exe" ] # Icons for the Start Menu self.menu_icons = [ "contacts-90.png", "mail-90.png", "notes-90.png", "organizer-90.png", "tasks-90.png" ]
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean("General","EMERGE_USE_NINJA", False): return "Ninja" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: utils.die( "unknown %s compiler" % self.compiler() )
def install(self): self.setPathes() 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 __makeFileGenerator(self): """return cmake related make file generator""" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: if self.isTargetBuild(): return "Visual Studio 9.0 Windows Mobile 6 Professional SDK (ARMV4I)" else: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: utils.die( "unknown %s compiler" % self.compiler() )
def getEnv(self): out = dict() if compiler.isMSVC(): compilerDirs = { "msvc2010": "VS100COMNTOOLS", "msvc2012": "VS110COMNTOOLS", "msvc2013": "VS120COMNTOOLS", "msvc2015": "VS140COMNTOOLS" } architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" } crossmodifier = "" if not compiler.isNative(): crossmodifier = "_cross" status, result = subprocess.getstatusoutput( "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" % (os.getenv(compilerDirs[compiler.getCompilerName()]), architectures[compiler.architecture() + crossmodifier])) if status != 0: print("Failed to setup msvc compiler", file=sys.stderr) exit(1) out = self.stringToEnv(result) elif compiler.isIntel(): architectures = {"x86": "ia32", "x64": "intel64"} programFiles = os.getenv("ProgramFiles(x86)") or os.getenv( "ProgramFiles") status, result = subprocess.getstatusoutput( "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % (programFiles, architectures[compiler.architecture()])) if status != 0: print("Failed to setup intel compiler", file=sys.stderr) exit(1) out = self.stringToEnv(result) elif compiler.isMinGW(): out = {"Path": os.getenv("Path")} return out
def install(self): utils.copyDir(os.path.join(self.sourceDir(), "..", "bin"), os.path.join(self.imageDir(), "bin")) utils.copyDir(os.path.join(self.sourceDir(), "..", "bin64"), os.path.join(self.imageDir(), "bin")) utils.copyDir(os.path.join(self.sourceDir(), "..", "include"), os.path.join(self.imageDir(), "include")) utils.copyDir(os.path.join(self.sourceDir(), "..", "lib"), os.path.join(self.imageDir(), "lib")) utils.copyDir(os.path.join(self.sourceDir(), "..", "lib64"), os.path.join(self.imageDir(), "lib")) if compiler.isMSVC() and self.buildType() == "Debug": imagedir = os.path.join(self.installDir(), "lib") filelist = os.listdir(imagedir) for f in filelist: if f.endswith("d.lib"): utils.copyFile( os.path.join(imagedir, f), os.path.join(imagedir, f.replace("d.lib", ".lib"))) return True
def initEnvironment(self, cflags="", ldflags=""): mergeroot = self.toNativePath(os.getenv("KDEROOT")) cflags = "-I%s/include %s" % (mergeroot, cflags) ldflags = "-L%s/lib %s" % (mergeroot, ldflags) if compiler.isMinGW(): if self.buildType == "RelWithDebInfo": cflags += " -O2 -g " elif self.buildType == "Debug": cflags += " -O0 -g3 " elif compiler.isMSVC(): utils.putenv("LD", "link.exe") utils.putenv("CFLAGS", cflags) utils.putenv("LDFLAGS", ldflags) #unset make to remove things like jom os.unsetenv("MAKE") utils.putenv("PATH", "%s;%s" % ( os.environ.get( "PATH" ), os.path.join( os.environ.get( "KDEROOT" ), "dev-utils", "bin" ))) #seting perl to prevent msys from using msys-perl perl = self.toNativePath(os.path.join( os.environ.get( "KDEROOT" ), "dev-utils", "bin", "perl.exe" )) utils.putenv("PERL", perl) utils.putenv("INTLTOOL_PERL", perl) #prepare path to sue autotools utils.putenv("PATH", "%s;%s" % ( os.environ.get( "PATH" ), os.path.join( os.environ.get( "MSYSDIR" ), "opt", "autotools", "bin" )))
def configure(self, unused1=None, unused2=""): self.enterBuildDir() self.setPathes() 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")) configure = os.path.join(self.sourceDir(), "configure.bat").replace("/", "\\") command = " %s -opensource -confirm-license -prefix %s -platform %s " % ( configure, EmergeStandardDirs.emergeRoot(), self.platform) command += "-headerdir %s " % os.path.join( EmergeStandardDirs.emergeRoot(), "include", "qt5") command += "-plugin-sql-odbc " command += "-qt-style-windowsxp -qt-style-windowsvista " command += "-qt-libpng " command += "-qt-libjpeg " command += "-qt-pcre " command += "-nomake examples " if compiler.isMSVC() and compiler.isClang(): command += "-no-pch " # can we drop that in general? if not self.subinfo.buildTarget.startswith("5.7"): command += "-c++11 " command += "-opengl dynamic " command += "-ltcg " if self.buildType() == "RelWithDebInfo": command += "-force-debug-info " command += "-I \"%s\" -L \"%s\" " % (os.path.join( EmergeStandardDirs.emergeRoot(), "include"), os.path.join(EmergeStandardDirs.emergeRoot(), "lib")) if not self.subinfo.options.buildStatic: command += " -openssl-linked " if self.subinfo.options.isActive("binary/mysql-pkg"): 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/zip"): command += " -system-zlib " if compiler.isMSVC(): command += " ZLIB_LIBS=zlib.lib " else: command += " -static -static-runtime " if self.buildType() == "Debug": command += "-debug " else: command += "-release " if self.supportsCCACHE: command != "-dont-process " print("command: ", command) if not utils.system(command): return False if self.supportsCCACHE: return Qt5CorePackageBase.configure(self) else: return True
def __init__( self, **args ): CMakePackageBase.__init__( self ) if compiler.isMSVC(): self.subinfo.options.configure.defines = "-DBUILD_TESTS=OFF"
def setDependencies( self ): self.dependencies['qt-libs/phonon'] = 'default' self.dependencies['binary/vlc'] = 'default' if compiler.isMSVC() or compiler.isIntel(): self.dependencies['kdesupport/kdewin'] = 'default'
'2.9.1'] = '24d40e89c2e66a765733e8c98d6f94500343da86' self.shortDescription = 'a POSIX thread implementation for windows' self.defaultTarget = '2.9.1' def setDependencies(self): self.buildDependencies['virtual/base'] = 'default' from Package.CMakePackageBase import * from Package.VirtualPackageBase import * class PthreadsPackage(CMakePackageBase): def __init__(self, **args): CMakePackageBase.__init__(self) self.subinfo.options.configure.defines = " -DBUILD_TESTS=OFF" if compiler.isMSVC() or compiler.isIntel() or compiler.getMinGWVersion( ) == "4.4.7": class Package(PthreadsPackage): def __init__(self): PthreadsPackage.__init__(self) else: class Package(VirtualPackageBase): def __init__(self): VirtualPackageBase.__init__(self)
self.patchToApply['2.8.0'] = [('pthreads-w32-2-8-0-release-20110729.diff', 1)] self.patchToApply['2.9.1'] = [('pthreads-w32-2-9-1-release-20130901.diff', 1)] self.targetDigests['2.8.0'] = 'da8371cb20e8e238f96a1d0651212f154d84a9ac' self.targetDigests['2.9.1'] = '24d40e89c2e66a765733e8c98d6f94500343da86' self.shortDescription = 'a POSIX thread implementation for windows' self.defaultTarget = '2.9.1' def setDependencies( self ): self.buildDependencies['virtual/base'] = 'default' from Package.CMakePackageBase import * from Package.VirtualPackageBase import * class PthreadsPackage(CMakePackageBase): def __init__( self, **args ): CMakePackageBase.__init__(self) self.subinfo.options.configure.defines = " -DBUILD_TESTS=OFF" if compiler.isMSVC() or compiler.isIntel() or compiler.getMinGWVersion() == "4.4.7": class Package(PthreadsPackage): def __init__( self ): PthreadsPackage.__init__( self ) else: class Package(VirtualPackageBase): def __init__( self ): VirtualPackageBase.__init__( self )
def __init__(self): self.subinfo = subinfo() BinaryPackageBase.__init__( self ) if not compiler.isMSVC(): utils.die("Only Microsoft Visual Studio is currently "+ "supported for getting the ce runtime.")