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

        elif compiler.isIntel( ):
            architectures = { "x86": "ia32", "x64": "intel64" }
            programFiles = os.getenv( "ProgramFiles(x86)" ) or os.getenv( "ProgramFiles" )
            status, result = subprocess.getstatusoutput(
                "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % (
                    programFiles, architectures[ compiler.architecture( ) ]) )
            if status != 0:
                print( "Failed to setup intel compiler", file = sys.stderr )
            out = self.stringToEnv( result )
        elif compiler.isMinGW( ):
            out = { "Path": os.getenv( "Path" ) }
        return out
Example #4
0
 def setDependencies( self ):
     self.dependencies['kde/kde-runtime'] = 'default'
     self.dependencies['kde/kdepimlibs'] = 'default'
     if compiler.isMinGW():
         self.dependencies['win32libs-bin/libgmp'] = 'default'
     self.dependencies['win32libs-bin/libzip'] = 'default'
     self.dependencies['win32libs-bin/libarchive'] = 'default'
Example #5
0
 def setDependencies( self ):
     self.buildDependencies['virtual/base'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.dependencies['testing/gcrypt'] = 'default'
         self.dependencies['kdesupport/kdewin'] = 'default'
         self.dependencies['win32libs/libcurl'] = 'default'
    def __init__( self, **args ):
        self.subinfo = subinfo()
        CMakePackageBase.__init__(self)
        # jom reports missing moc_translator.xxx
        self.subinfo.options.make.supportsMultijob = False
        # add support for other location based on pythonpath
        localPythonPath = os.path.join(self.rootdir, 'emerge', 'python')
        haveLocalPython = os.path.exists(localPythonPath)

        if compiler.isMSVC2008():
            specName = "win32-msvc2008"
        elif compiler.isMSVC2010():
            specName = "win32-msvc2010"
        elif compiler.isMinGW():
            specName = "win32-g++"
        else:
            utils.die("compiler %s not supported for PyQt4" % compiler.COMPILER)
        if haveLocalPython:
           specDir = self.mergeDestinationDir()
        else:
           specDir = self.rootdir

        os.putenv("QMAKESPEC", os.path.join(specDir, "mkspecs", specName))

        if haveLocalPython:
            self.subinfo.options.merge.destinationPath = "emerge/python"
        self.subinfo.options.configure.defines = " --confirm-license --verbose"

        if self.buildType() == "Debug":
            self.subinfo.options.configure.defines += " -u"
Example #7
0
 def setDependencies(self):
     self.buildDependencies['virtual/base'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.dependencies['testing/gcrypt'] = 'default'
         self.dependencies['kdesupport/kdewin'] = 'default'
         self.dependencies['win32libs/libcurl'] = 'default'
 def install(self):
     if not CMakePackageBase.install(self):
         return False
     #to stay compatible to previous builds
     if compiler.isMinGW():
         shutil.copy(os.path.join( self.installDir() , "bin","libz.dll"),os.path.join( self.installDir() , "bin","libzlib1.dll"))
     return True
 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())
Example #10
0
    def __init__(self, **args):
        self.subinfo = subinfo()
        CMakePackageBase.__init__(self)

        self.subinfo.options.configure.defines = (
                " --build-type=minimal"
                " --build-dir=" + self.buildDir() + \
                " --prefix=" + self.imageDir() + \
                " --stagedir=" + os.path.join(self.buildDir(),"stage") + \
                " threading=multi"
                " link=shared"
                " runtime-link=shared")

        self.subinfo.options.configure.defines += " variant="
        if self.buildType() == "Debug":
            self.subinfo.options.configure.defines += "debug"
        else:
            self.subinfo.options.configure.defines += "release"
        self.subinfo.options.configure.defines += " toolset="
        if compiler.isMinGW():
            self.subinfo.options.configure.defines += "gcc"
        else:
            if compiler.isMSVC2005():
                self.subinfo.options.configure.defines += "msvc-8.0"
            elif compiler.isMSVC2008():
                self.subinfo.options.configure.defines += "msvc-9.0"
            elif compiler.isMSVC2010():
                self.subinfo.options.configure.defines += "msvc-10.0"
        if self.isHostBuild():
            self.subinfo.options.configure.defines += " --with-program_options"
        if not emergePlatform.isCrossCompilingEnabled():
            self.subinfo.options.configure.defines += " --with-python"
Example #11
0
    def setDependencies( self ):
        if not utils.envAsBool('EMERGE_ENABLE_IMPLICID_BUILDTIME_DEPENDENCIES'):
            self.buildDependencies['gnuwin32/wget']       = 'default'
            self.buildDependencies['dev-util/7zip']       = 'default'
            self.buildDependencies['gnuwin32/patch']      = 'default'
            self.buildDependencies['gnuwin32/sed']        = 'default'
            self.buildDependencies['dev-util/cmake']      = 'default'
            self.buildDependencies['dev-util/subversion'] = 'default'
            self.buildDependencies['dev-util/git']        = 'default'

        # for creating combined packages
        self.buildDependencies['dev-util/pexports']   = 'default'

        #add c++ runtime if we xcompile
        if emergePlatform.isCrossCompilingEnabled():
            self.dependencies['win32libs-bin/runtime-ce']   = 'default'

        if not utils.envAsBool('EMERGE_ENABLE_IMPLICID_BUILDTIME_DEPENDENCIES'):
            if os.getenv( "SVN_SSH" ) == "plink" or \
                    os.getenv( "GIT_SSH" ) == "plink":
                self.buildDependencies['dev-util/putty']      = 'default'

            if compiler.isMinGW():
                if compiler.isMinGW_W64():
                    self.buildDependencies['dev-util/mingw-w64']    = 'default'
                elif emergePlatform.buildArchitecture() == 'arm-wince':
                    self.buildDependencies['dev-util/cegcc-arm-wince'] = 'default'
                else:
                    if compiler.isMinGW32():
                        self.buildDependencies['dev-util/mingw4']    = 'default'
                    else:
                        self.buildDependencies['dev-util/mingw-w32']    = 'default'
            if os.getenv( "EMERGE_MAKE_PROGRAM" ) != "":
                self.buildDependencies['dev-util/jom']        = 'default'
Example #12
0
  def setTargets( self ):
    self.vlcArch = "32"
    if( emergePlatform.buildArchitecture() == 'x64' ):
        self.vlcArch = "64"
    self.vlcBaseUrl = 'http://nightlies.videolan.org/build/win'+self.vlcArch+'/last/'
    self.vlcTagName = '1.2.0-git-'

    self.targets[ self.vlcTagName + self.getVer() ]  =  self.vlcBaseUrl + 'vlc-' + self.vlcTagName + self.getVer() + "-win32.7z"
    self.targetInstSrc[ self.vlcTagName + self.getVer() ] = 'vlc-' + self.vlcTagName + self.getVer()

    self.targets[ self.vlcTagName + self.getVer() +"-debug" ]  = self.vlcBaseUrl +  'vlc-' + self.vlcTagName + self.getVer() + "-win32-debug.7z"
    self.targetInstSrc[ self.vlcTagName + self.getVer() + "-debug" ] = 'vlc-' + self.vlcTagName +  self.getVer()

    releaseTag = '1.1.10'
    self.targets[ releaseTag ] = "http://downloads.sourceforge.net/sourceforge/vlc/vlc-"+releaseTag+"-win32.7z"
    self.targetInstSrc[ releaseTag ] = 'vlc-' + releaseTag
    self.targetDigests['1.1.10'] = '981ee49d3b3559606472370f6971cdf3b0e7163f'
    self.shortDescription = "an open-source multimedia framework"
    
    
    if emergePlatform.buildArchitecture() == 'x64':
        self.defaultTarget = self.vlcTagName + self.getVer()
    elif os.getenv("EMERGE_BUILDTYPE") == "Debug" and compiler.isMinGW():
        self.defaultTarget = self.vlcTagName + self.getVer() + "-debug"
    else:
        self.defaultTarget = releaseTag
Example #13
0
 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())
