Accepting request 845455 from home:badshah400:branches:science
- Update to version 2.3.2. - Drop patches incorporated upstream: * cadabra2-python-modules-location.patch. * Fix-linking-of-cadabra-module.patch. - Split out a separate package - jupyter-cadabra2-kernel - for the new jupyter notebook kernel. - Fix typo in `ENABLE_SYSTEM_JSONCPP` option passed to `%cmake`. - Set up but disable building and running tests until issues with the test-suite are sorted out [gh#kpeeters/cadabra2#211, gh#kpeeters/cadabra2#212]. OBS-URL: https://build.opensuse.org/request/show/845455 OBS-URL: https://build.opensuse.org/package/show/science/cadabra2?expand=0&rev=36
This commit is contained in:
parent
5232b74e10
commit
8e8d8b85fd
@ -1,26 +0,0 @@
|
||||
From 4df3e7cba29a9bb25a70badbc9de8aeef3693933 Mon Sep 17 00:00:00 2001
|
||||
From: Kasper Peeters <kasper.peeters@phi-sci.com>
|
||||
Date: Fri, 28 Aug 2020 21:12:58 +0100
|
||||
Subject: [PATCH] Link cadabra2.so to libpython.so if system requires it.
|
||||
|
||||
---
|
||||
core/CMakeLists.txt | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
|
||||
index 1d4c9851da..71570db28f 100644
|
||||
--- a/core/CMakeLists.txt
|
||||
+++ b/core/CMakeLists.txt
|
||||
@@ -305,6 +305,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(cadabra2 PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
target_link_libraries(cadabra2 PRIVATE ${PYTHON_LIBRARIES})
|
||||
+elseif(CMAKE_SHARED_LINKER_FLAGS MATCHES ".*-Wl,--no-undefined.*")
|
||||
+ # Exception for systems that require no undefined symbols present
|
||||
+ # in shared libraries (e.g. openSUSE).
|
||||
+ message("-- Linking cadabra2.so to libpython.so because of default linker flags.")
|
||||
+ target_link_libraries(cadabra2 PRIVATE ${PYTHON_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ENABLE_SYSTEM_JSONCPP)
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1ba2dd2c91e6678a49a136c181da4ec424f1cec9a7172cf95fd1b0c04c253217
|
||||
size 24169861
|
3
cadabra2-2.3.2.tar.gz
Normal file
3
cadabra2-2.3.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a17424f41703e4b5c72d44f2c3057f7ea10375ff4b41bbb1675d665a86a489ca
|
||||
size 24376316
|
@ -1,103 +0,0 @@
|
||||
Index: cadabra2-2.3.0/CMakeLists.txt
|
||||
===================================================================
|
||||
--- cadabra2-2.3.0.orig/CMakeLists.txt
|
||||
+++ cadabra2-2.3.0/CMakeLists.txt
|
||||
@@ -231,6 +231,9 @@ endif()
|
||||
|
||||
print_header("Configuring Python")
|
||||
|
||||
+# NEEDED TO USE CMAKE_INSTALL_FULL<dir>
|
||||
+include(GNUInstallDirs)
|
||||
+
|
||||
if(USE_PYTHON_3)
|
||||
set(PYTHON_POSTFIX "3")
|
||||
message(STATUS "Building for use with Python 3 (good!)")
|
||||
@@ -243,9 +246,17 @@ add_subdirectory(libs/pybind11)
|
||||
|
||||
message(STATUS "Found python ${PYTHON_LIBRARIES}")
|
||||
|
||||
-# We install the python module in our 'share' path, not in
|
||||
-# the site-wide path as we used to.
|
||||
-set(PYTHON_SITE_PATH share/cadabra2/python)
|
||||
+if(${CMAKE_VERSION} VERSION_LESS 3.12.0)
|
||||
+ find_package(PythonInterp)
|
||||
+ set(PYTHON_SITE_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
|
||||
+else()
|
||||
+ find_package (Python COMPONENTS Interpreter)
|
||||
+ set(PYTHON_SITE_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
|
||||
+endif()
|
||||
+
|
||||
+string(REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "" PYTHON_SITE_PATH_REL ${PYTHON_SITE_PATH})
|
||||
+set(PYTHON_SITE_PATH_REL ${PYTHON_SITE_PATH_REL})
|
||||
+
|
||||
if(NOT WIN32)
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import site; print (site.getsitepackages()[0]);"
|
||||
Index: cadabra2-2.3.0/core/cadabra2.in
|
||||
===================================================================
|
||||
--- cadabra2-2.3.0.orig/core/cadabra2.in
|
||||
+++ cadabra2-2.3.0/core/cadabra2.in
|
||||
@@ -19,10 +19,9 @@ import rlcompleter
|
||||
import os
|
||||
|
||||
# Make sure we can find the cadabra2 python module; is always
|
||||
-# installed in ../share/cadabra2/python relative to the location
|
||||
-# of the 'cadabra2' script.
|
||||
+# installed in PYTHON_SITE_PATH
|
||||
install_prefix=os.path.realpath(sys.argv[0])
|
||||
-install_prefix=install_prefix.replace(os.sep+'bin'+os.sep+'cadabra2', os.sep+'share'+os.sep+'cadabra2'+os.sep+'python')
|
||||
+install_prefix=install_prefix.replace(os.sep+'bin'+os.sep+'cadabra2', '${PYTHON_SITE_PATH_REL}')
|
||||
# print("Module path ", install_prefix)
|
||||
sys.path.append(install_prefix)
|
||||
|
||||
@@ -256,5 +255,5 @@ if __name__ == '__main__':
|
||||
# pulling in the right locals/globals
|
||||
# sh.interact(banner='Info at http://cadabra.phi-sci.com/\nAvailable under the terms of the GNU General Public License v3\n', locals(), globals())
|
||||
else:
|
||||
- sh.runsource("import os; import sys; install_prefix=os.path.realpath(sys.argv[0]); install_prefix=install_prefix.replace('/bin/cadabra2','/share/cadabra2/python'); sys.path.append(install_prefix); print('Cadabra @CADABRA_VERSION_MAJOR@.@CADABRA_VERSION_MINOR@.@CADABRA_VERSION_PATCH@ (build @CADABRA_VERSION_BUILD@ dated @CADABRA_VERSION_DATE@)'); print ('Copyright (C) @COPYRIGHT_YEARS@ Kasper Peeters <kasper.peeters@phi-sci.com>'); f=open('${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_PATH}/cadabra2_defaults.py'); code=compile(f.read(), 'cadabra2_defaults.py', 'exec'); exec(code); f.close(); print('Using SymPy version '+sympy.__version__);")
|
||||
+ sh.runsource("import os; import sys; install_prefix=os.path.realpath(sys.argv[0]); install_prefix=install_prefix.replace('/bin/cadabra2','${PYTHON_SITE_PATH_REL}'); sys.path.append(install_prefix); print('Cadabra @CADABRA_VERSION_MAJOR@.@CADABRA_VERSION_MINOR@.@CADABRA_VERSION_PATCH@ (build @CADABRA_VERSION_BUILD@ dated @CADABRA_VERSION_DATE@)'); print ('Copyright (C) @COPYRIGHT_YEARS@ Kasper Peeters <kasper.peeters@phi-sci.com>'); f=open('${PYTHON_SITE_PATH}/cadabra2_defaults.py'); code=compile(f.read(), 'cadabra2_defaults.py', 'exec'); exec(code); f.close(); print('Using SymPy version '+sympy.__version__);")
|
||||
sh.interact(banner='Info at http://cadabra.science/\nAvailable under the terms of the GNU General Public License v3\n')
|
||||
Index: cadabra2-2.3.0/core/cadabra2-cli.cc
|
||||
===================================================================
|
||||
--- cadabra2-2.3.0.orig/core/cadabra2-cli.cc
|
||||
+++ cadabra2-2.3.0/core/cadabra2-cli.cc
|
||||
@@ -113,7 +113,7 @@ void Shell::restart()
|
||||
}
|
||||
|
||||
sys = PyImport_ImportModule("sys");
|
||||
- std::string module_path = cadabra::install_prefix() + "/share/cadabra2/python";
|
||||
+ std::string module_path = PYTHON_SITE_PATH;
|
||||
PyObject* module_path_str = PyUnicode_FromString(module_path.c_str());
|
||||
PyList_Append(PyObject_GetAttrString(sys, "path"), module_path_str);
|
||||
Py_XDECREF(module_path_str);
|
||||
@@ -122,7 +122,7 @@ void Shell::restart()
|
||||
void Shell::interact()
|
||||
{
|
||||
// Run cadabra2_defaults.py
|
||||
- if (!execute_file(cadabra::install_prefix() + "/share/cadabra2/python/cadabra2_defaults.py", false)) {
|
||||
+ if (!execute_file(std::string(PYTHON_SITE_PATH) + "/cadabra2_defaults.py", false)) {
|
||||
handle_error();
|
||||
throw ExitRequest("Error encountered while initializing the interpreter");
|
||||
}
|
||||
Index: cadabra2-2.3.0/core/Config.hh.in
|
||||
===================================================================
|
||||
--- cadabra2-2.3.0.orig/core/Config.hh.in
|
||||
+++ cadabra2-2.3.0/core/Config.hh.in
|
||||
@@ -21,3 +21,4 @@
|
||||
#define Mathematica_KERNEL_EXECUTABLE "@Mathematica_KERNEL_EXECUTABLE@"
|
||||
|
||||
#define PYTHON_SITE_PATH "@PYTHON_SITE_PATH@"
|
||||
+#define PYTHON_SITE_PATH_REL "@PYTHON_SITE_PATH_REL@"
|
||||
Index: cadabra2-2.3.0/client_server/Server.cc
|
||||
===================================================================
|
||||
--- cadabra2-2.3.0.orig/client_server/Server.cc
|
||||
+++ cadabra2-2.3.0/client_server/Server.cc
|
||||
@@ -106,7 +106,7 @@ void Server::init()
|
||||
|
||||
// Make the C++ CatchOutput class visible on the Python side.
|
||||
|
||||
- auto python_path = cadabra::install_prefix()+"/share/cadabra2/python";
|
||||
+ auto python_path = std::string(PYTHON_SITE_PATH);
|
||||
|
||||
std::string stdOutErr =
|
||||
"import sys\n"
|
@ -1,3 +1,39 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 1 09:55:08 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
- Update to version 2.3.2:
|
||||
* Fixed bug in pattern matching logic used in
|
||||
integrate_by_parts.
|
||||
* Fixed bug which would prevent assignment to node multiplier
|
||||
from Python.
|
||||
* Tab-completion on command line and in the notebook.
|
||||
* Install the cadabra2 python module in a standard location.
|
||||
* Fixes for the Mathematica scalar backend.
|
||||
* Make expand_delta much faster when the Kronecker delta is
|
||||
contracted with objects which have anti-symmetry.
|
||||
* Make meld work correctly with non/anti-commuting objects.
|
||||
* Make numbered indices like a1 display with a subscript
|
||||
automatically a<sub>1</sub>.
|
||||
* Provide pickle functionality for expressions.
|
||||
* Fixes for compatibility with newer SymPy versions.
|
||||
* Added a 'find' function in the notebook, to search input
|
||||
cells.
|
||||
* New Jupyter kernel (enabled by default) which does not require
|
||||
Xeus.
|
||||
* Various improvements and fixed for handling and display of
|
||||
Young tableaux.
|
||||
* Added ExNode::ex() to obtain an Ex object from an ExNode
|
||||
iterator.
|
||||
- Drop patches incorporated upstream:
|
||||
* cadabra2-python-modules-location.patch.
|
||||
* Fix-linking-of-cadabra-module.patch.
|
||||
- Split out a separate package - jupyter-cadabra2-kernel - for the
|
||||
new jupyter notebook kernel.
|
||||
- Fix typo in `ENABLE_SYSTEM_JSONCPP` option passed to `%cmake`.
|
||||
- Set up but disable building and running tests until issues with
|
||||
the test-suite are sorted out [gh#kpeeters/cadabra2#211,
|
||||
gh#kpeeters/cadabra2#212].
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 28 20:52:48 UTC 2020 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
|
@ -16,8 +16,10 @@
|
||||
#
|
||||
|
||||
|
||||
# Tests fails due to the way PYTHONPATH is set up for the test-suite [gh#kpeeters/cadabra2#211, gh#kpeeters/cadabra2#212]
|
||||
%bcond_with tests
|
||||
Name: cadabra2
|
||||
Version: 2.3.0
|
||||
Version: 2.3.2
|
||||
Release: 0
|
||||
Summary: A computer algebra system for solving problems in field theory
|
||||
License: GPL-3.0-or-later
|
||||
@ -25,10 +27,6 @@ Group: Productivity/Scientific/Math
|
||||
URL: https://cadabra.science/
|
||||
Source0: https://github.com/kpeeters/cadabra2/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: %{name}-gtk.appdata.xml
|
||||
# PATCH-FIX-UPSTREAM -- https://github.com/kpeeters/cadabra2/commit/4df3e7cba29a9bb25a70badbc9de8aeef3693933 (gh#kpeeters/cadabra2#202)
|
||||
Patch2: Fix-linking-of-cadabra-module.patch
|
||||
# PATCH-FIX-UPSTREAM cadabra2-python-modules-location.patch gh#kpeeters/cadabra2#203 badshah400@gmail.com -- Move python modules to standard python modules path
|
||||
Patch3: cadabra2-python-modules-location.patch
|
||||
BuildRequires: appstream-glib
|
||||
BuildRequires: cmake
|
||||
BuildRequires: doxygen
|
||||
@ -46,6 +44,7 @@ BuildRequires: libuuid-devel
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-ipykernel
|
||||
BuildRequires: python3-matplotlib
|
||||
BuildRequires: python3-sympy
|
||||
BuildRequires: update-desktop-files
|
||||
@ -54,6 +53,11 @@ BuildRequires: pkgconfig(gtkmm-3.0)
|
||||
BuildRequires: pkgconfig(jsoncpp)
|
||||
BuildRequires: pkgconfig(sqlite3)
|
||||
Recommends: %{name}-doc
|
||||
# SECTION For test
|
||||
%if %{with tests}
|
||||
BuildRequires: python3-gmpy2
|
||||
%endif
|
||||
# /SECTION
|
||||
Recommends: %{name}-examples
|
||||
|
||||
%description
|
||||
@ -115,10 +119,20 @@ the solution of problems encountered in field theory.
|
||||
|
||||
This package provides html documentation for %{name}.
|
||||
|
||||
%package -n jupyter-cadabra2-kernel
|
||||
Summary: Jupyter kernel for cadabra2
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %{name} = %{version}
|
||||
Requires: jupyter-notebook
|
||||
|
||||
%description -n jupyter-cadabra2-kernel
|
||||
Cadabra2 is a computer algebra system (CAS) designed specifically for
|
||||
the solution of problems encountered in field theory.
|
||||
|
||||
This package provides a jupyter kernel for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%autosetup -p1
|
||||
rm examples/.gitignore
|
||||
# Remove timestamps from Doxygen HTML files
|
||||
echo "HTML_TIMESTAMP = NO" >> config/Doxyfile
|
||||
@ -130,13 +144,13 @@ sed -i "1{/#!\/usr\/bin\/env python/d}" libs/appdirs/cdb_appdirs.py
|
||||
-DCMAKE_MANDIR:PATH=%{_mandir} \
|
||||
-DINSTALL_LATEX_DIR:PATH=%{_datadir}/texmf \
|
||||
-DENABLE_FRONTEND:BOOL=ON \
|
||||
-DENABLE_SYSTEM_JSONPP:BOOL=ON \
|
||||
-DENABLE_SYSTEM_JSONCPP:BOOL=ON \
|
||||
-DENABLE_MATHEMATICA:BOOL=OFF \
|
||||
-DBUILD_TESTS:BOOL=ON
|
||||
-DBUILD_TESTS:BOOL=%{?_with_tests:ON}%{!?_with_tests:OFF}
|
||||
|
||||
%cmake_build
|
||||
cd ..
|
||||
make %{?_smp_mflags} doc
|
||||
%make_build doc
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
@ -152,9 +166,13 @@ sed -E -i "s|^#!/usr/bin/env python3|#!/usr/bin/python3|" %{buildroot}%{_bindir}
|
||||
mkdir -p %{buildroot}%{_datadir}/texmf/tex/latex/cadabra2/
|
||||
ln %{buildroot}%{_datadir}/cadabra2/latex/* %{buildroot}%{_datadir}/texmf/tex/latex/cadabra2/
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
%if %{with tests}
|
||||
%check
|
||||
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
||||
export PATH=${PATH}:%{buildroot}%{_bindir}
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
%ctest
|
||||
%endif
|
||||
|
||||
%files
|
||||
%doc README.rst
|
||||
@ -168,16 +186,26 @@ ln %{buildroot}%{_datadir}/cadabra2/latex/* %{buildroot}%{_datadir}/texmf/tex/la
|
||||
%{_bindir}/%{name}html
|
||||
%{_datadir}/%{name}/
|
||||
%{_datadir}/texmf
|
||||
%{python3_sitearch}/*
|
||||
%{python3_sitearch}/cadabra2.so
|
||||
%{python3_sitearch}/cadabra2_defaults.py
|
||||
%{python3_sitearch}/cdb_appdirs.py
|
||||
%{python3_sitearch}/cdb/
|
||||
%{_mandir}/man1/cadabra*.1%{?ext_man}
|
||||
|
||||
%files gui
|
||||
%license doc/license.txt
|
||||
%{_bindir}/%{name}-gtk
|
||||
%{_datadir}/icons/hicolor/*/apps/cadabra2-gtk.*
|
||||
%{_datadir}/applications/cadabra2-gtk.desktop
|
||||
%dir %{_datadir}/metainfo
|
||||
%{_datadir}/metainfo/*.appdata.xml
|
||||
|
||||
%files -n jupyter-cadabra2-kernel
|
||||
%license doc/license.txt
|
||||
%{python3_sitearch}/cadabra2_jupyter/
|
||||
%{python3_sitearch}/notebook/
|
||||
%{_jupyter_kernel_dir}/cadabra2/
|
||||
|
||||
%files examples
|
||||
%doc examples/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user