Commit a5100fb5 authored by Boxiang Sun's avatar Boxiang Sun

Bump up pyodide version

parent 70fc9b01
......@@ -54,11 +54,10 @@ environment =
[pyodide-src]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/Daetalus/pyodide.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
branch = master
branch = upstream_master
[pyodide-script]
recipe = slapos.recipe.build
......@@ -66,7 +65,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
build_dir = ${buildout:parts-directory}/pyodide-script-test
part_dir = ${buildout:parts-directory}
git-executable = ${git:location}/bin/git
emsdk_set_env_script = ${:build_dir}/emsdk/emsdk/emsdk_set_env.sh
emsdk_dir = ${:build_dir}/emsdk/emsdk
repository = https://lab.nexedi.com/Daetalus/pyodide.git
PKG_CONFIG_PATH=${freetype:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig:${libpng:location}/lib/pkgconfig
PATH=${curl:location}/bin:${git:location}/bin:${pkgconfig:location}/bin:${freetype:location}/bin:${nodejs:location}/bin/:${f2c:location}:${python3.7:location}/bin:${cmake:location}/bin:${ccache:location}/bin:${node-less:location}/node_modules/.bin:${node-uglify-js:location}/node_modules/.bin:${xz-utils:location}/bin:%(PATH)s
......@@ -80,18 +79,22 @@ python_bin_dir = ${python3.7:location}/bin
md5sum = 47ec6a091e503349d948760dc03bed51
pip_script = ${:_profile_base_location_}/get-pip.py
script =
import subprocess, os, shutil
import subprocess, os, shutil, re
env = {
'PKG_CONFIG_PATH':self.options['PKG_CONFIG_PATH'],
'PATH':self.options['PATH'] + ':' + os.environ['PATH'],
'CPATH':self.options['CPATH'],
'CPPFLAGS':self.options['CPPFLAGS'],
'LD_LIBRARY_PATH':self.options['LD_LIBRARY_PATH'],
'LDFLAGS':self.options['LDFLAGS'],
}
if not os.path.isdir(self.options['build_dir']):
command_list_0 = [{'cmd': self.options['git-executable'] + ' clone ' + self.options['repository'] + ' pyodide-script-test', 'cwd': self.options['part_dir']}]
command_list_0 = [
{'cmd': self.options['git-executable'] + ' clone ' + self.options['repository'] + ' pyodide-script-test', 'cwd': self.options['part_dir']},
{'cmd': self.options['git-executable'] + ' checkout ' + ' upstream_master', 'cwd': self.options['build_dir']},
]
# put the Popen in the loop to let the pipe.wait() work.
for command_0 in command_list_0:
pipe = subprocess.Popen(command_0['cmd'], cwd=command_0['cwd'], env=env, shell=True)
......@@ -112,14 +115,15 @@ script =
# But scipy needs gfortran. The workaround is just give a symlink in the cpython bin dir, which points to the custom gcc gfortran.
# Note: the parts/cpython is for run the pyodide building script. The pyodide/cpython is for compile to webassembly module which will loads to the browser.
create_gfortran_symlink = 'ln -s ' + self.options['gcc_bin_dir'] + '/gfortran ' + self.options['python_bin_dir'] + '/gfortran'
emsdk_env_file = self.options['emsdk_dir'] + '/emsdk_env.txt'
generate_emsdk_env = self.options['emsdk_dir'] + '/emsdk_env.sh' + ' > ' + emsdk_env_file
command_list = [
{'cmd': cpython_makefile_command, 'cwd': self.options['build_dir']},
{'cmd': install_pip, 'cwd': self.options['build_dir']},
{'cmd': install_pytest, 'cwd': self.options['build_dir']},
{'cmd': create_gfortran_symlink, 'cwd': self.options['build_dir']},
{'cmd': 'make -C emsdk', 'cwd': self.options['build_dir']},
{'cmd': './emsdk/emsdk/emsdk_env.sh', 'cwd': self.options['build_dir']},
{'cmd': generate_emsdk_env, 'cwd': self.options['build_dir']},
{'cmd': 'make -C lz4', 'cwd': self.options['build_dir']},
{'cmd': 'make -C cpython', 'cwd': self.options['build_dir']},
{'cmd': 'make -C CLAPACK', 'cwd': self.options['build_dir']},
......@@ -131,13 +135,16 @@ script =
pipe.wait()
# We need to execute the command "./emsdk/emsdk/emsdk_env.sh" to add the emsdk related environment variables.
# Run "emsdk_env.sh" first, then read the content of "emsdk_set_env.sh" to get the environment variables
emsdk_env_content = open(self.options['emsdk_set_env_script'])
# Run "emsdk_env.sh" first, then read the content of emsdk_env_file to get the environment variables
emsdk_env_content = open(emsdk_env_file)
for content in emsdk_env_content:
# remove "export " prefix
content = content[7:]
key, value = content.split('=')
value = value.rstrip().strip('"')
# Processing "PATH += XXX"
result = re.findall('(\w+)\s(\+=|=)\s(.+)', content)
# result should be "[('PATH', '+=', 'XXX')]"
if len(result) < 1:
continue
key = result[0][0]
value = result[0][2]
try:
env[key] += ':' + value
except KeyError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment