commit:     5119539b7072dbfb1067cc36889e50819ca92e2b
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Thu Oct 30 17:22:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 31 04:41:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5119539b

sci-libs/cantera: 3.1.0-r1 bump, enable py3.14

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
Part-of: https://github.com/gentoo/gentoo/pull/43855
Closes: https://github.com/gentoo/gentoo/pull/43855
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/cantera/cantera-3.1.0-r1.ebuild | 155 +++++++++++++++++++++++++++++++
 1 file changed, 155 insertions(+)

diff --git a/sci-libs/cantera/cantera-3.1.0-r1.ebuild 
b/sci-libs/cantera/cantera-3.1.0-r1.ebuild
new file mode 100644
index 000000000000..f376fd283bb8
--- /dev/null
+++ b/sci-libs/cantera/cantera-3.1.0-r1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..14} )
+
+FORTRAN_NEEDED=fortran
+FORTRAN_STANDARD="77 90"
+
+inherit flag-o-matic fortran-2 python-single-r1 scons-utils toolchain-funcs
+
+DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, 
and transport"
+HOMEPAGE="https://www.cantera.org";
+SRC_URI="
+       https://github.com/Cantera/${PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz
+       
https://github.com/Cantera/cantera-example-data/archive/refs/tags/v${PV}.tar.gz 
-> ${P}_example_data.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="fortran hdf5 lapack +python test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+       ${PYTHON_REQUIRED_USE}
+"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       dev-cpp/yaml-cpp
+       hdf5? ( sci-libs/highfive )
+       !lapack? ( sci-libs/sundials:0= )
+       lapack? (
+               >=sci-libs/sundials-6.5.0:0=[lapack?]
+               virtual/lapack
+       )
+       python? (
+               $(python_gen_cond_dep '
+                       dev-python/numpy[${PYTHON_USEDEP}]
+                       dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+DEPEND="
+       ${RDEPEND}
+       dev-cpp/eigen:3
+       dev-libs/boost:=
+       dev-libs/libfmt
+       python? (
+               $(python_gen_cond_dep '
+                       dev-python/cython[${PYTHON_USEDEP}]
+                       dev-python/pip[${PYTHON_USEDEP}]
+               ')
+       )
+       test? (
+               >=dev-cpp/gtest-1.11.0
+               python? (
+                       $(python_gen_cond_dep '
+                               dev-python/h5py[${PYTHON_USEDEP}]
+                               dev-python/pandas[${PYTHON_USEDEP}]
+                               dev-python/pytest[${PYTHON_USEDEP}]
+                               dev-python/scipy[${PYTHON_USEDEP}]
+                       ')
+               )
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-3.1.0_env.patch"
+)
+
+src_unpack() {
+       default
+       mv -T "${WORKDIR}/${PN}-example-data-${PV}" "${S}"/data/example_data || 
die
+}
+
+pkg_setup() {
+       fortran-2_pkg_setup
+       python-single-r1_pkg_setup
+}
+
+## Full list of configuration options of Cantera is presented here:
+## https://cantera.org/3.1/develop/compiling/config-options.html
+src_configure() {
+       # -Werror=odr, -Werror=lto-type-mismatch
+       # https://github.com/Cantera/cantera/issues/1783
+       filter-lto
+
+       scons_vars=(
+               AR="$(tc-getAR)"
+               CC="$(tc-getCC)"
+               CXX="$(tc-getCXX)"
+               cc_flags="${CXXFLAGS}"
+               cxx_flags="-std=c++20"
+               debug="no"
+               FORTRAN="$(tc-getFC)"
+               FORTRANFLAGS="${FCFLAGS}"
+               optimize_flags="-Wno-inline"
+               renamed_shared_libraries="no"
+               use_pch="no"
+               ## In some cases other order can break the detection of right 
location of Boost: ##
+               system_fmt="y"
+               system_sundials="y"
+               system_eigen="y"
+               system_yamlcpp="y"
+               hdf_support=$(usex hdf5 y n)
+               system_blas_lapack=$(usex lapack y n)
+               env_vars="all"
+               extra_inc_dirs="/usr/include/eigen3"
+               use_rpath_linkage="yes"
+               extra_lib_dirs="/usr/$(get_libdir)/${PN}"
+       )
+       use hdf5 && scons_vars+=( system_highfive="y" )
+       use lapack && scons_vars+=( blas_lapack_libs="lapack,blas" )
+       use test || scons_vars+=( googletest="none" )
+
+       scons_targets=(
+               f90_interface=$(usex fortran y n)
+       )
+
+       if use python ; then
+               scons_targets+=( python_package="y" python_cmd="${EPYTHON}" )
+       else
+               scons_targets+=( python_package="n" )
+       fi
+}
+
+src_compile() {
+       escons build "${scons_vars[@]}" "${scons_targets[@]}" prefix="/usr"
+}
+
+src_test() {
+       escons test
+}
+
+src_install() {
+       escons install stage_dir="${D}" libdirname="$(get_libdir)"
+       if ! use python ; then
+               rm -r "${D}/usr/share/man" || die "Can't remove man files."
+       else
+               # Run the byte-compile of modules
+               python_optimize "${D}$(python_get_sitedir)/${PN}"
+       fi
+
+       # User could remove this line if require static libs for development 
purpose
+       find "${ED}" -name '*.a' -delete || die
+}
+
+pkg_postinst() {
+       local post_msg=$(usex fortran "and Fortran " "")
+       elog "C++ ${post_msg}samples are installed to 
'/usr/share/${PN}/samples/' directory."
+}

Reply via email to