diff --git a/packages/libyaml/meta.yaml b/packages/libyaml/meta.yaml new file mode 100644 index 000000000..b680dae84 --- /dev/null +++ b/packages/libyaml/meta.yaml @@ -0,0 +1,14 @@ +package: + name: libyaml + version: 0.2.1 + +source: + url: https://github.com/yaml/libyaml/archive/0.2.1.zip + +build: + library: true + script: | + CFLAGS="-fPIC" emcmake cmake -DCMAKE_INSTALL_PREFIX=.. . + emmake make -j ${PYODIDE_JOBS:-3} + ln -s libyaml-0.2.1/libyaml_static.a ../libyaml.a + ln -s libyaml-0.2.1/include .. diff --git a/packages/pyyaml/meta.yaml b/packages/pyyaml/meta.yaml new file mode 100644 index 000000000..9048c810c --- /dev/null +++ b/packages/pyyaml/meta.yaml @@ -0,0 +1,28 @@ +package: + name: pyyaml + version: 5.3.1 + +source: + # path: downloads/pyyaml-5.3.1 + url: https://github.com/yaml/pyyaml/archive/5.3.1.zip + + patches: + - patches/Makefile.patch + - patches/setup.cfg.patch + +build: + skip_host: True + cflags: | + -I../../../../cpython/installs/python-3.8.2/include/python3.8 + -I../../../../emsdk/emsdk/fastcomp/emscripten/system/include/libc + -I../../../libyaml/build/include + ldflags: | + -L../../../libyaml/build/ + +requirements: + run: + - libyaml + +test: + imports: + - yaml diff --git a/packages/pyyaml/patches/Makefile.patch b/packages/pyyaml/patches/Makefile.patch new file mode 100644 index 000000000..4a8e8eb2c --- /dev/null +++ b/packages/pyyaml/patches/Makefile.patch @@ -0,0 +1,11 @@ +--- downloads/pyyaml-5.3.1/Makefile 2020-03-18 21:09:19.000000000 +0000 ++++ patches/Makefile 2020-11-20 06:33:24.117490628 +0000 +@@ -1,7 +1,7 @@ + + .PHONY: default build buildext force forceext install installext test testext dist clean + +-PYTHON=/usr/bin/python ++PYTHON=/bin/env python + TEST= + PARAMETERS= + diff --git a/packages/pyyaml/patches/setup.cfg.patch b/packages/pyyaml/patches/setup.cfg.patch new file mode 100644 index 000000000..7e04b5c5f --- /dev/null +++ b/packages/pyyaml/patches/setup.cfg.patch @@ -0,0 +1,18 @@ +--- downloads/pyyaml-5.3.1/setup.cfg 2021-01-24 16:20:43.372414420 +0000 ++++ patches/setup.cfg 2021-01-24 16:20:49.767657201 +0000 +@@ -13,7 +13,7 @@ + #compiler=mingw32 + + # Additional preprocessor definitions might be required. +-#define=YAML_DECLARE_STATIC ++define=YAML_DECLARE_STATIC + + # The following options are used to build PyYAML Windows installer + # for Python 2.7 on my PC: +@@ -22,4 +22,4 @@ + #define=YAML_DECLARE_STATIC + + [metadata] +-license_file = LICENSE +\ No newline at end of file ++license_file = LICENSE diff --git a/packages/pyyaml/patches/setup.py.patch b/packages/pyyaml/patches/setup.py.patch new file mode 100644 index 000000000..57eaab632 --- /dev/null +++ b/packages/pyyaml/patches/setup.py.patch @@ -0,0 +1,11 @@ +--- downloads/pyyaml-5.3.1/setup.py 2020-03-18 21:09:19.000000000 +0000 ++++ patches/setup.py 2020-11-24 06:47:26.652992652 +0000 +@@ -287,6 +287,8 @@ if bdist_wheel: + + + if __name__ == '__main__': ++ from distutils import sysconfig ++ sysconfig._config_vars['EXT_SUFFIX'] = '.js' + + setup( + name=NAME,