Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
Create an installable pyodide-build package. Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
package:
  name: numpy
  version: 1.17.5

source:
  url: https://files.pythonhosted.org/packages/d9/09/8e89c05abc450ea347f40b4fa917ec5c69b5228da344487f178586a3187c/numpy-1.17.5.zip
  sha256: 16507ba6617f62ae3c6ab1725ae6f550331025d4d9a369b83f6d5a470446c342

  patches:
    - patches/segfault-PyArray_Broadcast.patch
    - patches/segfault-PyArray_PyIntAsIntp.patch
    - patches/add-emscripten-cpu.patch
    - patches/disable-maybe-uninitialized.patch
    - patches/dont-include-execinfo.patch
    - patches/fix-longdouble.patch
    - patches/fix-static-init-of-nditer-pywrap.patch
    - patches/init-alloc-cache.patch
    - patches/use-local-blas-lapack.patch
    - patches/fix-install-with-skip-build.patch
    - patches/make-int-return-values.patch
    - patches/fix-ieee754.patch
    - patches/rm-duplicate-symbols-link.patch
    - patches/delay-ctypes-import.patch

build:
  skip_host: False
  cflags: -include math.h -I../../config -Werror=implicit-function-declaration -Werror=mismatched-parameter-types -Werror=mismatched-return-types
  post: |
    # copy the correct numpy config into the build artifacts. Otherwise scipy will try to build with the config
    # from the build computer and bad things will happen
    cp config/* $PKGDIR/../.artifacts/lib/python/numpy-1.17.5-py3.8-linux-x86_64.egg/numpy/core/include/numpy

test:
  imports:
    - numpy

package:
  name: numpy
  version: 1.17.5

source:
  url: https://files.pythonhosted.org/packages/d9/09/8e89c05abc450ea347f40b4fa917ec5c69b5228da344487f178586a3187c/numpy-1.17.5.zip
  sha256: 16507ba6617f62ae3c6ab1725ae6f550331025d4d9a369b83f6d5a470446c342

  patches:
    - patches/segfault-PyArray_Broadcast.patch
    - patches/segfault-PyArray_PyIntAsIntp.patch
    - patches/add-emscripten-cpu.patch
    - patches/disable-maybe-uninitialized.patch
    - patches/dont-include-execinfo.patch
    - patches/fix-longdouble.patch
    - patches/fix-static-init-of-nditer-pywrap.patch
    - patches/init-alloc-cache.patch
    - patches/use-local-blas-lapack.patch
    - patches/fix-install-with-skip-build.patch
    - patches/make-int-return-values.patch
    - patches/fix-ieee754.patch
    - patches/rm-duplicate-symbols-link.patch
    - patches/delay-ctypes-import.patch

build:
  skip_host: False
  cflags: -include math.h -I../../config -Werror=implicit-function-declaration -Werror=mismatched-parameter-types -Werror=mismatched-return-types
  post: |
    # copy the correct numpy config into the build artifacts. Otherwise scipy will try to build with the config
    # from the build computer and bad things will happen
    cp config/* $PKGDIR/../.artifacts/lib/python/numpy-1.17.5-py3.8-linux-x86_64.egg/numpy/core/include/numpy

test:
  imports:
    - numpy
