Commit 3b429e61 authored by Roman Yurchak's avatar Roman Yurchak

Address review comments

parent 0c6b653f
export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e1.38.10/build_tag-e1.38.10_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.10:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.10_64bit_binaryen/bin:$(PATH)
export PYTHONPATH := $(PYTHONPATH):$(PYODIDE_ROOT)/
export EMSDK = $(PYODIDE_ROOT)/emsdk/emsdk
export EM_CONFIG = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten
......
#!/bin/sh
# get the absolute path to the root directory
ROOTDIR="$(cd ${BASH_SOURCE%/*}/../; pwd)";
export PYTHONPATH="${PYTHONPATH}:${ROOTDIR}"
python -m pyodide_build "$@"
......@@ -2,7 +2,7 @@ PYODIDE_ROOT=$(abspath ..)
include ../Makefile.envs
all:
python -m pyodide_build buildall . ../build \
../bin/pyodide buildall . ../build \
--ldflags="$(SIDE_LDFLAGS)" --host=$(HOSTPYTHONROOT) --target=$(TARGETPYTHONROOT)
clean:
......
......@@ -7,7 +7,7 @@ from . import pywasmcross
def main():
main_parser = argparse.ArgumentParser()
main_parser = argparse.ArgumentParser(prog='pyodide')
subparsers = main_parser.add_subparsers(help='action')
for command_name, module in (("buildpkg", buildpkg),
......
......@@ -85,8 +85,7 @@ def compile(path, srcpath, pkg, args):
try:
subprocess.run([
str(Path(args.host) / 'bin' / 'python3'),
'-m', 'pyodide_build',
'pywasmcross',
'-m', 'pyodide_build', 'pywasmcross',
'--cflags',
args.cflags + ' ' +
pkg.get('build', {}).get('cflags', ''),
......
......@@ -208,6 +208,11 @@ def build_wrap(args):
def make_parser(parser):
basename = Path(sys.argv[0]).name
if basename in symlinks:
# skip parsing of all arguments
parser._actions = []
else:
parser.description = (
'Cross compile a Python distutils package. '
'Run from the root directory of the package\'s source')
......@@ -226,7 +231,7 @@ def make_parser(parser):
return parser
def main(args, unknown=None):
def main(args):
basename = Path(sys.argv[0]).name
if basename in symlinks:
collect_args(basename)
......@@ -235,6 +240,10 @@ def main(args, unknown=None):
if __name__ == '__main__':
basename = Path(sys.argv[0]).name
if basename in symlinks:
main(None)
else:
parser = make_parser(argparse.ArgumentParser())
args, unknown = parser.parse_known_args()
main(args, unknown)
args = parser.parse_args()
main(args)
from setuptools import setup
import sys
from pyodide_build import __version__
if 'install' in sys.argv or 'bdist_wheel' in sys.argv:
print("Error: pyodode_build is currently not fully standalone, "
"and can only be installed in development mode. Use:\n"
" pip install -e . \n"
"to install it.")
sys.exit(1)
with open('README.md', 'rt') as fh:
LONG_DESCRIPTION = fh.read()
setup(name='pyodide_build',
version=__version__,
description='pyodide builder',
entry_points={
'console_scripts': [
'pyodide = pyodide_build.__main__:main'
]},
url="https://github.com/iodide-project/pyodide",
license='MPL',
packages=['pyodide_build'])
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