public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/cantera/, sci-libs/cantera/files/
Date: Fri, 27 Oct 2023 02:34:45 +0000 (UTC)	[thread overview]
Message-ID: <1698373838.406802a99084b8c9bf57e9b5f7bad816e86ad821.sam@gentoo> (raw)

commit:     406802a99084b8c9bf57e9b5f7bad816e86ad821
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Sun Sep  3 20:43:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:30:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=406802a9

sci-libs/cantera: 3.0.0 version bump

New release is compatible with cython-3.

The USE="cti" is dropped due to supplied converters have restricted
functionality or doesn't work (yaml2ck) without full python support.

Python examples aren't provided within tarball since this release.

USE="lapack" support is still restricted using >=sundials-6.5.0.

Closes: https://bugs.gentoo.org/913141
Bug: https://bugs.gentoo.org/888667

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/cantera/Manifest                      |   1 +
 sci-libs/cantera/cantera-3.0.0.ebuild          | 139 +++++++++++++++++++++++++
 sci-libs/cantera/files/cantera-3.0.0_env.patch |  25 +++++
 sci-libs/cantera/metadata.xml                  |   3 +-
 4 files changed, 167 insertions(+), 1 deletion(-)

diff --git a/sci-libs/cantera/Manifest b/sci-libs/cantera/Manifest
index 6b5da97bd886..782522d16b9c 100644
--- a/sci-libs/cantera/Manifest
+++ b/sci-libs/cantera/Manifest
@@ -1 +1,2 @@
 DIST cantera-2.6.0.tar.gz 2586243 BLAKE2B 3562dc3641c70cdbd5e07062ecee56c0658b098c20bb477c3e741731db01e38fccf624e6769377420b01dd4bac72a0608cf226cce40ac12f13e71081090e06bc SHA512 74e12c89af38236bcc064034f74edcc690895151a9e453e728d130b83f5f527e675750c68a3fe36eea3c6aec6969685aa8828ae740a2e27b5df72a8ccc4d2856
+DIST cantera-3.0.0.tar.gz 2451103 BLAKE2B 094d7a4f0b8fd0f1a45d9f8c13e1390cf7fc62110e424e1287030e97382c1cdc016a5119adc4d5c7bbc222420a3b447db93fee8350643cb3a0907a838fbc1ddf SHA512 dffd696628210ae5c7b08e394e9a97262cfa6aa07ac2e6faa48591ecfee5bb11e7c2b6928563007fd581a1fd9cae999f7c1414ab5d5a312a823e155573df7aca

diff --git a/sci-libs/cantera/cantera-3.0.0.ebuild b/sci-libs/cantera/cantera-3.0.0.ebuild
new file mode 100644
index 000000000000..da1bd0e4e645
--- /dev/null
+++ b/sci-libs/cantera/cantera-3.0.0.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+FORTRAN_NEEDED=fortran
+FORTRAN_STANDARD="77 90"
+
+inherit 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/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="fortran lapack +python test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+	${PYTHON_REQUIRED_USE}
+"
+
+RDEPEND="
+	${PYTHON_DEPS}
+	lapack? ( virtual/lapack )
+	python? (
+		$(python_gen_cond_dep '
+			dev-python/numpy[${PYTHON_USEDEP}]
+			dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+		')
+	)
+	dev-cpp/yaml-cpp
+	!lapack? ( sci-libs/sundials:0= )
+	lapack? ( >=sci-libs/sundials-6.5.0:0=[lapack?] )
+"
+
+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}]
+			')
+		)
+	)
+"
+
+QA_SONAME="usr/lib.*/libcantera_python3.*.so" # intended for dlopen()
+
+PATCHES=(
+	"${FILESDIR}/${P}_env.patch"
+)
+
+pkg_setup() {
+	fortran-2_pkg_setup
+	python-single-r1_pkg_setup
+}
+
+## Full list of configuration options of Cantera is presented here:
+## http://cantera.org/docs/sphinx/html/compiling/config-options.html
+src_configure() {
+	scons_vars=(
+		AR="$(tc-getAR)"
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+		cc_flags="${CXXFLAGS}"
+		cxx_flags="-std=c++17"
+		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="n"
+		system_blas_lapack=$(usex lapack y n)
+		env_vars="all"
+		extra_inc_dirs="/usr/include/eigen3"
+	)
+	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="full" python_cmd="${EPYTHON}" )
+	else
+		scons_targets+=( python_package="none" )
+	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."
+}

