def run_checks (): # Python version check. if helpers.getversion () < PYTHON_MINIMUM: # major, minor check raise Exception ("You should have at least Python >= %d.%d.x " "installed." % PYTHON_MINIMUM) buildsystem = None builddefines = [] defcompiler = '' if sys.platform == "win32": if msys.is_msys (): buildsystem = "msys" builddefines.append (("IS_MSYS", None)) defcompiler = "mingw32" else: buildsystem = "win" builddefines.append (("IS_WIN32", None)) builddefines.append (("WIN32", None)) defcompiler = "msvc" elif sys.platform == "darwin": buildsystem = "darwin" builddefines.append (("IS_DARWIN", None)) defcompiler = "unix" else: buildsystem = "unix" defcompiler = "unix" builddefines.append (("IS_UNIX", None)) if cfg.build['SDL']: sdlversion = config_modules.sdl_get_version (buildsystem) compiler = get_compiler (sys.argv) or defcompiler print ("\nThe following information will be used to build Pygame:") print ("\t System: %s" % buildsystem) print ("\t Python: %d.%d.%d" % helpers.getversion ()) print ("\t Compiler: %s" % compiler) if cfg.build['SDL']: print ("\t SDL: %s" % sdlversion) return buildsystem, builddefines, compiler
def run_command (cmd): try: retcode, output = 0, None if msys.is_msys(): retcode, output = msys_obj.run_shell_command (cmd) else: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = p.communicate()[0] retcode = p.returncode if helpers.getversion()[0] >= 3: output = str (output, "utf-8") return retcode, output except OSError: return -1, None
def find_msys_registry(): """Return the MSYS 1.0 directory path stored in the Windows registry The return value is an encoded ascii str. The registry entry for the uninstaller is used. Raise a LookupError if not found. """ key = None subkey = ( 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1') if is64bit (): subkey = ('Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1') try: key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey) try: output = _winreg.QueryValueEx(key, 'Inno Setup: App Path')[0].encode() if helpers.getversion()[0] >= 3: output = str (output, "utf-8") return output except WindowsError: raise LookupError("MSYS not found in the registry") finally: if key: key.Close()
Module ("openal.base", sources = [ "src/openal/openalmod.c", "src/openal/buffers.c", "src/openal/sources.c", "src/openal/listener.c", "src/openal/context.c", "src/openal/capturedevice.c", "src/openal/device.c" ], instheaders = [ "src/openal/pgopenal.h" ], docfile = "openalbase.xml", depends = [ 'openal' ], experimental = True), ] if helpers.getversion() < (3, 0, 0): modules.append( Module ("sdlmixer.numericsndarray", sources = [ "src/sdlmixer/numericsndarraymod.c" ], docfile = "sdlmixernumericsndarray.xml", depends = ['SDL', 'SDL_mixer'])) modules.append( Module ("sdlext.numericsurfarray", sources = [ "src/sdlext/numericsurfarraymod.c" ], docfile = "sdlextnumericsurfarray.xml", depends = ['SDL'])) def get_extensions (buildsystem, compiler): extensions = []
exports msys_raw_input, MsysException, Msys """ #from config.helpers import * from config.msysio import raw_input_ as msys_raw_input, print_ as msys_print from config.msysio import is_msys from config import helpers import os import time import subprocess import re import glob import platform try: if helpers.getversion()[0] >= 3: import winreg as _winreg else: import _winreg except: _winreg = None FSTAB_REGEX = (r'^[ \t]*(?P<path>' r'([a-zA-Z]:){0,1}([\\/][^\s*^?:%\\/]+)+)' r'[ \t]+/mingw(\s|$)' ) def has_drive(path): """Return true if the MSYS path strats with a drive letter""" return re.match('/[A-Z]/', path, re.I) is not None