diff --git a/build/pkgs/symengine/checksums.ini b/build/pkgs/symengine/checksums.ini index 1c1813e7eea..8eb65f05ef9 100644 --- a/build/pkgs/symengine/checksums.ini +++ b/build/pkgs/symengine/checksums.ini @@ -1,5 +1,5 @@ tarball=symengine-VERSION.tar.gz -sha1=11885879ddcd0a9ab69e36a79b93aef836d6c95d -md5=4673c85b423241ce85a9df35a7ed61bb -cksum=1344562381 +sha1=a2c8957f2099c9199751b165f107bf93d6823818 +md5=fe3c3fee1bd8dfdb9576fc2d28cb1076 +cksum=3544211225 upstream_url=https://github.com/symengine/symengine/releases/download/vVERSION/symengine-VERSION.tar.gz diff --git a/build/pkgs/symengine/distros/arch.txt b/build/pkgs/symengine/distros/arch.txt new file mode 100644 index 00000000000..7bcf459b746 --- /dev/null +++ b/build/pkgs/symengine/distros/arch.txt @@ -0,0 +1 @@ +symengine diff --git a/build/pkgs/symengine/distros/homebrew.txt b/build/pkgs/symengine/distros/homebrew.txt new file mode 100644 index 00000000000..7bcf459b746 --- /dev/null +++ b/build/pkgs/symengine/distros/homebrew.txt @@ -0,0 +1 @@ +symengine diff --git a/build/pkgs/symengine/package-version.txt b/build/pkgs/symengine/package-version.txt index 571215736a6..af88ba82486 100644 --- a/build/pkgs/symengine/package-version.txt +++ b/build/pkgs/symengine/package-version.txt @@ -1 +1 @@ -0.10.1 +0.11.1 diff --git a/build/pkgs/symengine/spkg-configure.m4 b/build/pkgs/symengine/spkg-configure.m4 new file mode 100644 index 00000000000..c037d2e5f72 --- /dev/null +++ b/build/pkgs/symengine/spkg-configure.m4 @@ -0,0 +1,45 @@ +SAGE_SPKG_CONFIGURE([symengine], [ + m4_pushdef(SAGE_SYMENGINE_VERSION_MAJOR, [0]) + m4_pushdef(SAGE_SYMENGINE_VERSION_MINOR, [11]) + SAGE_SPKG_DEPCHECK([gmp arb ecm flint mpc mpfr], [ + AC_CHECK_HEADER([symengine/symengine_config.h], [], [sage_spkg_install_symengine=yes]) + AC_MSG_CHECKING([whether we can link a program using symengine]) + SYMENGINE_SAVED_LIBS=$LIBS + LIBS="$LIBS -lsymengine" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include ]], + [[using SymEngine::Expression; + Expression x("x"); + auto ex = pow(x+sqrt(Expression(2)), 6);]] + )], [AC_MSG_RESULT([yes])], [ + AC_MSG_RESULT([no]); sage_spkg_install_symengine=yes + LIBS=$SYMENGINE_SAVED_LIBS + ]) + AC_MSG_CHECKING([symengine version >= ]SAGE_SYMENGINE_VERSION_MAJOR[.]SAGE_SYMENGINE_VERSION_MINOR) + AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include + #include + ]], [[ + fprintf(stderr, "%s\n", SYMENGINE_VERSION); + if (SYMENGINE_MAJOR_VERSION >]] SAGE_SYMENGINE_VERSION_MAJOR[[) return 0; + else if (SYMENGINE_MAJOR_VERSION ==]] SAGE_SYMENGINE_VERSION_MAJOR[[ && + SYMENGINE_MINOR_VERSION >=]] SAGE_SYMENGINE_VERSION_MINOR[[) return 0; + else return 1; + ]])], [ + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + sage_spkg_install_symengine=yes + ], [ + dnl assume that the person running cross-compiling + dnl knows what they are doing + AC_MSG_RESULT([yes]) + ]) + ]) + + m4_popdef([SAGE_SYMENGINE_VERSION_MAJOR]) + m4_popdef([SAGE_SYMENGINE_VERSION_MINOR]) +], [], [], [] +) + diff --git a/build/pkgs/symengine_py/checksums.ini b/build/pkgs/symengine_py/checksums.ini index 0235c5e9cd9..f8790fdfb4e 100644 --- a/build/pkgs/symengine_py/checksums.ini +++ b/build/pkgs/symengine_py/checksums.ini @@ -1,5 +1,5 @@ tarball=symengine.py-VERSION.tar.gz -sha1=fbbf052e66077ec51df319444b71f94114f33d9e -md5=fc5d2d7f571a880aa2e040214aed2ff0 -cksum=2535731241 -upstream_url=https://github.com/symengine/symengine.py/archive/vVERSION.tar.gz +sha1=4a8da0d0a057c8709c5b28543dbb3d26a060f013 +md5=d10f4ba5c27b09ef234fcafddf824ce5 +cksum=1332096394 +upstream_url=https://pypi.io/packages/source/p/symengine/symengine-VERSION.tar.gz diff --git a/build/pkgs/symengine_py/distros/arch.txt b/build/pkgs/symengine_py/distros/arch.txt new file mode 100644 index 00000000000..16ff7effe29 --- /dev/null +++ b/build/pkgs/symengine_py/distros/arch.txt @@ -0,0 +1 @@ +python-symengine diff --git a/build/pkgs/symengine_py/distros/freebsd.txt b/build/pkgs/symengine_py/distros/freebsd.txt new file mode 100644 index 00000000000..9fa30f46fb7 --- /dev/null +++ b/build/pkgs/symengine_py/distros/freebsd.txt @@ -0,0 +1 @@ +math/py-symengine diff --git a/build/pkgs/symengine_py/distros/gentoo.txt b/build/pkgs/symengine_py/distros/gentoo.txt new file mode 100644 index 00000000000..e8851805aea --- /dev/null +++ b/build/pkgs/symengine_py/distros/gentoo.txt @@ -0,0 +1 @@ +dev-python/symengine diff --git a/build/pkgs/symengine_py/package-version.txt b/build/pkgs/symengine_py/package-version.txt index 78bc1abd14f..d9df1bbc0c7 100644 --- a/build/pkgs/symengine_py/package-version.txt +++ b/build/pkgs/symengine_py/package-version.txt @@ -1 +1 @@ -0.10.0 +0.11.0 diff --git a/build/pkgs/symengine_py/spkg-configure.m4 b/build/pkgs/symengine_py/spkg-configure.m4 new file mode 100644 index 00000000000..9559bdb6da0 --- /dev/null +++ b/build/pkgs/symengine_py/spkg-configure.m4 @@ -0,0 +1 @@ +SAGE_SPKG_CONFIGURE([symengine_py], [SAGE_PYTHON_PACKAGE_CHECK([symengine_py])]) diff --git a/build/pkgs/symengine_py/type b/build/pkgs/symengine_py/type index af4d63af86d..134d9bc32d5 100644 --- a/build/pkgs/symengine_py/type +++ b/build/pkgs/symengine_py/type @@ -1 +1 @@ -experimental \ No newline at end of file +optional diff --git a/src/sage/features/symengine_py.py b/src/sage/features/symengine_py.py new file mode 100644 index 00000000000..d32492085b7 --- /dev/null +++ b/src/sage/features/symengine_py.py @@ -0,0 +1,43 @@ +r""" +Check for symengine_py +""" + +# **************************************************************************** +# Copyright (C) 2023 Dima Pasechnik +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + +from . import PythonModule +from .join_feature import JoinFeature + + +class symengine_py(JoinFeature): + r""" + A :class:`sage.features.Feature` describing the presence of the + Python package :ref:`symengine_py `. + + EXAMPLES:: + + sage: from sage.features.symengine_py import symengine_py + sage: symengine_py().is_present() # optional - symengine_py + FeatureTestResult('symengine_py', True) + """ + def __init__(self): + r""" + TESTS:: + + sage: from sage.features.symengine_py import symengine_py + sage: isinstance(symengine_py(), symengine_py) + True + """ + JoinFeature.__init__(self, 'symengine_py', + [PythonModule('symengine', spkg="symengine_py", + url="https://pypi.org/project/symengine")]) + +def all_features(): + return [symengine_py()]