def doDistribution(workingDir, log, outputDir, buildVersion, buildVersionEscaped): log.write(separator) log.write("[tbox] Creating distribution files\n") for (module, target, distSource, fileGlob) in reposDist: moduleDir = os.path.join(workingDir, module) print "Distribution [%s]" % module try: os.chdir(moduleDir) outputList = hardhatutil.executeCommandReturnOutput([antProgram, target]) hardhatutil.dumpOutputList(outputList, log) sourceDir = os.path.join(moduleDir, distSource) targetDir = os.path.join(outputDir, buildVersion) if not os.path.exists(targetDir): os.mkdir(targetDir) print sourceDir, targetDir log.write("[tbox] Moving %s to %s\n" % (sourceDir, targetDir)) hardhatlib.copyFiles(sourceDir, targetDir, fileGlob) except Exception, e: doCopyLog("***Error during distribution building process*** ", workingDir, logPath, log) raise e
def doDistribution(workingDir, log, outputDir, buildVersion, buildVersionEscaped): log.write(separator) log.write("[tbox] Creating distribution files\n") for (module, target, distSource, fileGlob) in reposDist: moduleDir = os.path.join(workingDir, module) print "Distribution [%s]" % module try: os.chdir(moduleDir) outputList = hardhatutil.executeCommandReturnOutput( [antProgram, target]) hardhatutil.dumpOutputList(outputList, log) sourceDir = os.path.join(moduleDir, distSource) targetDir = os.path.join(outputDir, buildVersion) if not os.path.exists(targetDir): os.mkdir(targetDir) print sourceDir, targetDir log.write("[tbox] Moving %s to %s\n" % (sourceDir, targetDir)) hardhatlib.copyFiles(sourceDir, targetDir, fileGlob) except Exception, e: doCopyLog("***Error during distribution building process*** ", workingDir, logPath, log) raise e
def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir) else: hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory doesn't exist; creating: " + \ buildDir) os.mkdir(buildDir) os.chdir(buildDir) # Prepare the wxWidgets command line buildOptions = [ buildenv['sh'], '../configure', '--prefix=%s' % os.path.join(buildenv['root'],version), '--disable-monolithic', '--enable-geometry', '--enable-sound', '--with-sdl', '--enable-display', ] if version == "debug": buildOptions.append("--enable-debug") else: buildOptions.append("--enable-optimized") if buildenv['os'] == "osx": buildOptions.append("--with-mac") buildOptions.append("--with-opengl") if buildenv['os'] == "posix": buildOptions.append("--with-gtk") buildOptions.append("--enable-gtk2") buildOptions.append("--enable-unicode") # Configure if os.access('Makefile', os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Already configured") else: hardhatlib.executeCommand(buildenv, info['name'], buildOptions, "Configuring wxWindows %s" % version) # Make hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make']], "Making wxWindows") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/gizmos'], "Making gizmos") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/ogl', 'CXXFLAGS="-DwxUSE_DEPRECATED=0"', ], "Making ogl") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/stc'], "Making stc") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/xrc'], "Making xrc") # Install hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], 'install'], "Installing wxWindows") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/gizmos', 'install'], "Installing gizmos") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/ogl', 'install'], "Installing ogl") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/stc', 'install'], "Installing stc") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/xrc', 'install'], "Installing xrc") # wxPython if version == "debug": python = buildenv['python_d'] else: python = buildenv['python'] os.chdir("../wxPython") buildOptions = [ python, 'setup.py', 'FINAL=1', 'BUILD_OGL=0', 'BUILD_GLCANVAS=0', 'BUILD_BASE=build_%s' % version, 'WX_CONFIG='+buildenv['root']+'/%s/bin/wx-config' % version, ] if buildenv['os'] == "posix": buildOptions.append("WXPORT=gtk2") buildOptions.append("UNICODE=1") buildOptions.append("build") if version == "debug": buildOptions.append("--debug") buildOptions.append("install") hardhatlib.executeCommand(buildenv, info['name'], buildOptions, "Building and Installing wxPython") # Windows if buildenv['os'] == 'win': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['compiler'], "build/msw/msw.sln", "/build", version.capitalize(), "/out", "output.txt"], "Building %s %s" % (info['name'], version), 0, "output.txt") os.putenv('WXWIN', buildenv['root_dos'] + "\\..\\..\\internal\\wxPython-2.5") if version == 'release': destination = os.path.join (buildenv['pythonlibdir'], 'site-packages', 'wx') hardhatlib.copyFiles('lib/vc_dll', destination, ['*251_*.dll']) os.chdir("wxPython") hardhatlib.executeCommand (buildenv, info['name'], [buildenv['python'], 'setup.py', 'FINAL=1', 'BUILD_BASE=build_release', 'build', 'install'], "Building wxPython") # _*.pyd also copies _*_d.pyd, which is unnecessary, however, the # files that should have been created are _*.pyc, so when we fix that # we should change '_*.pyd' to '_*.pyc' in the following line hardhatlib.copyFiles('wx', destination, ['_*.pyd']) elif version == 'debug': destination = os.path.join (buildenv['pythonlibdir_d'], 'site-packages', 'wx') hardhatlib.copyFiles('lib/vc_dll', destination, ['*251d_*.dll']) os.chdir("wxPython") hardhatlib.executeCommand (buildenv, info['name'], [buildenv['python_d'], 'setup.py', 'FINAL=1', 'BUILD_BASE=build_debug', 'build', '--debug', 'install'], "Building wxPython") hardhatlib.copyFiles('wx', destination, ['_*_d.pyd'])