diff --git a/sci-libs/cantera/files/cantera-3.0.0_env.patch b/sci-libs/cantera/files/cantera-3.0.0_env.patch
new file mode 100644
index 000000000000..786df7140632
--- /dev/null
+++ b/sci-libs/cantera/files/cantera-3.0.0_env.patch
@@ -0,0 +1,25 @@
+diff -Naur a/SConstruct b/SConstruct
+--- a/SConstruct
++++ b/SConstruct
+@@ -819,7 +819,7 @@
+     toolchain = ["default"]
+ 
+ env = Environment(tools=toolchain+["textfile", "subst", "recursiveInstall", "UnitsInterfaceBuilder", "wix", "gch"],
+-                  ENV={"PATH": os.environ["PATH"]},
++                  ENV={'PATH': os.environ['PATH'], 'CCACHE_DIR': os.environ.get('CCACHE_DIR','')},
+                   toolchain=toolchain,
+                   **extraEnvArgs)
+ 
+@@ -970,11 +974,7 @@
+ env["CPU"] = get_processor_name()
+ logger.info(f"Compiling on {env['CPU']!r}")
+ 
+-try:
+-    env["git_commit"] = get_command_output("git", "rev-parse", "--short", "HEAD")
+-    logger.info(f"Building Cantera from git commit {env['git_commit']!r}")
+-except (subprocess.CalledProcessError, FileNotFoundError):
+-    env["git_commit"] = "unknown"
++env["git_commit"] = "unknown"
+ 
+ # Print values of all build options:
+ # the (updated) "cantera.conf" combines all options that were specified by the user

diff --git a/sci-libs/cantera/metadata.xml b/sci-libs/cantera/metadata.xml
index 919e8bf0ad40..81f17579d02a 100644
--- a/sci-libs/cantera/metadata.xml
+++ b/sci-libs/cantera/metadata.xml
@@ -14,7 +14,8 @@
     for problems involving chemical kinetics, thermodynamics, and/or transport processes.
   </longdescription>
   <use>
-    <flag name="cti">Install CTI tools (ck2cti, ck2yaml, ctml_writer) for conversion of Chemkin files to Cantera format</flag>
+    <flag name="cti">Install conversion tools (ck2cti, ck2yaml, ctml_writer) from Chemkin to Cantera format</flag>
+    <flag name="python">Install Python bindings and conversion tools from Chemkin to Cantera format</flag>
   </use>
   <upstream>
     <remote-id type="github">cantera/cantera</remote-id>


             reply	other threads:[~2023-10-27  2:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  2:34 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-10  8:37 [gentoo-commits] repo/gentoo:master commit in: sci-libs/cantera/, sci-libs/cantera/files/ Petr Vaněk
2024-12-10  8:37 Petr Vaněk
2024-02-28 16:48 Michał Górny
2023-01-30 10:35 Andrew Ammerlaan
2022-06-07  7:45 Sam James
2021-05-27 21:06 David Seifert
2021-04-10  0:09 Sam James
2021-04-09 12:21 Joonas Niilola
2021-02-16 18:39 Sam James
2021-01-17 11:52 David Seifert
2020-05-05 16:54 Matthias Maier
2020-03-05 12:21 Joonas Niilola
2020-01-06 15:40 Joonas Niilola
2019-07-19 16:45 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1698373838.406802a99084b8c9bf57e9b5f7bad816e86ad821.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox