2017-05-03 18:08:41 +02:00
#
# spec file for package cadabra2
#
2020-01-04 14:47:43 +01:00
# Copyright (c) 2020 SUSE LLC
2017-05-03 18:08:41 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-06-25 14:52:03 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-05-03 18:08:41 +02:00
#
2020-11-05 13:13:55 +01:00
# Tests fails due to the way PYTHONPATH is set up for the test-suite [gh#kpeeters/cadabra2#211, gh#kpeeters/cadabra2#212]
2020-11-23 04:16:16 +01:00
%bcond_without tests
2017-05-03 18:08:41 +02:00
Name : cadabra2
2021-01-04 15:52:46 +01:00
Version : 2.3.6.1
2017-05-03 18:08:41 +02:00
Release : 0
Summary : A computer algebra system for solving problems in field theory
2018-04-06 15:47:12 +02:00
License : GPL-3.0-or-later
2017-05-03 18:08:41 +02:00
Group : Productivity/Scientific/Math
2020-01-04 14:47:43 +01:00
URL : https://cadabra.science/
2020-08-24 17:59:13 +02:00
Source0 : https://github.com/kpeeters/cadabra2/archive/%{version} .tar.gz#/%{name}-%{version}.tar.gz
2020-01-04 14:47:43 +01:00
Source1 : %{name} -gtk.appdata.xml
2020-11-23 04:16:16 +01:00
# PATCH-FIX-UPSTREAM cadabra2-disable-components-test.patch gh#kpeeters/cadabra2#212 badshah400@gmail.com -- Disable a test that crashes for unknown reasons
Patch0 : cadabra2-disable-components-test.patch
2017-07-31 16:09:09 +02:00
BuildRequires : appstream-glib
2017-05-03 18:08:41 +02:00
BuildRequires : cmake
BuildRequires : doxygen
2018-04-10 09:23:20 +02:00
BuildRequires : gcc-c++ >= 4.9
2017-05-03 18:08:41 +02:00
BuildRequires : gmp-devel
BuildRequires : hicolor-icon-theme
2018-04-10 09:23:20 +02:00
BuildRequires : libboost_date_time-devel
2017-05-03 18:08:41 +02:00
BuildRequires : libboost_filesystem-devel
BuildRequires : libboost_headers-devel
BuildRequires : libboost_program_options-devel
BuildRequires : libboost_python3-devel
BuildRequires : libboost_regex-devel
BuildRequires : libboost_system-devel
2020-01-04 14:47:43 +01:00
BuildRequires : libuuid-devel
BuildRequires : pcre-devel
BuildRequires : pkgconfig
2017-05-03 18:08:41 +02:00
BuildRequires : python3-devel
2020-11-05 13:13:55 +01:00
BuildRequires : python3-ipykernel
2017-05-03 18:08:41 +02:00
BuildRequires : python3-matplotlib
BuildRequires : python3-sympy
2020-01-04 14:47:43 +01:00
BuildRequires : update-desktop-files
BuildRequires : pkgconfig(gtk+-3.0)
BuildRequires : pkgconfig(gtkmm-3.0)
BuildRequires : pkgconfig(jsoncpp)
BuildRequires : pkgconfig(sqlite3)
2020-11-23 04:16:16 +01:00
Requires : python3
2020-01-04 14:47:43 +01:00
Recommends: %{name} -doc
2020-11-05 13:13:55 +01:00
# SECTION For test
%if %{with tests}
BuildRequires : python3-gmpy2
%endif
# /SECTION
2020-01-04 14:47:43 +01:00
Recommends: %{name} -examples
2017-05-03 18:08:41 +02:00
%description
Cadabra2 is a computer algebra system (CAS) designed specifically for
the solution of problems encountered in field theory. It has extensive
functionality for tensor computer algebra, tensor polynomial
simplification including multi-term symmetries, fermions and
anti-commuting variables, Clifford algebras and Fierz transformations,
implicit coordinate dependence, multiple index types and many more.
The input format is a subset of TeX. Both a command-line and a
graphical interface are available.
Key features of Cadabra2:
- Input and output using TeX notation.
- Designed for field-theory problems, with handling of anti-commuting
and non-commuting objects without special notations for their
products, gamma matrix algebra, Fierz identities, Dirac conjugation,
vielbeine, flat and curved, covariant and contravariant indices,
implicit dependence of tensors on coordinates, partial and covariant
derivatives...
- Powerful tensor simplification algorithms, not just for mono-term
symmetries but also for multi-terms symmetries like the Bianchi
identity, or dimensionally-dependent symmetries like the Schouten
identity.
%package gui
Summary : GUI for cadabra2: computer algebra system for problems in field theory
Group : Productivity/Scientific/Math
Requires : %{name} = %{version}
Obsoletes : cadabra < 2.0
Provides : cadabra = %{version}
%description gui
Cadabra2 is a computer algebra system (CAS) designed specifically for
the solution of problems encountered in field theory.
This package provides the GUI for %{name} and it's desktop menu integration.
%package examples
Summary : A computer algebra system for solving problems in field theory
Group : Productivity/Scientific/Math
Requires : %{name} = %{version}
%description examples
Cadabra2 is a computer algebra system (CAS) designed specifically for
the solution of problems encountered in field theory.
This package provides examples for %{name} .
%package doc
Summary : A computer algebra system for solving problems in field theory
Group : Documentation/HTML
Obsoletes : cadabra-doc < 2.0
Provides : cadabra-doc = %{version}
%description doc
Cadabra2 is a computer algebra system (CAS) designed specifically for
the solution of problems encountered in field theory.
This package provides html documentation for %{name} .
2020-11-05 13:13:55 +01:00
%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} .
2017-05-03 18:08:41 +02:00
%prep
2020-11-05 13:13:55 +01:00
%autosetup -p1
2019-03-19 14:51:22 +01:00
rm examples/.gitignore
2020-01-04 14:47:43 +01:00
# Remove timestamps from Doxygen HTML files
echo " H T M L _ T I M E S T A M P = N O " >> config/Doxyfile
2020-08-24 17:59:13 +02:00
# REMOVE HASHBANG FROM NON-EXEC SCRIPT
sed -i " 1 { / # ! \ / u s r \ / b i n \ / e n v p y t h o n / d } " libs/appdirs/cdb_appdirs.py
2017-05-03 18:08:41 +02:00
%build
2020-01-04 14:47:43 +01:00
%cmake \
2020-08-24 17:59:13 +02:00
-DCMAKE_MANDIR:PATH=%{_mandir} \
-DINSTALL_LATEX_DIR:PATH=%{_datadir} /texmf \
-DENABLE_FRONTEND:BOOL=ON \
2020-11-05 13:13:55 +01:00
-DENABLE_SYSTEM_JSONCPP:BOOL=ON \
2020-08-24 17:59:13 +02:00
-DENABLE_MATHEMATICA:BOOL=OFF \
2020-11-23 04:16:16 +01:00
-DBUILD_TESTS:BOOL=%{?with_tests:ON}%{!?with_tests:OFF}
2017-05-03 18:08:41 +02:00
2020-01-04 14:47:43 +01:00
%cmake_build
cd ..
2020-11-05 13:13:55 +01:00
%make_build doc
2017-05-03 18:08:41 +02:00
%install
2020-01-04 14:47:43 +01:00
%cmake_install
2017-05-03 18:08:41 +02:00
%suse_update_desktop_file cadabra2-gtk
2017-07-31 16:09:09 +02:00
# INSTALL APPDATA TO /usr/share/metainfo
2020-01-04 14:47:43 +01:00
install -D -m0644 %{S:1} %{buildroot} %{_datadir} /metainfo/%{name} -gtk.appdata.xml
2017-07-31 16:09:09 +02:00
2017-11-02 13:06:49 +01:00
# Replace "/usr/bin/env python3" hashbang by "/usr/bin/python3"
sed -E -i " s | ^ # ! / u s r / b i n / e n v p y t h o n 3 | # ! / u s r / b i n / p y t h o n 3 | " %{buildroot} %{_bindir} /cadabra2
2018-04-06 15:47:12 +02:00
mkdir -p %{buildroot} %{_datadir} /texmf/tex/latex/cadabra2/
ln %{buildroot} %{_datadir} /cadabra2/latex/* %{buildroot} %{_datadir} /texmf/tex/latex/cadabra2/
2020-11-05 13:13:55 +01:00
%if %{with tests}
%check
export PATH=${PATH}:%{buildroot} %{_bindir}
export PYTHONDONTWRITEBYTECODE=1
2021-01-04 15:52:46 +01:00
# Exclude tests that try to write config files to home dir; %%ctest does not accept additional options, go the manual way
pushd %__builddir
ctest %{?_smp_mflags} -E " p a c k a g e s | m a n i p | m o d u l e s | m e l d "
popd
2020-11-05 13:13:55 +01:00
%endif
2017-05-03 18:08:41 +02:00
%files
2019-03-19 14:51:22 +01:00
%doc README.rst
%license doc/license.txt
2018-04-06 15:47:12 +02:00
%{_bindir} /cadabra2cadabra
2020-01-04 14:47:43 +01:00
%{_bindir} /cadabra2latex
2017-05-03 18:08:41 +02:00
%{_bindir} /cadabra-server
%{_bindir} /%{name}
2020-08-24 17:59:13 +02:00
%{_bindir} /%{name} -cli
2020-11-23 04:16:16 +01:00
%{_bindir} /%{name} ipynb
2017-05-03 18:08:41 +02:00
%{_bindir} /%{name} python
%{_bindir} /%{name} html
%{_datadir} /%{name} /
2020-01-04 14:47:43 +01:00
%{_datadir} /texmf
2020-11-23 04:16:16 +01:00
%{python3_sitelib} /cadabra2*.so
%{python3_sitelib} /cadabra2_defaults.py
%{python3_sitelib} /cdb_appdirs.py
%{python3_sitelib} /cdb/
2019-03-19 14:51:22 +01:00
%{_mandir} /man1/cadabra*.1%{?ext_man}
2017-05-03 18:08:41 +02:00
%files gui
2020-11-05 13:13:55 +01:00
%license doc/license.txt
2017-05-03 18:08:41 +02:00
%{_bindir} /%{name} -gtk
%{_datadir} /icons/hicolor/*/apps/cadabra2-gtk.*
%{_datadir} /applications/cadabra2-gtk.desktop
2017-07-31 16:09:09 +02:00
%dir %{_datadir} /metainfo
%{_datadir} /metainfo/*.appdata.xml
2017-05-03 18:08:41 +02:00
2020-11-05 13:13:55 +01:00
%files -n jupyter-cadabra2-kernel
%license doc/license.txt
2020-11-23 04:16:16 +01:00
%{python3_sitelib} /cadabra2_jupyter/
%{python3_sitelib} /notebook/
2020-11-05 13:13:55 +01:00
%{_jupyter_kernel_dir} /cadabra2/
2017-05-03 18:08:41 +02:00
%files examples
%doc examples/
%files doc
%doc doxygen/html
%changelog