Example #14
0
    def setDependencies(self):
        if not emergeSettings.getboolean(
                "General", 'EMERGE_ENABLE_IMPLICID_BUILDTIME_DEPENDENCIES',
                False):
            self.buildDependencies['gnuwin32/wget'] = 'default'
            self.buildDependencies['dev-util/7zip'] = 'default'
            self.buildDependencies['gnuwin32/patch'] = 'default'
            self.buildDependencies['gnuwin32/sed'] = 'default'
            self.buildDependencies['dev-util/cmake'] = 'default'
            self.buildDependencies['dev-util/subversion'] = 'default'
            self.buildDependencies['dev-util/git'] = 'default'

        if not emergeSettings.getboolean(
                "General", 'EMERGE_ENABLE_IMPLICID_BUILDTIME_DEPENDENCIES',
                False):
            self.buildDependencies['dev-util/putty'] = 'default'

            if compiler.isMinGW():
                self.buildDependencies['dev-util/mingw-w64'] = 'default'
            if emergeSettings.get("Compile", "MakeProgram", "") == "jom":
                self.buildDependencies['dev-util/jom'] = 'default'
            if emergeSettings.getboolean("Compile", "UseNinja", False):
                self.buildDependencies['dev-util/ninja'] = 'default'
            if emergeSettings.getboolean("Compile", "UseCCache", False):
                self.buildDependencies['dev-util/ccache'] = 'default'
    def setDependencies( self ):
        EmergeDebug.debug("emergebuildsystem:subinfo.setDependencies not implemented yet", 1)
        # we need at least qmake
        #self.dependencies['libs/qt'] = 'default'
        self.buildDependencies['dev-util/jom'] = 'default'

        if compiler.isMinGW():
            self.buildDependencies['dev-util/mingw-w64']    = 'default'
Example #16
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 install( self ):
     if not CMakePackageBase.install( self ):
         return False
     if compiler.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 )
     return True
 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 setDependencies( self ):
         self.buildDependencies['virtual/base'] = 'default'
         self.buildDependencies['dev-util/perl'] = 'default'
         if emergePlatform.isCrossCompilingEnabled():
             self.dependencies['win32libs-sources/wcecompat-src'] = 'default'
         if compiler.isMinGW():
             self.buildDependencies['dev-util/msys'] = 'default'
             self.dependencies['win32libs-bin/zlib'] = 'default'
Example #20
0
 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'
Example #21
0
 def setDependencies( self ):
     self.buildDependencies['virtual/base'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.buildDependencies['dev-util/yasm'] = 'default'
     self.dependencies['win32libs/libvorbis'] = 'default'
     self.dependencies['win32libs/liblame'] = 'default'
     self.dependencies['win32libs/libopus'] = 'default'
Example #22
0
 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
Example #23
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'
Example #24
0
    def unpack(self):
        destdir = os.path.join(self.sourceDir(), "bin")
        utils.createDir(self.sourceDir())
        utils.createDir(destdir)

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

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

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

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

        return True
Example #25
0
 def setDependencies( self ):
     self.dependencies['kde/kde-runtime'] = 'default'
     self.dependencies['kde/kdepimlibs'] = 'default'
     self.dependencies['kdesupport/qca'] = 'default'
     self.dependencies['win32libs-bin/libidn'] = 'default'
     self.dependencies['win32libs-bin/libmsn'] = 'default'
     #mingw already contains libgmp
     if not compiler.isMinGW():
         self.dependencies['win32libs-bin/libgmp'] = 'default'
Example #26
0
    def __init__( self ):
        CMakePackageBase.__init__( self )
          # required for package generating because we build from svnHEAD by default
#        self.subinfo.options.package.version = '0.5.4'
        self.subinfo.options.configure.defines = '-DBUILD_BASE_LIB_WITH_QT=ON -DBUILD_QT_LIB=ON '
        self.subinfo.options.configure.defines += ' -DBUILD_TOOLS=ON '
        if compiler.isMinGW_W32():
          self.subinfo.options.configure.defines += ' -DMINGW_W32=ON '
        if compiler.isMinGW():
            self.subinfo.options.configure.defines += ' -DKDEWIN_DEFINITIONS="-DKDEWIN_NO_LOCALTIME_R -DKDEWIN_NO_GMTIME_R" '
Example #27
0
 def __init__(self):
     CMakePackageBase.__init__(self)
     # required for package generating because we build from svnHEAD by default
     #        self.subinfo.options.package.version = '0.5.4'
     self.subinfo.options.configure.defines = '-DBUILD_BASE_LIB_WITH_QT=ON -DBUILD_QT_LIB=ON -DBUILD_PNG2ICO=OFF '
     self.subinfo.options.configure.defines += ' -DBUILD_TOOLS=ON '
     if compiler.isMinGW_W32():
         self.subinfo.options.configure.defines += ' -DMINGW_W32=ON '
     if compiler.isMinGW():
         self.subinfo.options.configure.defines += ' -DKDEWIN_DEFINITIONS="-DKDEWIN_NO_LOCALTIME_R -DKDEWIN_NO_GMTIME_R" '
Example #28
0
 def setDependencies( self ):
     self.buildDependencies['virtual/base'] = 'default'
     self.dependencies['win32libs/zlib'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.dependencies['win32libs/lcms'] = 'default'
         self.dependencies['win32libs/lcms2'] = 'default'
         self.dependencies['win32libs/freetype'] = 'default'
         self.dependencies['win32libs/jpeg'] = 'default'
         self.dependencies['win32libs/libpng'] = 'default'
         self.dependencies['win32libs/tiff'] = 'default'
Example #29
0
    def unpack( self ):
        destdir = os.path.join( self.sourceDir(), "bin" )
        utils.createDir( self.sourceDir() )
        utils.createDir( destdir )

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

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

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

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

        return True
Example #30
0
 def setDependencies(self):
     self.buildDependencies["virtual/base"] = "default"
     self.dependencies["win32libs/zlib"] = "default"
     if compiler.isMinGW():
         self.buildDependencies["dev-util/msys"] = "default"
         self.dependencies["win32libs/lcms"] = "default"
         self.dependencies["win32libs/lcms2"] = "default"
         self.dependencies["win32libs/freetype"] = "default"
         self.dependencies["win32libs/jpeg"] = "default"
         self.dependencies["win32libs/libpng"] = "default"
         self.dependencies["win32libs/tiff"] = "default"
Example #31
0
 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())
Example #32
0
    def install( self ):
        self.enterSourceDir()
        cmd = self.makeProgramm + " install"
        os.system(cmd) and EmergeDebug.die("command: %s failed" % cmd)
        
        # fix problem with not copying manifest file
        if not compiler.isMinGW():
            utils.copyFile( os.path.join( self.sourceDir(), "sipgen", "sip.exe.manifest" ),
                            sys.exec_prefix )

        return True
Example #33
0
 def setDependencies(self):
     self.buildDependencies['virtual/base'] = 'default'
     self.dependencies['win32libs/zlib'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
         self.dependencies['win32libs/lcms'] = 'default'
         self.dependencies['win32libs/lcms2'] = 'default'
         self.dependencies['win32libs/freetype'] = 'default'
         self.dependencies['win32libs/jpeg'] = 'default'
         self.dependencies['win32libs/libpng'] = 'default'
         self.dependencies['win32libs/tiff'] = 'default'
Example #34
0
 def __init__(self, typeName=""):
     """constructor"""
     EmergeBase.__init__(self)
     self.supportsNinja = False        
     self.supportsCCACHE = utils.envAsBool("EMERGE_USE_CCACHE") and compiler.isMinGW();
     self.buildSystemType = typeName
     self.envPath = ""
     if self.compiler() == "mingw":
         self.envPath = "mingw/bin"
     if self.compiler() == "mingw4":
         self.envPath = "mingw4/bin"
 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() )
Example #36
0
 def setTargets( self ):
     self.svnTargets['svnHEAD'] = 'http://source.icu-project.org/repos/icu/icu/trunk'
     self.targetInstSrc['svnHEAD'] = "source"
     for ver in ['53.1', '55.1']:
         self.targets[ver] = 'http://download.icu-project.org/files/icu4c/%s/icu4c-%s-src.tgz' % ( ver, ver.replace(".", "_"))
         self.targetInstSrc[ver] = "icu\\source"
     self.targetDigests['53.1'] = '7eca017fdd101e676d425caaf28ef862d3655e0f'
     self.targetDigests['55.1'] = '3bb301c11be0e239c653e8aa2925c53f6f4dc88d'
     self.defaultTarget = '53.1'
     if compiler.isMSVC2015() or compiler.isMinGW():
         self.patchToApply['55.1'] = ("icu-20150414.diff", 2)
         self.defaultTarget = '55.1'
    def printEnv( self ):
        self.env = self.getEnv( )
        self.version = int(emergeSettings.get("Version", "EMERGE_SETTINGS_VERSION"))

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

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

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

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

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

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

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

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

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

        for var, value in emergeSettings.getSection( "Environment" ):  #set and overide existing values
            self.addEnvVar( var, value )
        for key, val in self.env.items( ):
            print( "%s=%s" % (key, val) )
    def unpack( self ):
        destdir = os.path.join( self.installDir(), "bin" )
        utils.createDir( self.workDir() )
        utils.createDir( destdir )

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

        files = []
        if compiler.isMinGW():
            if compiler.isMinGW32():
                srcdir = os.path.join( self.rootdir, "mingw", "bin" )
                files = [ 'mingwm10.dll', 'libgcc_s_dw2-1.dll' ]
            elif compiler.isMinGW_W32():
                srcdir = os.path.join( self.rootdir, "mingw", "bin" )
                files = [ 'libgcc_s_sjlj-1.dll', 'libgomp-1.dll' ]
            elif compiler.isMinGW_W64():
                srcdir = os.path.join( self.rootdir, "mingw64", "bin" )
                files = [ 'libgcc_s_sjlj-1.dll', 'libgomp-1.dll' ]
#        elif compiler.isMSVC2008():
#            if self.buildType() == "Debug":
#                srcdir = os.path.join( self.packageDir(), "redist", "Debug_NonRedist", "x86", "Microsoft.VC90.DebugCRT" )
#                files = [ "Microsoft.VC90.DebugCRT.manifest", "msvcr90d.dll", "msvcp90d.dll", "msvcm90d.dll"]
#            else:
#                srcdir = os.path.join( self.packageDir(), "redist", "x86", "Microsoft.VC90.CRT" )
#                files = [ "Microsoft.VC90.CRT.manifest", "msvcr90.dll", "msvcp90.dll", "msvcm90.dll" ]
        elif compiler.isMSVC2010():
            srcdir = os.path.join( os.environ["windir"], "system32" ) 
            files = [ "msvcr100%s.dll" % postfix, "msvcp100%s.dll" % postfix ]

        for file in files:
            utils.copyFile( os.path.join( srcdir, file ), os.path.join( destdir, file ) )

        # extract pthread package.
        if compiler.isMinGW_WXX():
            tmpdir = os.getenv( "TEMP" )

            if compiler.isMinGW_W32(): _ext = 32
            elif compiler.isMinGW_W64(): _ext = 64
            else: utils.die( "unknown flavor of mingw-wXX" )

            pthreadPackageName = os.path.join( self.rootdir, "mingw", "pthreads-w%s.zip" ) % _ext
            pthreadDll = "pthreadGC2-w%s.dll" % _ext

            utils.unZip( pthreadPackageName, tmpdir )

            srcdir = os.path.join( tmpdir, "bin" )
            files = [ pthreadDll ]
            for file in files:
                utils.copyFile( os.path.join( srcdir, file ), os.path.join( destdir, file ) )
        return True
Example #39
0
 def setTargets( self ):
     for ver in ['9.18']:
         self.targets[ ver ] = "http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-%s.tar.gz" % ver
         self.targetInstSrc[ ver ] = "ghostscript-" + ver
     if compiler.isMinGW():
         self.patchToApply['9.18'] = [
             #("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
                                      ("ghostscript-9.18-20151217.diff", 1),
                                      ("libspectre.patch", 1)# origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript
                                      ]
     self.targetDigests['9.18'] = '761c9c25b9f5fe01197bd1510f527b3c1b6eb9de'
     self.defaultTarget = '9.18'
 def __init__(self, typeName=""):
     """constructor"""
     EmergeBase.__init__(self)
     self.supportsNinja = False
     self.supportsCCACHE = emergeSettings.getboolean(
         "Compile", "UseCCache", False) and compiler.isMinGW()
     self.supportsClang = emergeSettings.getboolean("Compile", "UseClang",
                                                    False)
     self.buildSystemType = typeName
     self.envPath = ""
     if self.compiler() == "mingw":
         self.envPath = "mingw/bin"
     if self.compiler() == "mingw4":
         self.envPath = "mingw4/bin"
Example #41
0
 def setTargets(self):
     self.svnTargets[
         'svnHEAD'] = 'http://source.icu-project.org/repos/icu/icu/trunk'
     self.targetInstSrc['svnHEAD'] = "source"
     for ver in ['53.1', '55.1']:
         self.targets[
             ver] = 'http://download.icu-project.org/files/icu4c/%s/icu4c-%s-src.tgz' % (
                 ver, ver.replace(".", "_"))
         self.targetInstSrc[ver] = "icu\\source"
     self.targetDigests['53.1'] = '7eca017fdd101e676d425caaf28ef862d3655e0f'
     self.targetDigests['55.1'] = '3bb301c11be0e239c653e8aa2925c53f6f4dc88d'
     self.defaultTarget = '53.1'
     if compiler.isMSVC2015() or compiler.isMinGW():
         self.patchToApply['55.1'] = ("icu-20150414.diff", 2)
         self.defaultTarget = '55.1'
 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())
Example #43
0
 def __init__( self, **args ):
     CMakePackageBase.__init__(self)
     
     self.subinfo.options.configure.defines = ""
     if self.buildType == "Debug":
         self.subinfo.options.configure.defines = " -u"
         
     if compiler.isMSVC2008():
         self.subinfo.options.configure.defines += " -p win32-msvc2008"
     elif compiler.isMSVC2010():
         self.subinfo.options.configure.defines += " -p win32-msvc2010"
     elif compiler.isMinGW():
         self.subinfo.options.configure.defines += " -p win32-g++"
     
     self.subinfo.options.configure.defines += " CFLAGS=-I" +self.packageDir()
     self.subinfo.options.configure.defines += " CXXFLAGS=-I" +self.packageDir()
Example #44
0
 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 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)
Example #46
0
    def setTargets(self):
        for ver in ['9.19']:

            self.targets[
                ver] = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/ghostscript-%s.tar.gz" % (
                    ver.replace(".", ""), ver)
            self.targetInstSrc[ver] = 'ghostscript-%s' % ver
            self.targetDigestUrls[ver] = ([
                "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%s/SHA1SUMS"
                % ver.replace(".", "")
            ], EmergeHash.HashAlgorithm.SHA1)

        if compiler.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
                ("ghostscript-9.18-20151217.diff", 1),
                (
                    "libspectre.patch", 1
                )  # origin: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-ghostscript
            ]
        self.defaultTarget = '9.19'
Example #47
0
    def getEnv(self):
        out = dict()
        if compiler.isMSVC():
            compilerDirs = {
                "msvc2010": "VS100COMNTOOLS",
                "msvc2012": "VS110COMNTOOLS",
                "msvc2013": "VS120COMNTOOLS",
                "msvc2015": "VS140COMNTOOLS"
            }
            architectures = {
                "x86": "x86",
                "x64": "amd64",
                "x64_cross": "x86_amd64"
            }
            crossmodifier = ""
            if not compiler.isNative(): crossmodifier = "_cross"
            status, result = subprocess.getstatusoutput(
                "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" %
                (os.getenv(compilerDirs[compiler.getCompilerName()]),
                 architectures[compiler.architecture() + crossmodifier]))
            if status != 0:
                print("Failed to setup msvc compiler", file=sys.stderr)
                exit(1)
            out = self.stringToEnv(result)

        elif compiler.isIntel():
            architectures = {"x86": "ia32", "x64": "intel64"}
            programFiles = os.getenv("ProgramFiles(x86)") or os.getenv(
                "ProgramFiles")
            status, result = subprocess.getstatusoutput(
                "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set"
                % (programFiles, architectures[compiler.architecture()]))
            if status != 0:
                print("Failed to setup intel compiler", file=sys.stderr)
                exit(1)
            out = self.stringToEnv(result)
        elif compiler.isMinGW():
            out = {"Path": os.getenv("Path")}
        return out
Example #48
0
 def install(self):
     utils.copyDir(self.sourceDir(), os.path.join(self.imageDir(), "bin"))
     if compiler.isMinGW():
         utils.deleteFile(
             os.path.join(self.imageDir(), "bin", "libgcc_s_seh-1.dll"))
     shutil.move(os.path.join(self.imageDir(), "bin", "sdk", "include"),
                 os.path.join(self.imageDir(), "include"))
     shutil.move(os.path.join(self.imageDir(), "bin", "sdk", "lib"),
                 os.path.join(self.imageDir(), "lib"))
     ver2 = self.subinfo.buildTarget.split('.')
     if not (int(ver2[0]) >= 2 and int(ver2[0]) >= 1):
         utils.copyFile(
             os.path.join(self.imageDir(), "lib", "libvlc.dll.a"),
             os.path.join(self.imageDir(), "lib", "libvlc.lib"))
         utils.copyFile(
             os.path.join(self.imageDir(), "lib", "libvlccore.dll.a"),
             os.path.join(self.imageDir(), "lib", "libvlccore.lib"))
     shutil.rmtree(os.path.join(self.imageDir(), "bin", "sdk"))
     os.makedirs(os.path.join(self.imageDir(), "share", "applications"))
     utils.copyFile(
         os.path.join(self.packageDir(), "vlc.desktop"),
         os.path.join(self.imageDir(), "share", "applications",
                      "vlc.desktop"))
     return True
Example #49
0
 def __init__(self):
     BinaryPackageBase.__init__(self)
     if compiler.isMinGW():
         self.subinfo.options.package.version = compiler.getMinGWVersion()
