Hello community, here is the log from the commit of package cadabra2 for openSUSE:Factory checked in at 2020-09-25 16:28:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cadabra2 (Old) and /work/SRC/openSUSE:Factory/.cadabra2.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cadabra2" Fri Sep 25 16:28:03 2020 rev:14 rq:831195 version:2.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/cadabra2/cadabra2.changes 2020-01-04 19:22:17.233162386 +0100 +++ /work/SRC/openSUSE:Factory/.cadabra2.new.4249/cadabra2.changes 2020-09-25 16:29:59.619808429 +0200 @@ -1,0 +2,33 @@ +Fri Aug 28 20:52:48 UTC 2020 - Atri Bhattacharya <badshah...@gmail.com> + +- Refresh Fix-linking-of-cadabra-module.patch with fix for same + issue committed upstream [gh#kpeeters/cadabra2#202]. + +------------------------------------------------------------------- +Thu Jul 9 22:19:27 UTC 2020 - Atri Bhattacharya <badshah...@gmail.com> + +- Update to version 2.3.0: + * Fix bug which would collect powers of objects with indices and + then report an error. + * Functionality to read Cadabra Cloud notebooks into the desktop + Cadabra. + * Use a better hash function for expression trees (avoiding a + bug in factor_in). + * Expose index symmetries through traces, so that canonicalise + and related algorithms work correctly. Introduced a new + property TableauInherit. + * More flexible LaTeXForm property, to enable more flexible + object display in the notebook. + * Various fixes for behaviour of unwrap with anti- or + non-commuting arguments. + * New meld algorithm for canonicalisation. +- Drop cadabra2-add-pthread-to-cxxflags.patch: No longer required + for building. +- Add cadabra2-python-modules-location.patch to fix location of + python libs and modules (gh#kpeeters/cadabra2#203). +- Rebase Fix-linking-of-cadabra-module.patch for update; only + partially fixed by upstream (gh#kpeeters/cadabra2#202). +- Remove a hashbang from a non-executable script. +- Use %{name}-%{version} naming format for source. + +------------------------------------------------------------------- Old: ---- 2.2.8.tar.gz cadabra2-add-pthread-to-cxxflags.patch New: ---- cadabra2-2.3.0.tar.gz cadabra2-python-modules-location.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cadabra2.spec ++++++ --- /var/tmp/diff_new_pack.JkH1iH/_old 2020-09-25 16:30:00.227808967 +0200 +++ /var/tmp/diff_new_pack.JkH1iH/_new 2020-09-25 16:30:00.231808971 +0200 @@ -17,18 +17,18 @@ Name: cadabra2 -Version: 2.2.8 +Version: 2.3.0 Release: 0 Summary: A computer algebra system for solving problems in field theory License: GPL-3.0-or-later Group: Productivity/Scientific/Math URL: https://cadabra.science/ -Source0: https://github.com/kpeeters/cadabra2/archive/%{version}.tar.gz +Source0: https://github.com/kpeeters/cadabra2/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: %{name}-gtk.appdata.xml -# PATCH-FIX-OPENSUSE add -pthread to CMAKE_CXX_FLAGS (as adivised in https://github.com/potree/PotreeConverter/issues/136) kkae...@suse.de -Patch1: cadabra2-add-pthread-to-cxxflags.patch -# PATCH-FIX-UPSTREAM -- https://github.com/kpeeters/cadabra2/commit/71a406f32a654d2037b1d011f44af3fce4d9b50d.patch +# 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 badshah...@gmail.com -- Move python modules to standard python modules path +Patch3: cadabra2-python-modules-location.patch BuildRequires: appstream-glib BuildRequires: cmake BuildRequires: doxygen @@ -117,21 +117,22 @@ %prep %setup -q -%patch1 -p1 %patch2 -p1 +%patch3 -p1 rm examples/.gitignore # Remove timestamps from Doxygen HTML files echo "HTML_TIMESTAMP = NO" >> config/Doxyfile +# REMOVE HASHBANG FROM NON-EXEC SCRIPT +sed -i "1{/#!\/usr\/bin\/env python/d}" libs/appdirs/cdb_appdirs.py %build %cmake \ - -DCMAKE_MANDIR=%{_mandir} \ - -DPACKAGING_MODE=ON \ - -DINSTALL_LATEX_DIR=%{_datadir}/texmf \ - -DENABLE_FRONTEND=ON \ - -DENABLE_SYSTEM_JSONPP=ON \ - -DENABLE_MATHEMATICA=OFF \ - .. + -DCMAKE_MANDIR:PATH=%{_mandir} \ + -DINSTALL_LATEX_DIR:PATH=%{_datadir}/texmf \ + -DENABLE_FRONTEND:BOOL=ON \ + -DENABLE_SYSTEM_JSONPP:BOOL=ON \ + -DENABLE_MATHEMATICA:BOOL=OFF \ + -DBUILD_TESTS:BOOL=ON %cmake_build cd .. @@ -162,10 +163,12 @@ %{_bindir}/cadabra2latex %{_bindir}/cadabra-server %{_bindir}/%{name} +%{_bindir}/%{name}-cli %{_bindir}/%{name}python %{_bindir}/%{name}html %{_datadir}/%{name}/ %{_datadir}/texmf +%{python3_sitearch}/* %{_mandir}/man1/cadabra*.1%{?ext_man} %files gui ++++++ Fix-linking-of-cadabra-module.patch ++++++ --- /var/tmp/diff_new_pack.JkH1iH/_old 2020-09-25 16:30:00.251808989 +0200 +++ /var/tmp/diff_new_pack.JkH1iH/_new 2020-09-25 16:30:00.251808989 +0200 @@ -1,31 +1,26 @@ -From 71a406f32a654d2037b1d011f44af3fce4d9b50d Mon Sep 17 00:00:00 2001 +From 4df3e7cba29a9bb25a70badbc9de8aeef3693933 Mon Sep 17 00:00:00 2001 From: Kasper Peeters <kasper.peet...@phi-sci.com> -Date: Fri, 13 Dec 2019 18:02:59 +0000 -Subject: [PATCH] Fix linking of cadabra module. +Date: Fri, 28 Aug 2020 21:12:58 +0100 +Subject: [PATCH] Link cadabra2.so to libpython.so if system requires it. --- - cmake/version.cmake | 2 +- - core/CMakeLists.txt | 7 +++++-- - 2 files changed, 6 insertions(+), 3 deletions(-) + core/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index d9356682ba..8141820ab8 100644 +index 1d4c9851da..71570db28f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt -@@ -216,6 +218,7 @@ set(LOCAL_SRC_FILES - SympyCdb.cc - YoungTab.cc - modules/xperm_new.cc -+ ${CADABRA_LIBS_DIR}/whereami/whereami.c - ${ALGORITHM_SRC_FILES} - ${PROPERTY_SRC_FILES} - ) -@@ -278,6 +279,8 @@ target_link_libraries(cadabra2 PRIVATE - ${GMPXX_LIBRARIES} - ${GMP_LIBRARIES} - ${Boost_LIBRARIES} -+ ${PYTHON_LIBRARIES} -+ ${GLIBMM3_LIBRARIES} - ) +@@ -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) - target_link_libraries(cadabra2 PRIVATE + ++++++ cadabra2-python-modules-location.patch ++++++ 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.peet...@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.peet...@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"