diff --git a/recipes/recipes_emscripten/passagemath-sympow/recipe.yaml b/recipes/recipes_emscripten/passagemath-sympow/recipe.yaml new file mode 100644 index 0000000000..1b204cd77a --- /dev/null +++ b/recipes/recipes_emscripten/passagemath-sympow/recipe.yaml @@ -0,0 +1,68 @@ +context: + version: 10.8.7 + +package: + name: passagemath-sympow + version: ${{ version }} + +source: +- url: https://pypi.org/packages/source/p/passagemath-sympow/passagemath_sympow-${{ version }}.tar.gz + sha256: 15adfcdf976e172fa206a02f2e4dff948abfa891eaa11047fd4422cce87c6f5b + +build: + script: ${{ PYTHON }} -m pip install . + number: 0 + +requirements: + build: + - python + - crossenv >=1.2 + - cross-python_emscripten-wasm32 + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - pip + - passagemath-setup + - passagemath-environment + - cython + - cysignals + - pkgconfig + - passagemath-abi == ${{ version }} + host: + - python + - sympow + - passagemath-categories + run: + - python + - cysignals + - sympow + - passagemath-categories + - passagemath-linbox + - passagemath-modules + +tests: +- script: pytester + files: + recipe: + - test_passagemath_sympow.py + requirements: + build: + - pytester + run: + - pytester-run + - passagemath-repl + +about: + license: GPL-2.0-or-later + license_file: README.rst + summary: 'passagemath: Special values of symmetric power elliptic curve L-functions with sympow' + description: | + Distribution of a part of the Sage library. + It provides an interface to sympow. + +extra: + emscripten_tests: + python: + pytest_files: + - test_passagemath_sympow.py + recipe-maintainers: + - mkoeppe diff --git a/recipes/recipes_emscripten/passagemath-sympow/test_passagemath_sympow.py b/recipes/recipes_emscripten/passagemath-sympow/test_passagemath_sympow.py new file mode 100644 index 0000000000..bac8a249be --- /dev/null +++ b/recipes/recipes_emscripten/passagemath-sympow/test_passagemath_sympow.py @@ -0,0 +1,5 @@ +import pytest + + +def test_import_passagemath_sympow(): + import passagemath_sympow diff --git a/recipes/recipes_emscripten/sympow/build.sh b/recipes/recipes_emscripten/sympow/build.sh new file mode 100644 index 0000000000..89400a7bcb --- /dev/null +++ b/recipes/recipes_emscripten/sympow/build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# Strip architecture-specific flags that might clash with WebAssembly +export CFLAGS="$(echo "${CFLAGS:-}" | sed -E 's/-march=[^ ]+//g; s/-mtune=[^ ]+//g')" + +# Patch the Configure script to evaluate Emscripten's Wasm capabilities via Node.js +sed -i 's|-o config/fpubits|-o config/fpubits.js|g' Configure +sed -i 's|-o config/endiantuple|-o config/endiantuple.js|g' Configure + +sed -i 's|config/fpubits >|node config/fpubits.js >|g' Configure +sed -i 's@^[ \t]*config/fpubits@node config/fpubits.js@g' Configure +sed -i 's|\$(config/endiantuple)|\$(node config/endiantuple.js)|g' Configure + +PREFIX="${PREFIX}" VARPREFIX="${PREFIX}/var" ADDBINPATH=yes sh Configure + +# Patch the generated Makefile for cross-compilation +sed -i 's/\$(HELP2MAN) \$(H2MFLAGS) .*/touch \$@/g' Makefile +sed -i 's/\$(SH) armd.sh/echo "Skipping armd.sh for cross-compilation"/g' Makefile +sed -i '/logfile/d' Makefile +sed -i 's|datafiles/\*.txt ||g' Makefile + +emmake make all CC="emcc" +emmake make install +cp *.wasm $PREFIX/bin \ No newline at end of file diff --git a/recipes/recipes_emscripten/sympow/recipe.yaml b/recipes/recipes_emscripten/sympow/recipe.yaml new file mode 100644 index 0000000000..ee52c1630d --- /dev/null +++ b/recipes/recipes_emscripten/sympow/recipe.yaml @@ -0,0 +1,44 @@ +context: + name: sympow + version: 2.023.7 + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://gitlab.com/rezozer/forks/sympow/-/archive/v${{ version }}/sympow-v${{ version }}.tar.gz + sha256: f19a2b428c573f9e4c36a97b736b562e76f4bfc354497abaeb7140632bef3400 + +build: + number: 0 + +requirements: + build: + - autoconf + - automake + - libtool + - make + - ${{ compiler("c") }} + - ${{ compiler('cxx') }} + - pkg-config + - autoconf-archive + - help2man + - pari + host: + - pari + +tests: + - package_contents: + files: + - bin/sympow + +about: + homepage: https://gitlab.com/rezozer/forks/sympow + license: LicenseRef-sympow + license_file: COPYING + summary: SYMmetric POWer elliptic curve L-functions + +extra: + recipe-maintainers: + - mkoeppe