diff --git a/e-antic-unpatch.patch b/e-antic-unpatch.patch new file mode 100644 index 0000000..060f3b7 --- /dev/null +++ b/e-antic-unpatch.patch @@ -0,0 +1,65 @@ +--- a/libeantic/configure.ac 2021-06-25 08:06:12.000000000 -0600 ++++ b/libeantic/configure.ac 2021-06-26 16:49:08.179099722 -0600 +@@ -28,8 +28,6 @@ AC_PROG_INSTALL + dnl We build our library with libtool. + LT_INIT + +-AC_CONFIG_LIBOBJ_DIR([upstream/patched]) +- + ## Test for valgrind test suite + AX_VALGRIND_DFLT([sgcheck], [off]) + AX_VALGRIND_DFLT([drd], [off]) +@@ -55,15 +53,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + AC_CHECK_HEADERS(antic/nf.h antic/nf_elem.h, , [AC_MSG_ERROR([antic headers not found])]) + AC_CHECK_LIB(antic, nf_init, [], [AC_MSG_ERROR([libantic not found])]) + +-# Check if we need to provide our own nf_init_randtest which was introduced in https://github.com/wbhart/antic/pull/47 +-AC_REPLACE_FUNCS(nf_init_randtest) +-# Unconditionally patch nf_elem_scalar_div_fmpq which has aliasing issues in ANTIC, https://github.com/wbhart/antic/pull/48 +-AC_LIBOBJ(EANTIC_nf_elem_scalar_div_fmpq) +-# Unconditionally patch fmpq_poly_add_fmpq which was fixed in https://github.com/wbhart/flint2/commit/17d26d4c957828f3c98c15ddec85108f841d3438 +-AC_LIBOBJ(EANTIC_fmpq_poly_add_fmpq) +-# Unconditionally patch nf_elem_add_fmpq so it uses our patched fmpq_poly_add_fmpq +-AC_LIBOBJ(EANTIC_nf_elem_add_fmpq) +- + AC_CHECK_HEADERS(arb.h arf.h, , [AC_MSG_ERROR([Arb header not found])]) + AC_SEARCH_LIBS(arb_init, [arb flint-arb],[], [AC_MSG_ERROR([libarb not found])]) + +--- a/libeantic/e-antic/renf_elem.h 2021-06-25 08:06:12.000000000 -0600 ++++ b/libeantic/e-antic/renf_elem.h 2021-06-26 19:22:54.519464883 -0600 +@@ -33,12 +33,6 @@ extern "C" { + #define EANTIC_STR_D 2 + #define EANTIC_STR_ARB 4 + +-// Patch nf_elem_scalar_div & nf_elem_add_fmpq which have issues in the released version of ANTIC, see upstream/patched. +-LIBEANTIC_API void EANTIC_nf_elem_scalar_div_fmpq(nf_elem_t a, const nf_elem_t b, const fmpq_t c, const nf_t nf); +-#define nf_elem_scalar_div_fmpq(a, b, c, nf) EANTIC_nf_elem_scalar_div_fmpq(a, b, c, nf) +-LIBEANTIC_API void EANTIC_nf_elem_add_fmpq(nf_elem_t a, const nf_elem_t b, const fmpq_t c, const nf_t nf); +-#define nf_elem_add_fmpq(a, b, c, nf) EANTIC_nf_elem_add_fmpq(a, b, c, nf) +- + /// === Memory Layout === + /// A real embedded number field element + typedef struct LIBEANTIC_API renf_elem +--- a/libeantic/Makefile.am 2021-06-25 08:06:12.000000000 -0600 ++++ b/libeantic/Makefile.am 2021-06-26 16:49:45.610145920 -0600 +@@ -5,20 +5,3 @@ endif + SUBDIRS = src srcxx test $(MAYBE_BENCHMARK) + + ACLOCAL_AMFLAGS = -I m4 +- +-# Distribute files that we might need to fill/replace from our dependencies +-EXTRA_DIST = \ +- upstream/patched/EANTIC_fmpq_poly_add_fmpq.c \ +- upstream/patched/EANTIC_nf_elem_add_fmpq.c \ +- upstream/patched/EANTIC_nf_elem_scalar_div_fmpq.c \ +- upstream/patched/fmpq_poly_add_fmpq.c \ +- upstream/patched/nf.h \ +- upstream/patched/nf_elem.h \ +- upstream/patched/nf_elem_add_fmpq.c \ +- upstream/patched/nf_elem_scalar_div_fmpq.c \ +- upstream/patched/nf_init_randtest.c +- +-# Probably a bug in autotools: +-# .libs in AC_CONFIG_LIBOBJ_DIR is not cleaned automatically. +-mostlyclean-local: +- -rm -rf upstream/patched/.libs diff --git a/e-antic.spec b/e-antic.spec index 5619156..c605ac1 100644 --- a/e-antic.spec +++ b/e-antic.spec @@ -1,18 +1,33 @@ Name: e-antic -Version: 0.1.8 -Release: 2%{?dist} +Version: 1.0.1 +Release: 1%{?dist} Summary: Real Embedded Algebraic Number Theory In C -# See https://github.com/videlec/e-antic/issues/100 License: LGPLv3+ -URL: https://github.com/videlec/%{name} +URL: https://github.com/flatsurf/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# The e-antic sources contain patches to flint and antic, but those patches +# have already been incorporated into the Fedora versions. Make e-antic skip +# attempts to build the patched files. +Patch0: %{name}-unpatch.patch BuildRequires: antic-devel BuildRequires: arb-devel +BuildRequires: boost-devel +BuildRequires: catch-devel +BuildRequires: cereal-devel BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: make +BuildRequires: python3-devel +BuildRequires: %{py3_dist setuptools} + +# Missing dependencies to build docs: +# - byexample: https://github.com/byexamples/byexample +# - standardese: https://github.com/standardese/standardese +# +# BuildRequires: %%{py3_dist sphinx} +# BuildRequires: %%{py3_dist sphinx_rtd_theme} %description E-ANTIC is a C/C++ library to deal with real embedded number fields, @@ -22,33 +37,56 @@ arithmetic operations and comparisons. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: antic-devel%{?_isa} Requires: arb-devel%{?_isa} -Requires: flint-devel%{?_isa} -Requires: gmp-devel%{?_isa} +Requires: boost-devel%{?_isa} +Requires: cereal-devel%{?_isa} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%prep -%autosetup +%package -n python3-pyeantic +Summary: Python 3 interface to %{name} +BuildArch: noarch +Requires: %{name}%{?_isa} = %{version}-%{release} -# Replace an obsolete autoconf macro -sed -i 's/AC_PROG_LIBTOOL/LT_INIT/' configure.ac +%description -n python3-pyeantic +The python3-pyeantic package contains a python 3 interface to the +e-antic library. + +%prep +%autosetup -p1 -# Create the configure script +# Update the configure script due to patch 0 autoreconf -fi . +# Make catch2 available for testing +mkdir -p libeantic/test/external/catch2/single_include +ln -s %{_includedir}/catch2 libeantic/test/external/catch2/single_include + +# Make cereal available for testing +rmdir libeantic/test/external/cereal +ln -s %{_includedir}/cereal libeantic/test/external/cereal + %build +# We have to disable python tests due to lack of cppyy in Fedora export CPPFLAGS="-I %{_includedir}/arb" -%configure --disable-silent-rules --disable-static --enable-openmp +%configure --disable-silent-rules --disable-static \ + --enable-openmp \ + --without-benchmark \ + --without-byexample \ + --without-doc \ + --without-pytest \ + --without-realalg \ + --without-sage # Get rid of undesirable hardcoded rpaths; workaround libtool reordering # -Wl,--as-needed after all the libraries. sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ -e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \ - -i libtool + -i libeantic/libtool pyeantic/libtool %make_build @@ -58,6 +96,9 @@ sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ # We do not want the libtool archives rm %{buildroot}%{_libdir}/*.la +# We do not want the manifest of files for uninstalling +rm %{buildroot}%{python3_sitelib}/pyeantic/install_files.txt + # Documentation is installed below rm -fr %{buildroot}%{_docdir} @@ -65,18 +106,25 @@ rm -fr %{buildroot}%{_docdir} LD_LIBRARY_PATH=$PWD/.libs make check %files -%doc AUTHORS README poly_extra/doc/poly_extra.txt +%doc AUTHORS README.md %license COPYING COPYING.LESSER -%{_libdir}/libeantic.so.0* -%{_libdir}/libeanticxx.so.0* +%{_libdir}/libeantic.so.1* +%{_libdir}/libeanticxx.so.1* %files devel -%doc NEWS %{_includedir}/%{name}/ +%{_includedir}/libeantic/ %{_libdir}/libeantic.so %{_libdir}/libeanticxx.so +%files -n python3-pyeantic +%{python3_sitelib}/pyeantic* + %changelog +* Thu Jul 15 2021 Jerry James - 1.0.1-1 +- Version 1.0.1 +- Add the python3-pyeantic subpackage + * Tue Jan 26 2021 Fedora Release Engineering - 0.1.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 18ab0b4..e7d0876 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (e-antic-0.1.8.tar.gz) = 474d066e04270ffd04540e2a8cdb7d488862fa3f49d6bb625a261ce5fa53d4579050b4d4495135d855ceb849453ef29c18b9a1d06c7668204a06fe3fa7778836 +SHA512 (e-antic-1.0.1.tar.gz) = ca6525b082a506bb35f3b41d4cd29a7350c64b93653324ca38334505f456122912243419a5f4e56a8ba2d903041466c5140e4a83646f7ac3b2c5d756706500f2