Example #50
0
                       os.path.join(self.imageDir(), "lib", "libgs.dll.a"))
        utils.copyFile(
            os.path.join(self.sourceDir(), "psi", "iapi.h"),
            os.path.join(self.imageDir(), "include", "ghostscript", "iapi.h"),
            False)
        utils.copyFile(
            os.path.join(self.sourceDir(), "psi", "ierrors.h"),
            os.path.join(self.imageDir(), "include", "ghostscript",
                         "ierrors.h"), False)
        utils.copyFile(
            os.path.join(self.sourceDir(), "devices", "gdevdsp.h"),
            os.path.join(self.imageDir(), "include", "ghostscript",
                         "gdevdsp.h"), False)
        utils.copyFile(
            os.path.join(self.sourceDir(), "base", "gserrors.h"),
            os.path.join(self.imageDir(), "include", "ghostscript",
                         "gserrors.h"), False)
        utils.copyDir(os.path.join(self.sourceDir(), "lib"),
                      os.path.join(self.imageDir(), "lib"), False)
        return True


if compiler.isMinGW():

    class Package(PackageMSys):
        pass
else:

    class Package(PackageMSVC):
        pass
Example #51
0
 def setDependencies(self):
     self.buildDependencies['virtual/base'] = 'default'
     if compiler.isMinGW():
         self.buildDependencies['dev-util/msys'] = 'default'
    def createPackage(self):
        """packaging according to the gnuwin32 packaging rules.
        This requires the kdewin-packager"""

        if not self.packagerExe:
            EmergeDebug.die("could not find kdewin-packager in your path!")

        if self.subinfo.options.package.packageName != None:
            pkgName = self.subinfo.options.package.packageName
        else:
            pkgName = self.package

        if pkgName.endswith('-src') or pkgName.endswith('-pkg'):
            pkgName = pkgName[:-4]

        pkgVersion, pkgNotesVersion = self.getPackageVersion()

        # kdewin packager creates his own manifest files, so there is no need to add
        # if self.subinfo.options.package.withDigests:
        #    utils.createManifestFiles(filesDir, filesDir, "", self.package, pkgVersion)

        # FIXME: add a test for the installer later
        dstpath = self.packageDestinationDir()

        if (self.subinfo.options.package.packSources) and os.path.exists(
                self.sourceDir()):
            srcCmd = " -srcroot " + self.sourceDir()
        else:
            if not os.path.exists(self.sourceDir()):
                EmergeDebug.warning(
                    "The source directory %s doesn't exist and can't be used for packaging."
                    % self.sourceDir())
            srcCmd = ""

        # copy pdb/sym files to a temporary directory, because they can be scattered all over the build directory
        # plus, different build types copy files to different directories (could be buildDir(), buildDir()/bin, buildDir()/bin/Debug...),
        # so let's copy them to one precise location, package them, then delete that directory

        symCmd = ""
        if self.useDebugPackages:
            # directories to ignore: cmake temporary files, and dbg so it won't try to copy a file to itself
            dirsToIgnore = [
                'cmake', 'CMakeFiles', 'CMakeTmp', 'CMakeTmp2', 'CMakeTmp3',
                'dbg'
            ]
            path = self.buildDir()
            # where to copy the debugging information files
            symRoot = os.path.join(self.buildDir(), "dbg")
            symPath = os.path.join(symRoot, "bin")
            if not os.path.exists(symPath):
                utils.createDir(symPath)
            # shouldn't be needed, usually; but if files are present, that could lead to errors
            utils.cleanDirectory(symRoot)

            EmergeDebug.debug("Copying debugging files to 'dbg'...")
            for path, _, files in os.walk(path):
                found = 0
                for directory in range(0, len(dirsToIgnore)):
                    if path.find(dirsToIgnore[directory]) > 0:
                        found = 1
                        break
                if found == 1:
                    continue
                EmergeDebug.debug("Checking: %s" % path, 3)
                for fileName in files:
                    if (fileName.endswith(".pdb")):
                        utils.copyFile(os.path.join(path, fileName),
                                       os.path.join(symPath, fileName))
                    elif not self.subinfo.options.package.disableStriping:
                        if (fileName.endswith(".exe")
                                or fileName.endswith(".dll")
                                or fileName.endswith(".obf")):
                            if compiler.isMinGW():
                                symFilename = fileName[:-4] + ".sym"
                                utils.system( "strip --only-keep-debug " + " -o " + os.path.join( path, symFilename ) \
                                        + " " + os.path.join( path, fileName ) )
                                # utils.system( "strip --strip-all " + os.path.join( path, fileName ) )
                                utils.copyFile(
                                    os.path.join(path, symFilename),
                                    os.path.join(symPath, symFilename))

            if not self.subinfo.options.package.disableStriping and compiler.isMinGW(
            ):
                symCmd += "-strip "
            symCmd += "-debug-package "
            symCmd += "-symroot " + symRoot
            EmergeDebug.debug(symCmd, 2)

        cmd = "-name %s -root %s -version %s -destdir %s %s %s -checksum sha1 " % \
                  ( pkgName, self.imageDir(), pkgVersion, dstpath, srcCmd, symCmd )
        xmltemplate = self.xmlTemplate()
        if os.path.exists(xmltemplate):
            cmd = self.packagerExe + " " + cmd + " -template " + xmltemplate + " -notes " + \
                    "%s/%s:%s:unknown " % ( self.category, self.package, pkgNotesVersion ) + "-compression 2 "
            EmergeDebug.debug("using xml template for package generating", 1)
        elif self.package == "qt":
            cmd = self.packagerExe + " " + cmd + " -template :/template-qt.xml -notes " + \
                    "%s/%s:%s:unknown " % ( self.category, self.package, pkgNotesVersion ) + "-compression 2 "
            EmergeDebug.debug("using xml template for package generating", 1)
        else:
            cmd = self.packagerExe + " " + cmd + " -verbose -notes " + \
                    "%s/%s:%s:unknown " % ( self.category, self.package, pkgNotesVersion ) + "-compression 2 "
            EmergeDebug.debug(
                " xml template %s for package generating not found" %
                xmltemplate, 1)

        if (self.subinfo.options.package.withCompiler):
            cmd += " -type "
            if compiler.isMinGW():
                if self.buildArchitecture() == "x64":
                    cmd += "x64-"
                else:
                    cmd += "x86-"
            cmd += compiler.getShortName()

