forked from pool/cadabra2
Atri Bhattacharya
cf94860cd3
* Add _service file to fetch sources from git to allow submodules to be included in tarball. * Add patches to fix build: cadabra2-cmake-correct-python-variable.patch, cadabra2-use-system-pybind11.patch, cadabra2-link-gmp.patch. * Drop cadabra2-link-python.patch: upstreamed. * Drop use of %suse_update_desktop_file: no longer needed. * Drop appdata file included as Source1, bundled files are now installed correctly. * Use python-rpm-macros and setup to build with newer pythons on Leap 15.X (does not yet work due to unavailability of python311-sympy and python311-ipykernel on these distros). OBS-URL: https://build.opensuse.org/package/show/science/cadabra2?expand=0&rev=60
87 lines
4.0 KiB
Diff
87 lines
4.0 KiB
Diff
Index: cadabra2-2.5.4/CMakeLists.txt
|
|
===================================================================
|
|
--- cadabra2-2.5.4.orig/CMakeLists.txt
|
|
+++ cadabra2-2.5.4/CMakeLists.txt
|
|
@@ -325,7 +325,7 @@ else()
|
|
# calling into python's 'site' package (and hoping that the 0th
|
|
# element is where we should be writing).
|
|
execute_process(
|
|
- COMMAND ${PYTHON_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
|
|
+ COMMAND ${Python_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
|
|
OUTPUT_VARIABLE PYTHON_SITE_PATH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
@@ -339,7 +339,7 @@ message(STATUS "Installing Python module
|
|
# contain the abi name. See
|
|
# https://www.python.org/dev/peps/pep-3149/
|
|
execute_process(
|
|
- COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"
|
|
+ COMMAND ${Python_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"
|
|
OUTPUT_VARIABLE PYTHON_SOABI
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
@@ -350,7 +350,7 @@ set(PYTHON_SITE_PATH_REL ${PYTHON_SITE_P
|
|
|
|
if(NOT WIN32)
|
|
execute_process(
|
|
- COMMAND ${PYTHON_EXECUTABLE} -c "import site; print (site.getsitepackages()[0]);"
|
|
+ COMMAND ${Python_EXECUTABLE} -c "import site; print (site.getsitepackages()[0]);"
|
|
OUTPUT_VARIABLE OLDER_PYTHON_SITE_PATH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
Index: cadabra2-2.5.4/core/cadabra2.in
|
|
===================================================================
|
|
--- cadabra2-2.5.4.orig/core/cadabra2.in
|
|
+++ cadabra2-2.5.4/core/cadabra2.in
|
|
@@ -1,4 +1,4 @@
|
|
-#!${PYTHON_EXECUTABLE}
|
|
+#!${Python_EXECUTABLE}
|
|
#
|
|
# \ingroup pythoncore
|
|
#
|
|
@@ -119,8 +119,8 @@ if __name__ == '__main__':
|
|
|
|
if len(sys.argv)>1:
|
|
if '-d' in sys.argv:
|
|
- #rs = "lldb -ex r --args ${PYTHON_EXECUTABLE} "+sys.argv[0];
|
|
- rs = "gdb -q -ex r --args ${PYTHON_EXECUTABLE} "+sys.argv[0];
|
|
+ #rs = "lldb -ex r --args ${Python_EXECUTABLE} "+sys.argv[0];
|
|
+ rs = "gdb -q -ex r --args ${Python_EXECUTABLE} "+sys.argv[0];
|
|
for a in sys.argv[1:]:
|
|
if a!='-d':
|
|
rs += " "+a
|
|
Index: cadabra2-2.5.4/jupyterkernel/kernelspec/kernel.json.in
|
|
===================================================================
|
|
--- cadabra2-2.5.4.orig/jupyterkernel/kernelspec/kernel.json.in
|
|
+++ cadabra2-2.5.4/jupyterkernel/kernelspec/kernel.json.in
|
|
@@ -1,6 +1,6 @@
|
|
{
|
|
"argv": [
|
|
- "@PYTHON_EXECUTABLE@", "-m", "cadabra2_jupyter", "-f", "{connection_file}"
|
|
+ "@Python_EXECUTABLE@", "-m", "cadabra2_jupyter", "-f", "{connection_file}"
|
|
],
|
|
"display_name":"Cadabra2",
|
|
"language":"python"
|
|
Index: cadabra2-2.5.4/tests/CMakeLists.txt
|
|
===================================================================
|
|
--- cadabra2-2.5.4.orig/tests/CMakeLists.txt
|
|
+++ cadabra2-2.5.4/tests/CMakeLists.txt
|
|
@@ -49,7 +49,7 @@ foreach(NBTEST ${NBTESTS})
|
|
ARGS ${CNBIN}/${NBTEST}.cnb ${CDBOUT}/${NBTEST}.cdb
|
|
COMMENT "Creating ${NBTEST} notebook...")
|
|
add_custom_target("${NBTEST}_test" ALL DEPENDS ${CDBOUT}/${NBTEST}.cdb)
|
|
- add_test(${NBTEST} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/core/cadabra2 ${CDBOUT}/${NBTEST}.cdb)
|
|
+ add_test(${NBTEST} ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/core/cadabra2 ${CDBOUT}/${NBTEST}.cdb)
|
|
set_tests_properties(${NBTEST} PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHONPATH};LANG=en_US.UTF-8;LC_ALL=en_US.UTF-8;PYTHONIOENCODING=utf-8")
|
|
endforeach()
|
|
|
|
@@ -100,7 +100,7 @@ if(MATHEMATICA_FOUND)
|
|
set(RTESTS ${RTESTS} mma)
|
|
endif()
|
|
foreach(RTEST ${RTESTS})
|
|
- add_test(${RTEST} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/core/cadabra2 ${CMAKE_SOURCE_DIR}/tests/${RTEST}.cdb)
|
|
+ add_test(${RTEST} ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/core/cadabra2 ${CMAKE_SOURCE_DIR}/tests/${RTEST}.cdb)
|
|
# We need to set the Python path so that we pick up the correct cadabra2.so Python module
|
|
# even if we did not do 'make install' yet.
|
|
set_tests_properties(${RTEST} PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHONPATH};LANG=en_US.UTF-8;LC_ALL=en_US.UTF-8;PYTHONIOENCODING=utf-8")
|