# HG changeset patch # User Goffi # Date 1412357890 -7200 # Node ID d888bb2a23a92f410a2ba1a3b333aac8e7a01b18 # Parent 7e8356479fefcadc6ac0dc760548a437e7cfa709 installation: pyjamas build fixes: - replaced string subprocess call by a list (argument were not escaped properly) - fixed inclusion: to avoid bad inclusion leading to compilation errors, we create a temporary directory with symlinks to only what we need diff -r 7e8356479fef -r d888bb2a23a9 setup.py --- a/setup.py Fri Oct 03 18:31:40 2014 +0200 +++ b/setup.py Fri Oct 03 19:38:10 2014 +0200 @@ -29,6 +29,7 @@ from stat import ST_MODE import shutil from src.server.constants import Const as C +import tempfile # seen here: http://stackoverflow.com/questions/7275295 try: @@ -112,8 +113,14 @@ """Build the browser side JS files from Python source.""" cwd = os.getcwd() os.chdir(os.path.join('src', 'browser')) - result = subprocess.call('pyjsbuild libervia_main --no-compile-inplace -I %s -o %s' % - (self.install_lib, self.pyjamas_output_dir), shell=True) + # we must have only certain package in the path, so we create a tmp dir to link only what we need + tmp_dir = tempfile.mkdtemp() + import sat, sat_frontends, libervia + os.symlink(os.path.dirname(sat.__file__), os.path.join(tmp_dir,"sat")) # FIXME: only work on unixes + os.symlink(os.path.dirname(sat_frontends.__file__), os.path.join(tmp_dir,"sat_frontends")) # FIXME: only work on unixes + os.symlink(os.path.dirname(libervia.__file__), os.path.join(tmp_dir,"libervia")) # FIXME: only work on unixes + result = subprocess.call(['pyjsbuild', 'libervia_main', '--no-compile-inplace', '-I', tmp_dir, '-o', self.pyjamas_output_dir]) + shutil.rmtree(tmp_dir) os.chdir(cwd) return result