#        not needed anymore
#        if self.subinfo.options.package.specialMode:
#            cmd += " -special"

        if not utils.system(cmd):
            EmergeDebug.die("while packaging. cmd: %s" % cmd)

        if self.useDebugPackages:
            utils.rmtree(symPath)
        return True
Example #53
0
 def setDependencies(self):
     if compiler.isMinGW():
         self.dependencies['dev-util/uactools'] = 'default'
     self.buildDependencies['virtual/bin-base'] = 'default'
Example #54
0
    def printEnv(self):
        self.env = self.getEnv()
        self.version = int(
            emergeSettings.get("Version", "EMERGE_SETTINGS_VERSION"))

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

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

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

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

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

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

        if emergeSettings.getboolean("QtSDK", "Enabled", "false"):
            self.prependPath(
                "Path",
                os.path.join(emergeSettings.get("QtSDK", "Path"),
                             emergeSettings.get("QtSDK", "Version"),
                             emergeSettings.get("QtSDK", "Compiler"), "bin"))

        if compiler.isMinGW():
            if not emergeSettings.getboolean("QtSDK", "Enabled", "false"):
                if compiler.isX86():
                    self.prependPath(
                        "Path",
                        os.path.join(EmergeStandardDirs.emergeRoot(), "mingw",
                                     "bin"))
                else:
                    self.prependPath(
                        "Path",
                        os.path.join(EmergeStandardDirs.emergeRoot(),
                                     "mingw64", "bin"))
            else:
                self.prependPath(
                    "Path",
                    os.path.join(emergeSettings.get("QtSDK", "Path"), "Tools",
                                 emergeSettings.get("QtSDK", "Compiler"),
                                 "bin"))

        if self.args.mode == "bat":  #don't put emerge.bat in path when using powershell
            self.prependPath(
                "Path",
                os.path.join(EmergeStandardDirs.emergeRoot(), "emerge", "bin"))
        self.prependPath(
            "Path",
            os.path.join(EmergeStandardDirs.emergeRoot(), "dev-utils", "bin"))

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

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

        for var, value in emergeSettings.getSection(
                "Environment"):  #set and overide existing values
            self.addEnvVar(var, value)
        for key, val in self.env.items():
            print("%s=%s" % (key, val))
Example #55
0
 def __init__(self, **args):
     QMakePackageBase.__init__(self)
     self.subinfo.options.configure.defines = ' "QWT_INSTALL_PREFIX = %s" ' % self.imageDir(
     ).replace("\\", "/")
     if compiler.isMinGW():
         self.subinfo.options.make.supportsMultijob = False