Commit 56ef3a09 authored by Michael Droettboom's avatar Michael Droettboom Committed by GitHub

Merge pull request #123 from mdboom/no-full-paths

Don't include full paths in build products
parents 9736ef1d 3c8bcae5
PYODIDE_ROOT=$(abspath .)
include Makefile.envs
FILEPACKAGER=emsdk/emsdk/emscripten/tag-1.38.10/tools/file_packager.py
FILEPACKAGER=$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.10/tools/file_packager.py
CPYTHONROOT=cpython
CPYTHONLIB=$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/python$(PYMINOR)
......@@ -64,7 +64,10 @@ build/pyodide.asm.js: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.b
build/pyodide.asm.data: root/.built
python $(FILEPACKAGER) build/pyodide.asm.data --preload root/lib@lib --js-output=build/pyodide.asm.data.js --use-preload-plugins
( \
cd build; \
python $(FILEPACKAGER) pyodide.asm.data --preload ../root/lib@lib --js-output=pyodide.asm.data.js --use-preload-plugins \
)
uglifyjs build/pyodide.asm.data.js -o build/pyodide.asm.data.js
......@@ -136,7 +139,10 @@ build/test.data: $(CPYTHONLIB)
cd $(CPYTHONLIB)/test; \
find -type d -name __pycache__ -prune -exec rm -rf {} \; \
)
python $(FILEPACKAGER) build/test.data --preload $(CPYTHONLIB)/test@/lib/python3.6/test --js-output=build/test.js --export-name=pyodide --exclude \*.wasm.pre --exclude __pycache__
( \
cd build; \
python $(FILEPACKAGER) test.data --preload ../$(CPYTHONLIB)/test@/lib/python3.6/test --js-output=test.js --export-name=pyodide --exclude \*.wasm.pre --exclude __pycache__ \
)
uglifyjs build/test.js -o build/test.js
......
......@@ -25,7 +25,8 @@ $(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB)
touch $(BUILD)/$(LIB) ; \
emmake make HOSTPYTHON=$(HOSTPYTHON) PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) && \
cp $(LIB) $(INSTALL)/lib/ && \
cp $(HOSTINSTALL)/lib/python$(PYMINOR)/`$(HOSTPYTHON) -c "import sysconfig; print(sysconfig._get_sysconfigdata_name())"`.py $(INSTALL)/lib/python$(PYMINOR)/_sysconfigdata__emscripten_.py \
cp $(HOSTINSTALL)/lib/python$(PYMINOR)/`$(HOSTPYTHON) -c "import sysconfig; print(sysconfig._get_sysconfigdata_name())"`.py $(INSTALL)/lib/python$(PYMINOR)/_sysconfigdata__emscripten_.py; \
sed -i -e 's#'"$(PYODIDE_ROOT)"'##g' $(INSTALL)/lib/python$(PYMINOR)/_sysconfigdata__emscripten_.py; \
)
......
......@@ -143,14 +143,15 @@ def package_files(buildpath, srcpath, pkg, args):
subprocess.run([
'python',
Path(os.environ['EMSCRIPTEN']) / 'tools' / 'file_packager.py',
buildpath / (name + '.data'),
name + '.data',
'--preload',
'{}@/lib/python3.6/site-packages'.format(libdir),
'--js-output={}'.format(buildpath / (name + '.js')),
'--js-output={}'.format(name + '.js'),
'--export-name=pyodide',
'--exclude', '*.wasm.pre',
'--exclude', '__pycache__',
'--use-preload-plugins'], check=True)
'--use-preload-plugins'],
cwd=buildpath, check=True)
subprocess.run([
'uglifyjs',
buildpath / (name + '.js'),
......
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