Update to sagemath 8.8 (bz 1724394).

Also:
- Remove configparser dependencies (bz 1706597).
- Fix broken sed conversion (bz 1706234).
- Fix python2 versus python3 snafu (bz 1706337, 1707166).
- Build and install sagetex (bz 1706322).
This commit is contained in:
Jerry James 2019-07-01 21:20:44 -06:00
parent 05337076b6
commit 5a519c8e85
15 changed files with 277 additions and 497 deletions

View file

@ -40,15 +40,18 @@
%global combinatorial_designs_pkg combinatorial_designs-20140630
%global conway_polynomials_pkg conway_polynomials-0.5
%global elliptic_curves_pkg elliptic_curves-0.8
%global elliptic_curves_pkg elliptic_curves-0.8.1
%global flintqs_pkg flintqs-1.0
%global graphs_pkg graphs-20161026
%if %{with bundled_ipython}
%global ipython_pkg ipython-5.8.0
%global prompt_tookit_pkg prompt_toolkit-1.0.15
%global ipython_ver 5.8.0
%global ipython_pkg ipython-%{ipython_ver}
%global prompt_toolkit_ver 1.0.15
%global prompt_tookit_pkg prompt_toolkit-%{prompt_toolkit_ver}
%endif
%if %{with bundled_ipywidgets}
%global ipywidgets_pkg ipywidgets-7.4.2
%global ipywidgets_ver 7.4.2
%global ipywidgets_pkg ipywidgets-%{ipywidgets_ver}
%endif
%if %{with bundled_pexpect}
%global pexpect_pkg pexpect-4.6.0
@ -58,16 +61,19 @@
%global sagenb_pkg sagenb-1.1.2
%global sagenb_export_pkg sagenb_export-3.2
%global sagetex_pkg sagetex-3.2
%global Sphinx_pkg Sphinx-1.7.6
%global Sphinx_pkg Sphinx-1.8.5
%global singular_pkg singular-4.1.1p3
%if %{with bundled_thebe}
%global thebe_pkg thebe-9624e0a0
%global thebe_ver 9624e0a0
%global thebe_pkg thebe-%{thebe_ver}
%endif
%if %{with bundled_threejs}
%global threejs_pkg threejs-r80
%global threejs_ver r100
%global threejs_pkg threejs-%{threejs_ver}
%endif
%if %{with bundled_widgetsnbextension}
%global widgetsnbextension_pkg widgetsnbextension-3.4.2
%global widgetsnbextension_ver 3.4.2
%global widgetsnbextension_pkg widgetsnbextension-%{widgetsnbextension_ver}
%endif
# Spkg equivalents of required rpms; we pretend they are installed as spkgs.
@ -86,7 +92,7 @@
Name: sagemath
Summary: A free open-source mathematics software system
Version: 8.7
Version: 8.8
Release: 1%{?dist}
# The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file
# Additionally, every $files section has a comment with the license name
@ -108,7 +114,6 @@ Patch1: %{name}-random.patch
Patch2: %{name}-scripts.patch
# remove call to not implemented sagemath "is_package_installed" interfaces
# need to package coin-or solver in fedora
# remove check for non free solvers
Patch3: %{name}-extensions.patch
@ -148,8 +153,6 @@ Patch11: %{name}-cremona.patch
Patch12: %{name}-python3.patch
# correct path to the nauty geng program
# http://cs.anu.edu.au/~bdm/nauty/
# http://pallini.di.uniroma1.it/
Patch13: %{name}-nauty.patch
# remove the buildroot path from Cython output
@ -204,6 +207,9 @@ Patch29: %{name}-rubiks.patch
# Fix an indentation error in sagetex
Patch30: %{name}-sagetex.patch
# Fix some path settings in the sage environment
Patch31: %{name}-env.patch
BuildRequires: 4ti2
BuildRequires: arb-devel
BuildRequires: boost-devel
@ -228,10 +234,14 @@ BuildRequires: gap-pkg-crime
BuildRequires: gap-pkg-design
BuildRequires: gap-pkg-guava
BuildRequires: gap-pkg-hapcryst
BuildRequires: gap-pkg-happrime
BuildRequires: gap-pkg-sonata
BuildRequires: gap-pkg-toric
BuildRequires: gc-devel
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: gcc-objc
BuildRequires: gcc-objc++
BuildRequires: gd-devel
BuildRequires: gdb
BuildRequires: gfan
@ -272,6 +282,7 @@ BuildRequires: pari-devel
BuildRequires: pari-galdata
BuildRequires: pari-gp
BuildRequires: pari-seadata
BuildRequires: perl-generators
BuildRequires: planarity-devel
BuildRequires: ppl-devel
BuildRequires: pynac-devel
@ -281,9 +292,6 @@ BuildRequires: python3-cysignals-devel
BuildRequires: python3-pillow-devel
BuildRequires: python3-pplpy-devel
BuildRequires: python3dist(brial)
%if %{with sphinx_hack}
BuildRequires: python3dist(configparser)
%endif
BuildRequires: python3dist(cvxopt)
BuildRequires: python3dist(cython)
BuildRequires: python3dist(docutils)
@ -320,7 +328,7 @@ BuildRequires: python3dist(psutil)
BuildRequires: python3dist(ptyprocess)
BuildRequires: python3dist(pycryptosat)
%if %{with bundled_ipython}
BuildRequires: python3dist(pyzmq)
BuildRequires: python3dist(pyzmq)
%endif
BuildRequires: python3dist(rpy2)
BuildRequires: python3dist(scipy)
@ -368,6 +376,7 @@ Requires: gap-pkg-crime
Requires: gap-pkg-design
Requires: gap-pkg-guava
Requires: gap-pkg-hapcryst
Requires: gap-pkg-happrime
Requires: gap-pkg-sonata
Requires: gap-pkg-toric
Requires: gfan
@ -387,9 +396,6 @@ Requires: pari-galdata
Requires: pari-gp
Requires: pari-seadata
Requires: python3dist(brial)
%if %{with sphinx_hack}
Requires: python3dist(configparser)
%endif
Requires: python3dist(cypari2)
Requires: python3dist(cysignals)
Requires: python3dist(cvxopt)
@ -460,10 +466,10 @@ Requires: texlive
Requires: vecmath
%if %{with bundled_thebe}
Provides: bundled(thebe) = %(cut -d- -f2- <<< %{thebe_pkg})
Provides: bundled(thebe) = %{thebe_ver}
%endif
%if %{with bundled_threejs}
Provides: bundled(threejs) = %(cut -d- -f2- <<< %{threejs_pkg})
Provides: bundled(threejs) = %{threejs_ver}
%endif
%description
@ -476,14 +482,14 @@ packages into a common Python-based interface.
Summary: Open Source Mathematics Software
Requires: %{name}%{?_isa} = %{version}-%{release}
%if %{with bundled_ipython}
Provides: bundled(ipython) = %(cut -d- -f2- <<< %{ipython_pkg})
Provides: bundled(prompt_toolkit) = %(cut -d- -f2- <<< %{prompt_tookit_pkg})
Provides: bundled(ipython) = %{ipython_ver}
Provides: bundled(prompt_toolkit) = %{prompt_toolkit_ver}
%endif
%if %{with bundled_ipywidgets}
Provides: bundled(ipywidgets) = %(cut -d- -f2- <<< %{ipywidgets_pkg})
Provides: bundled(ipywidgets) = %{ipywidgets_ver}
%endif
%if %{with bundled_widgetsnbextension}
Provides: bundled(widgetsnbextension) = %(cut -d- -f2- <<< %{widgetsnbextension_pkg})
Provides: bundled(widgetsnbextension) = %{widgetsnbextension_ver}
%endif
%description core
@ -772,7 +778,7 @@ pushd build/pkgs/pexpect
tar zxf ../../../upstream/%{pexpect_pkg}.tar.gz
mv %{pexpect_pkg} src
pushd src
for diff in `ls ../patches/*.patch`; do
for diff in ../patches/*.patch; do
patch -p1 < $diff
done
popd
@ -788,7 +794,7 @@ pushd build/pkgs/rubiks
tar jxf ../../../upstream/%{rubiks_pkg}.tar.bz2
mv %{rubiks_pkg} src
pushd src
for diff in `ls ../patches/*.patch`; do
for diff in ../patches/*.patch; do
patch -p1 < $diff
done
popd
@ -808,7 +814,7 @@ pushd build/pkgs/sagetex
tar zxf ../../../upstream/%{sagetex_pkg}.tar.gz
mv %{sagetex_pkg} src
# Fix the style file install path
texmfdir=$(cut -d/ -f3- <<< "%{_texmf_main}")
texmfdir=$(cut -d/ -f3- <<< "%{_texmf}")
sed -i "s,share/texmf,$texmfdir," src/setup.py
popd
@ -818,7 +824,7 @@ pushd build/pkgs/sphinx
tar zxf ../../../upstream/%{Sphinx_pkg}.tar.gz
mv %{Sphinx_pkg} src
pushd src
for diff in `ls ../patches/*.patch`; do
for diff in ../patches/*.patch; do
patch -p1 < $diff
done
popd
@ -884,9 +890,11 @@ popd
%patch28
%patch29
%patch30
%patch31
sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \
-e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \
-e 's|@@SAGE_LOCAL@@|%{SAGE_LOCAL}|' \
-i src/sage/env.py
sed -e 's|@@CYSIGNALS@@|%{python3_sitearch}/cysignals|' \
@ -898,7 +906,7 @@ sed -e "/flask-oldsessions/d" \
#------------------------------------------------------------------------
# some .c files are not (re)generated
find src/sage \( -name \*.pyx -o -name \*.pxd \) | xargs touch
find src/sage \( -name \*.pyx -o -name \*.pxd \) -exec touch {} \+
# remove bundled jar files before build
rm build/pkgs/sagenb/src/sagenb/data/sage3d/lib/sage3d.jar
@ -915,11 +923,15 @@ sed -e "s,\(SINGULAR_SO = \)SAGE.*,\1'%{_libdir}/libSingular-$singver.so'," \
-i src/sage/env.py
# fix shebangs; some paths contains spaces, so use the null byte facility
grep -FrlZ '#!%{_bindir}/env python3' | \
xargs -0 sed -i 's,#!%{_bindir}/env python3,#!%{__python3},g'
grep -FrlZ '#!%{_bindir}/env python' | \
xargs -0 sed -i 's,#!%{_bindir}/env python,#!%{__python3},'
xargs -0 sed -i 's,#!%{_bindir}/env python,#!%{__python3},g'
grep -FrlZ '#!%{_bindir}/env sage-system-python' | \
xargs -0 sed -i 's,#!%{_bindir}/env sage-system-python,#!%{__python3},g'
grep -FrlZ '#!%{_bindir}/env sage-python23' | \
xargs -0 sed -i 's,#!%{_bindir}/env sage-python23,#!%{__python3},'
grep -FrlZ 'sage-python23' | xargs -0 sed -i 's,sage-python23,#!%{__python3},'
xargs -0 sed -i 's,#!%{_bindir}/env sage-python23,#!%{__python3},g'
grep -FrlZ 'sage-python23' | xargs -0 sed -i 's,sage-python23,python3,g'
grep -FrlZ '#!%{_bindir}/env' | \
xargs -0 sed -i 's,#!%{_bindir}/env ,#!%{_bindir}/,'
grep -rlZ '#!%{_bindir}/python$' | xargs -0 sed -i 's,#!%{_bindir}/python$,&3,'
@ -938,7 +950,7 @@ sed -e "s|'%{_bindir}/env', 'which'|'%{_bindir}/which'|" \
%endif
# GAP does not have enough memory to load the entire workspace
sed -i 's/64m/128m/' src/sage/libs/gap/util.pyx
sed -i 's/64m/128m/' src/sage/interfaces/gap.py
########################################################################
@ -947,6 +959,7 @@ export CC=%{__cc}
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export SAGE_PYTHON_VERSION=3
export SAGE_PYTHON3=yes
export SAGE_ROOT=%{buildroot}%{SAGE_ROOT}
export SAGE_LOCAL=%{buildroot}%{SAGE_LOCAL}
# Avoid buildroot in gcc command line (use _builddir instead)
@ -973,6 +986,22 @@ export PATH=%{buildroot}%{_bindir}:$PATH
export PYTHON=%{_bindir}/python3
export PYTHONPATH=%{buildroot}%{python3_sitearch}:$PYTHONPATH
#------------------------------------------------------------------------
# Generate sage-env-config
sed -e 's,@prefix@,%{SAGE_LOCAL},' \
-e 's,@CC@,gcc,' \
-e 's,@CXX@,g++,' \
-e 's,@FC@,gfortran,' \
-e 's,@OBJC@,gcc,' \
-e 's,@OBJCXX@,g++,' \
-e 's,@SAGE_PYTHON_VERSION@,3,' \
-e 's,@SAGE_GMP_PREFIX@,,' \
-e 's,@SAGE_GMP_INCLUDE@,%{_includedir},' \
-e 's,@SAGE_MPFR_PREFIX@,,' \
-e 's,@SAGE_MPC_PREFIX@,,' \
-e 's,@SAGE_NTL_PREFIX@,,' \
src/bin/sage-env-config.in > src/bin/sage-env-config
#------------------------------------------------------------------------
# Save and update environment to generate bundled interfaces
save_PATH=$PATH
@ -1036,6 +1065,10 @@ pushd build/pkgs/sagenb_export/src
%__python3 ./setup.py build
popd
pushd build/pkgs/sagetex/src
%__python3 ./setup.py build
popd
#------------------------------------------------------------------------
pushd build/pkgs/flintqs/src
%configure
@ -1088,7 +1121,7 @@ ln -sf %{_datadir} $SAGE_LOCAL/share
#------------------------------------------------------------------------
pushd src/ext
mkdir -p $SAGE_ETC
for dir in \
for dir in \
gap \
graphs \
images \
@ -1159,6 +1192,7 @@ pushd src/bin
ln -sf %{_bindir}/gp sage_pari
ln -sf %{_bindir}/gap gap
ln -sf %{_bindir}/gmp-ecm ecm
rm -f sage-env-config.in
popd
popd
install -p -m755 src/bin/sage $SAGE_LOCAL/bin
@ -1260,7 +1294,7 @@ popd
#------------------------------------------------------------------------
pushd build/pkgs/sagetex/src
%py3_install "--install-purelib=%{python3_sitearch}"
mv %{buildroot}%{_texmf_main}/tex/latex/sagetex/CONTRIBUTORS \
mv %{buildroot}%{_texmf}/tex/latex/sagetex/CONTRIBUTORS \
%{buildroot}%{_docdir}/sagetex
for file in PKG-INFO README; do
install -p -m 0644 $file %{buildroot}%{_docdir}/sagetex/$file
@ -1316,6 +1350,7 @@ export SAGE_SHARE="$SAGE_SHARE"
export SAGE_EXTCODE="$SAGE_ETC"
export SAGE_ETC="$SAGE_ETC"
export SAGE_SRC="%{buildroot}%{SAGE_SRC}"
export SAGE_PYTHON3=yes
##export SAGE_DOC="$SAGE_DOC"
##export SAGE_DOC_SRC="\$SAGE_DOC"
##export SAGE_PKGS="\$SAGE_LOCAL/var/lib/sage/installed"
@ -1330,11 +1365,10 @@ export SINGULAR_SO=%{_libdir}/libSingular-4.1.1.so
export SAGE_FORTRAN=%{_bindir}/gfortran
export SAGE_FORTRAN_LIB=\`gfortran --print-file-name=libgfortran.so\`
export SYMPOW_DIR="\$DOT_SAGE/sympow"
export LD_LIBRARY_PATH=\$SAGE_ROOT/lib:\$LD_LIBRARY_PATH
# Required for sage -gdb
: \${SAGE_DEBUG:=no}
export SAGE_DEBUG
$SAGE_LOCAL/bin/sage "\$@"
exec $SAGE_LOCAL/bin/sage "\$@"
EOF
#------------------------------------------------------------------------
chmod +x %{buildroot}%{_bindir}/sage
@ -1379,9 +1413,9 @@ pushd src/doc
%if %{with sphinx_hack}
pushd ../../build/pkgs/sphinx/src
%py3_build
%py3_install "--install-purelib=%{python3_sitearch}"
rm -f %{buildroot}%{_bindir}/sphinx*
%py3_build
%py3_install "--install-purelib=%{python3_sitearch}"
rm -f %{buildroot}%{_bindir}/sphinx*
popd
%endif
@ -1461,7 +1495,7 @@ EOF
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
# Fix permissions
find %{buildroot} -name '*.so' | xargs chmod 755
find %{buildroot} -name '*.so' -exec chmod 755 {} \+
pushd %{buildroot}%{SAGE_LOCAL}/bin
chmod 755 QuadraticSieve
chmod 755 mcube dikcube cu2 size222 cubex optimal
@ -1476,7 +1510,7 @@ done
chmod -x %{buildroot}%{SAGE_DOC}/en/prep/media/Rplot001.png
# Documentation is not rebuilt (also corrects rpmlint warning of hidden file)
find %{buildroot}%{SAGE_DOC} -name .buildinfo -exec rm {} \+
find %{buildroot}%{SAGE_DOC} -name .buildinfo -delete
rm -fr %{buildroot}%{SAGE_DOC}/output/inventory
find %{buildroot}%{SAGE_DOC} -type d -name _sources -exec rm -fr {} \+
%endif
@ -1507,7 +1541,7 @@ done
popd
pushd %{buildroot}%{SAGE_SPKG_INST}
for pkg in %{SAGE_REQUIRED_PKGS}; do
mkdir $pkg
mkdir $pkg
done
popd
#------------------------------------------------------------------------
@ -1519,7 +1553,7 @@ while [ \$# -gt 0 ]; do
if [ x\$1 = x--no-version ]; then
NOVERSION=true
elif [ x\$1 = xinstalled ]; then
INSTALLED=yes
INSTALLED=yes
fi
shift
done
@ -1547,7 +1581,7 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage-list-packages
#------------------------------------------------------------------------
# Byte compile python files in nonstandard places
%py_byte_compile %{__python3} %{buildroot}%{_texmf_main}/tex/latex/sagetex
%py_byte_compile %{__python3} %{buildroot}%{_texmf}/tex/latex/sagetex
#------------------------------------------------------------------------
# Jupyter integration
@ -1829,11 +1863,19 @@ rm -fr $DOT_SAGE
%files sagetex
# GPLv2+
%{python3_sitearch}/sagetex*
%{_texmf_main}/tex/latex/sagetex
%{python3_sitearch}/__pycache__/sagetex*
%{_texmf}/tex/latex/sagetex
%doc %{_docdir}/sagetex
########################################################################
%changelog
* Mon Jul 1 2019 Jerry James <loganjerry@gmail.com> - 8.8-1
- Update to sagemath 8.8 (bz 1724394)
- Remove configparser dependencies (bz 1706597)
- Fix broken sed conversion (bz 1706234)
- Fix python2 versus python3 snafu (bz 1706337, 1707166)
- Build and install sagetex (bz 1706322)
* Sat Apr 27 2019 Jerry James <loganjerry@gmail.com> - 8.7-1
- Update to sagemath 8.7
- Drop upstreamed -giac patch