def build_sdl2(directory): print "Building 32-bit SDL2 locally, this is only needed once and only on 64-bit Linux" print "A log of the build can be found in %s" % os.path.abspath(os.path.join(directory, "..", "sdl2build.log")) oldcwd = os.getcwd() for f in ["CFLAGS", "CXXFLAGS", "LDFLAGS"]: locals()["old" + f] = os.getenv(f, None) os.environ[f] = "-m32" try: os.chdir(directory) prefix = os.path.abspath(cp.get("Linux", "SDL32bit")) retval = os.system("./configure --prefix=%s --build=i686-pc-linux-gnu >../sdl2build.log 2>&1" % prefix) retval |= os.system("make >> ../sdl2build.log 2>&1") retval |= os.system("make install >> ../sdl2build.log 2>&1") if retval != 0: print "\nThere was an error building 32-bit SDL2. RSqueak will not work without! See the .build/sdl2build.log file for more info." print "You might be able to just install 32-bit packages or install it manually." print "If so, just set the SDL32bit variable in the buildconfig.ini to point to the right place, or remove it, if SDL is installed globally" finally: for f in ["CFLAGS", "CXXFLAGS", "LDFLAGS"]: if locals()["old" + f]: os.environ[f] = locals()["old" + f] os.chdir(oldcwd)
def path_from_name(self, name): if "/" not in name: return cp.get("General", name) else: return cp.get(*name.split("/"))
elif filename.endswith(".gz"): import tarfile, shutil with tarfile.open(filename) as tar: tar.extractall() topdir = tar.getnames()[0] print topdir shutil.move(topdir, targetdir) else: raise AssertionError("Unsupported Archive %s" % filename) if callback: callback(targetdir) finally: os.chdir(oldcwd) DEPS = [("https://bitbucket.org/pypy/pypy/get/default.zip", cp.get("General", "pypy")), ("https://bitbucket.org/pypy/rsdl/get/sdl2.zip", cp.get("General", "rsdl"))] def build_pypy32(exe, directory): oldcwd = os.getcwd() try: os.chdir(directory) import urllib filename, headers = urllib.urlretrieve("https://bootstrap.pypa.io/get-pip.py") os.system("%s %s" % (exe, filename)) os.system("%s -m pip install pytest-cov" % exe) finally: os.chdir(oldcwd) if os.name == "nt": DEPS.append(("http://libsdl.org/release/SDL2-devel-2.0.3-VC.zip", cp.get("Windows", "SDL")))
#! /usr/bin/env python import sys from os import path from environment import cp, config if __name__ == "__main__": if not any(arg.startswith("--jit") for arg in sys.argv): sys.argv.append("--jit=%s" % path.join(path.dirname(__file__), "..", "rsqueak")) if not any(arg.startswith("--squeak") for arg in sys.argv): squeak = cp.get("General", "squeak") if not path.exists(squeak): print "WARN: You need to configure where to find the squeak binary in %s to run the full suite of JIT tests" % config sys.argv.append("--squeak=%s" % squeak) if not any(arg.find("jittest/test") != -1 for arg in sys.argv): sys.argv.append( path.join(path.dirname(__file__), "..", "spyvm", "test", "jittest")) import pytest exit(pytest.main(args=sys.argv))
#! /usr/bin/env python import sys from os import path from environment import cp, config if __name__ == "__main__": if not any(arg.startswith("--jit") for arg in sys.argv): sys.argv.append("--jit=%s" % path.join(path.dirname(__file__), "..", "rsqueak")) if not any(arg.startswith("--squeak") for arg in sys.argv): squeak = cp.get("General", "squeak") if not path.exists(squeak): print "WARN: You need to configure where to find the squeak binary in %s to run the full suite of JIT tests" % config sys.argv.append("--squeak=%s" % squeak) if not any(arg.find("jittest/test") != -1 for arg in sys.argv): sys.argv.append(path.join(path.dirname(__file__), "..", "rsqueakvm", "test", "jittest")) import pytest exit(pytest.main(args=sys.argv))