mirror of https://github.com/pyodide/pyodide.git
Merge pull request #123 from mdboom/no-full-paths
Don't include full paths in build products
This commit is contained in:
commit
56ef3a0960
12
Makefile
12
Makefile
|
@ -1,7 +1,7 @@
|
||||||
PYODIDE_ROOT=$(abspath .)
|
PYODIDE_ROOT=$(abspath .)
|
||||||
include Makefile.envs
|
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
|
CPYTHONROOT=cpython
|
||||||
CPYTHONLIB=$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/python$(PYMINOR)
|
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
|
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
|
uglifyjs build/pyodide.asm.data.js -o build/pyodide.asm.data.js
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,7 +139,10 @@ build/test.data: $(CPYTHONLIB)
|
||||||
cd $(CPYTHONLIB)/test; \
|
cd $(CPYTHONLIB)/test; \
|
||||||
find -type d -name __pycache__ -prune -exec rm -rf {} \; \
|
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
|
uglifyjs build/test.js -o build/test.js
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ $(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB)
|
||||||
touch $(BUILD)/$(LIB) ; \
|
touch $(BUILD)/$(LIB) ; \
|
||||||
emmake make HOSTPYTHON=$(HOSTPYTHON) PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) && \
|
emmake make HOSTPYTHON=$(HOSTPYTHON) PYTHON_FOR_BUILD=$(HOSTPYTHON) CROSS_COMPILE=yes inclinstall libinstall $(LIB) && \
|
||||||
cp $(LIB) $(INSTALL)/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([
|
subprocess.run([
|
||||||
'python',
|
'python',
|
||||||
Path(os.environ['EMSCRIPTEN']) / 'tools' / 'file_packager.py',
|
Path(os.environ['EMSCRIPTEN']) / 'tools' / 'file_packager.py',
|
||||||
buildpath / (name + '.data'),
|
name + '.data',
|
||||||
'--preload',
|
'--preload',
|
||||||
'{}@/lib/python3.6/site-packages'.format(libdir),
|
'{}@/lib/python3.6/site-packages'.format(libdir),
|
||||||
'--js-output={}'.format(buildpath / (name + '.js')),
|
'--js-output={}'.format(name + '.js'),
|
||||||
'--export-name=pyodide',
|
'--export-name=pyodide',
|
||||||
'--exclude', '*.wasm.pre',
|
'--exclude', '*.wasm.pre',
|
||||||
'--exclude', '__pycache__',
|
'--exclude', '__pycache__',
|
||||||
'--use-preload-plugins'], check=True)
|
'--use-preload-plugins'],
|
||||||
|
cwd=buildpath, check=True)
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
'uglifyjs',
|
'uglifyjs',
|
||||||
buildpath / (name + '.js'),
|
buildpath / (name + '.js'),
|
||||||
|
|
Loading…
Reference in New Issue