diff --git a/recipes/recipes_emscripten/gmp/build.sh b/recipes/recipes_emscripten/gmp/build.sh new file mode 100644 index 000000000..982cdceb3 --- /dev/null +++ b/recipes/recipes_emscripten/gmp/build.sh @@ -0,0 +1,9 @@ +emconfigure ./configure \ + CFLAGS="$CFLAGS -fPIC" \ + --prefix=${PREFIX} \ + --host=none \ + --enable-cxx + # --enable-fat + +emmake make -j${CPU_COUNT} +emmake make install diff --git a/recipes/recipes_emscripten/gmp/recipe.yaml b/recipes/recipes_emscripten/gmp/recipe.yaml new file mode 100644 index 000000000..709f0896e --- /dev/null +++ b/recipes/recipes_emscripten/gmp/recipe.yaml @@ -0,0 +1,48 @@ +context: + version: "6.2.1" + +package: + name: gmp + version: "{{ version }}" + +source: + url: https://gmplib.org/download/gmp/gmp-{{ version }}.tar.bz2 + sha256: eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c + +build: + number: 0 + # run_exports: + # - {{ pin_subpackage("gmp") }} + +requirements: + build: + - gnuconfig # [unix] + - "{{ compiler('c') }}" + - "{{ compiler('cxx') }}" + - m4 + - make + +# test: +# requires: +# - {{ compiler('c') }} + +# files: +# - test.c + +# commands: +# - test -f ${PREFIX}/lib/libgmp.a # [unix] +# - test -f ${PREFIX}/lib/libgmp.dylib # [osx] +# - test -f ${PREFIX}/lib/libgmp.so # [linux] +# - test -f ${PREFIX}/lib/libgmpxx.a # [unix] +# - test -f ${PREFIX}/lib/libgmpxx.dylib # [osx] +# - test -f ${PREFIX}/lib/libgmpxx.so # [linux] + +about: + home: http://gmplib.org/ + license: GPL-2.0-or-later AND LGPL-3.0-or-later + license_file: COPYING.LESSERv3 + summary: The GNU multiprecision library. + +extra: + recipe-maintainers: + - wolfv \ No newline at end of file diff --git a/recipes/recipes_emscripten/gmpy2/recipe.yaml b/recipes/recipes_emscripten/gmpy2/recipe.yaml new file mode 100644 index 000000000..a37c69d22 --- /dev/null +++ b/recipes/recipes_emscripten/gmpy2/recipe.yaml @@ -0,0 +1,52 @@ +context: + version: "2.1.2" + +package: + name: gmpy2 + version: "{{ version }}" + +source: + url: https://pypi.io/packages/source/g/gmpy2/gmpy2-{{ version }}.tar.gz + sha256: da75140bca128ece795895477e53b43773e3748aa90ba6170eae7ca2c74b82d1 + +build: + number: 0 + script: + - python -m pip install . -vvv + +requirements: + build: + - sel(build_platform != target_platform): python + - sel(build_platform != target_platform): cross-python_{{ target_platform }} + - "{{ compiler('c') }}" + host: + - gmp # [unix] + # - mpir # [win] + # - mpfr + - mpc + - python + - pip + run: + - gmp # [unix] + # - mpir # [win] + # - mpfr + - mpc + - python + +# test: +# imports: +# - gmpy2 + +about: + home: https://pypi.python.org/pypi/gmpy2 + license: LGPL-3.0-or-later + license_file: COPYING.LESSER + summary: GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x + +extra: + recipe-maintainers: + - wolfv + emscripten_tests: + python: + pytest_files: + - test_gmpy2.py diff --git a/recipes/recipes_emscripten/gmpy2/test_gmpy2.py b/recipes/recipes_emscripten/gmpy2/test_gmpy2.py new file mode 100644 index 000000000..483e5fc71 --- /dev/null +++ b/recipes/recipes_emscripten/gmpy2/test_gmpy2.py @@ -0,0 +1,9 @@ +def test_gmpy2(): + import gmpy2 + from gmpy2 import mpc, mpfr, mpq, mpz, sqrt + + assert mpz(99) * 43 == mpz(4257) + assert mpq(3, 7) / 7 == mpq(3, 49) + + gmpy2.get_context().allow_complex = True + assert sqrt(mpfr(-2)) == mpc("0.0+1.4142135623730951j") diff --git a/recipes/recipes_emscripten/mpc/build.sh b/recipes/recipes_emscripten/mpc/build.sh new file mode 100644 index 000000000..7ecf6cc56 --- /dev/null +++ b/recipes/recipes_emscripten/mpc/build.sh @@ -0,0 +1,9 @@ +emconfigure ./configure \ + CFLAGS="$CFLAGS -fPIC" \ + --with-gmp="${PREFIX}" \ + --with-mpfr="${PREFIX}" \ + --prefix=${PREFIX} + + +emmake make -j${CPU_COUNT} +emmake make install \ No newline at end of file diff --git a/recipes/recipes_emscripten/mpc/recipe.yaml b/recipes/recipes_emscripten/mpc/recipe.yaml new file mode 100644 index 000000000..40aaa9da7 --- /dev/null +++ b/recipes/recipes_emscripten/mpc/recipe.yaml @@ -0,0 +1,49 @@ +context: + version: "1.2.1" + +package: + name: mpc + version: "{{ version }}" + +source: + url: https://ftp.gnu.org/gnu/mpc/mpc-{{ version }}.tar.gz + sha256: 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459 + +build: + number: 0 + # run_exports: + # - {{ pin_subpackage("mpc") }} + +requirements: + build: + - gnuconfig + - "{{ compiler('c') }}" + # - autotools_clang_conda # [win] + - make + host: + - gmp # [unix] + # - mpir # [win] + - mpfr + run: + - gmp # [unix] + # - mpir # [win] + - mpfr + +# test: +# commands: +# - if not exist %LIBRARY_INC%\\mpc.h exit 1 # [win] +# - if not exist %LIBRARY_LIB%\\mpc.lib exit 1 # [win] +# - if not exist %LIBRARY_BIN%\\mpc.dll exit 1 # [win] +# - test -f ${PREFIX}/include/mpc.h # [unix] +# - test -f ${PREFIX}/lib/libmpc.dylib # [osx] +# - test -f ${PREFIX}/lib/libmpc.so # [linux] + +about: + home: http://www.multiprecision.org/ + license: LGPL-3.0-or-later + license_file: COPYING.LESSER + summary: A C library for the arithmetic of complex numbers with arbitrarily high precision. + +extra: + recipe-maintainers: + - wolfv \ No newline at end of file diff --git a/recipes/recipes_emscripten/mpfr/build.sh b/recipes/recipes_emscripten/mpfr/build.sh new file mode 100644 index 000000000..0344b4d44 --- /dev/null +++ b/recipes/recipes_emscripten/mpfr/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/gnuconfig/config.* . || true + +emconfigure ./configure \ + CFLAGS="$CFLAGS -fPIC" \ + --prefix=$PREFIX \ + --with-gmp=$PREFIX + +make -j${CPU_COUNT} +make install \ No newline at end of file diff --git a/recipes/recipes_emscripten/mpfr/recipe.yaml b/recipes/recipes_emscripten/mpfr/recipe.yaml new file mode 100644 index 000000000..09db7d560 --- /dev/null +++ b/recipes/recipes_emscripten/mpfr/recipe.yaml @@ -0,0 +1,49 @@ +context: + version: "4.1.0" + +package: + name: mpfr + version: "{{ version }}" + +source: + url: http://ftp.gnu.org/gnu/mpfr/mpfr-{{ version }}.tar.gz + sha256: 3127fe813218f3a1f0adf4e8899de23df33b4cf4b4b3831a5314f78e65ffa2d6 + +build: + number: 0 + # run_exports: + # - {{ pin_subpackage("mpfr") }} + +requirements: + build: + - libtool + - m4 + - make + - gnuconfig + - "{{ compiler('c') }}" + # - autotools_clang_conda # [win] + host: + - gmp # [unix] + # - mpir # [win] + +# test: +# requires: +# - {{ compiler('c') }} +# - libtool # [unix] +# - m4 # [unix] + +# commands: +# - if not exist %LIBRARY_INC%\\mpfr.h exit 1 # [win] +# - if not exist %LIBRARY_LIB%\\mpfr.lib exit 1 # [win] +# - if not exist %LIBRARY_BIN%\\mpfr.dll exit 1 # [win] +# - test -f ${PREFIX}/lib/libmpfr${SHLIB_EXT} # [unix] + +about: + home: http://www.mpfr.org/ + license: LGPL-3.0-only + license_file: COPYING.LESSER + summary: The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. + +extra: + recipe-maintainers: + - wolfv \ No newline at end of file