@@ -14,7 +14,7 @@ FILE_PACKAGER="python $(dirname $(which emcc))/tools/file_packager.py"
14
14
PREFIX=${PREFIX:- $(dirname $(readlink -f $0 ))/ destdir}
15
15
PACKAGEDIR=${PACKAGEDIR:- $(dirname $(readlink -f $0 ))/ package}
16
16
OUTDIR=${OUTDIR:- .}
17
- HOSTPYTHON =$( dirname $( readlink -f $0 ) ) /build/hostpython /bin/python
17
+ CROSSPYTHON =$( dirname $( readlink -f $0 ) ) /crosspython-static /bin/python
18
18
19
19
# Python home
20
20
@@ -27,14 +27,18 @@ mkdir -p $PACKAGEDIR
27
27
28
28
# Hard-coded modules: for 'print("hello, world.")'
29
29
# $@: additional, app-specific modules
30
- for i in site.py os.py posixpath.py stat.py genericpath.py warnings.py linecache.py types.py UserDict.py _abcoll.py abc.py _weakrefset.py copy_reg.py traceback.py sysconfig.py re.py sre_compile.py sre_parse.py sre_constants.py _sysconfigdata.py encodings/__init__.py codecs.py encodings/aliases.py encodings/utf_8.py __future__.py ast.py copy.py weakref.py platform.py string.py io.py tempfile.py random.py hashlib.py struct.py dummy_thread.py collections.py keyword.py heapq.py argparse.py textwrap.py gettext.py locale.py functools.py importlib/__init__.py glob.py fnmatch.py pickle.py colorsys.py contextlib.py zipfile.py shutil.py json/__init__.py json/decoder.py json/scanner.py encodings/hex_codec.py json/encoder.py difflib.py inspect.py dis.py opcode.py tokenize.py token.py xml/__init__.py xml/etree/__init__.py xml/etree/ElementTree.py xml/etree/ElementPath.py encodings/zlib_codec.py tarfile.py urlparse.py StringIO.py encodings/latin_1.py encodings/ascii.py \
30
+ for i in site.py os.py posixpath.py stat.py genericpath.py warnings.py linecache.py types.py UserDict.py _abcoll.py abc.py _weakrefset.py copy_reg.py traceback.py sysconfig.py re.py sre_compile.py sre_parse.py sre_constants.py encodings/__init__.py codecs.py encodings/aliases.py encodings/utf_8.py __future__.py ast.py copy.py weakref.py platform.py string.py io.py tempfile.py random.py hashlib.py struct.py dummy_thread.py collections.py keyword.py heapq.py argparse.py textwrap.py gettext.py locale.py functools.py importlib/__init__.py glob.py fnmatch.py pickle.py colorsys.py contextlib.py zipfile.py shutil.py json/__init__.py json/decoder.py json/scanner.py encodings/hex_codec.py json/encoder.py difflib.py inspect.py dis.py opcode.py tokenize.py token.py xml/__init__.py xml/etree/__init__.py xml/etree/ElementTree.py xml/etree/ElementPath.py encodings/zlib_codec.py tarfile.py urlparse.py StringIO.py encodings/latin_1.py encodings/ascii.py \
31
31
" $@ " ; do
32
32
if [ $PREFIX /lib/python2.7/$i -nt $PREFIX /lib/python2.7/${i% .py} .pyo ]; then
33
- (cd $PREFIX && $HOSTPYTHON -OO -m py_compile lib/python2.7/$i )
33
+ (cd $PREFIX && $CROSSPYTHON -OO -m py_compile lib/python2.7/$i )
34
34
fi
35
35
mkdir -p $PACKAGEDIR /lib/python2.7/$( dirname $i )
36
36
cp -au $PREFIX /lib/python2.7/${i% .py} .pyo $PACKAGEDIR /lib/python2.7/${i% .py} .pyo
37
37
done
38
+ # Large and leaks build paths, clean it:
39
+ echo ' build_time_vars = {}' > $PACKAGEDIR /lib/python2.7/_sysconfigdata.py
40
+ (cd $PACKAGEDIR && $CROSSPYTHON -OO -m py_compile lib/python2.7/_sysconfigdata.py)
41
+ rm -f $PACKAGEDIR /lib/python2.7/_sysconfigdata.py
38
42
39
43
# --no-heap-copy: suited for ALLOW_MEMORY_GROWTH=1
40
44
PACKAGEDIR_FULLPATH=$( readlink -f $PACKAGEDIR )
0 commit comments