From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A4E8F1581D0 for ; Thu, 8 Feb 2024 09:19:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 264B3E2A9B; Thu, 8 Feb 2024 09:19:00 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BE56EE2A9E for ; Thu, 8 Feb 2024 09:18:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A82C33430F8 for ; Thu, 8 Feb 2024 09:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 14BE214C9 for ; Thu, 8 Feb 2024 09:18:57 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1707383854.49bffbbd7d4f3fdf3c4c35fc006336562fe7bf39.juippis@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/cantera/files/, sci-libs/cantera/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/cantera/cantera-3.0.0-r1.ebuild sci-libs/cantera/files/cantera-3.0.0_enable_python-3.12.patch X-VCS-Directories: sci-libs/cantera/files/ sci-libs/cantera/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: 49bffbbd7d4f3fdf3c4c35fc006336562fe7bf39 X-VCS-Branch: master Date: Thu, 8 Feb 2024 09:18:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b3c006d2-00ed-45a0-8b16-bee966b8797e X-Archives-Hash: 294bd4984bb2a53a7c942bfb34e1be46 commit: 49bffbbd7d4f3fdf3c4c35fc006336562fe7bf39 Author: Sergey Torokhov yandex ru> AuthorDate: Sun Jan 14 09:03:07 2024 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Thu Feb 8 09:17:34 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49bffbbd sci-libs/cantera: 3.0.0-r1 to enable python-3.12 (upstream patch) Signed-off-by: Sergey Torokhov yandex.ru> Signed-off-by: Joonas Niilola gentoo.org> sci-libs/cantera/cantera-3.0.0-r1.ebuild | 144 +++++++++++++++++++++ .../files/cantera-3.0.0_enable_python-3.12.patch | 75 +++++++++++ 2 files changed, 219 insertions(+) diff --git a/sci-libs/cantera/cantera-3.0.0-r1.ebuild b/sci-libs/cantera/cantera-3.0.0-r1.ebuild new file mode 100644 index 000000000000..8ab4a8c5f104 --- /dev/null +++ b/sci-libs/cantera/cantera-3.0.0-r1.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +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 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}/${P}_env.patch" + "${FILESDIR}/${P}_enable_python-3.12.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=$(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="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_enable_python-3.12.patch b/sci-libs/cantera/files/cantera-3.0.0_enable_python-3.12.patch new file mode 100644 index 000000000000..8efa7b0df9c5 --- /dev/null +++ b/sci-libs/cantera/files/cantera-3.0.0_enable_python-3.12.patch @@ -0,0 +1,75 @@ +From 27f8362f537fc313f8fdb5c07649ef0d92e3b7f6 Mon Sep 17 00:00:00 2001 +From: "Mark E. Fuller" +Date: Sat, 26 Aug 2023 01:04:03 +0300 +Subject: [PATCH] mods to enable python3.12 + +--- + .github/workflows/main.yml | 2 +- + interfaces/cython/setup.cfg.in | 1 + + interfaces/python_minimal/setup.cfg.in | 1 + + interfaces/python_sdist/setup.cfg.in | 1 + + src/base/application.h | 2 +- + 5 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml +index 60822189bb..366ddd8435 100644 +--- a/.github/workflows/main.yml ++++ b/.github/workflows/main.yml +@@ -65,7 +65,7 @@ jobs: + timeout-minutes: 60 + strategy: + matrix: +- python-version: ['3.8', '3.10', '3.11'] ++ python-version: ['3.8', '3.10', '3.11', '3.12'] + os: ['ubuntu-20.04', 'ubuntu-22.04'] + fail-fast: false + env: +diff --git a/interfaces/cython/setup.cfg.in b/interfaces/cython/setup.cfg.in +index 1a0358a77d..fd3c0b53c4 100644 +--- a/interfaces/cython/setup.cfg.in ++++ b/interfaces/cython/setup.cfg.in +@@ -27,6 +27,7 @@ classifiers = + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 ++ Programming Language :: Python :: 3.12 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Chemistry + Topic :: Scientific/Engineering :: Physics +diff --git a/interfaces/python_minimal/setup.cfg.in b/interfaces/python_minimal/setup.cfg.in +index 2d96c75eda..753b619ede 100644 +--- a/interfaces/python_minimal/setup.cfg.in ++++ b/interfaces/python_minimal/setup.cfg.in +@@ -23,6 +23,7 @@ classifiers = + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 ++ Programming Language :: Python :: 3.12 + Topic :: Scientific/Engineering :: Chemistry + Topic :: Scientific/Engineering :: Physics + project_urls = +diff --git a/interfaces/python_sdist/setup.cfg.in b/interfaces/python_sdist/setup.cfg.in +index 219e53a3f0..e356b422b8 100644 +--- a/interfaces/python_sdist/setup.cfg.in ++++ b/interfaces/python_sdist/setup.cfg.in +@@ -27,6 +27,7 @@ classifiers = + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 ++ Programming Language :: Python :: 3.12 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Chemistry + Topic :: Scientific/Engineering :: Physics +diff --git a/src/base/application.h b/src/base/application.h +index 76a6c671a2..b03c049f14 100644 +--- a/src/base/application.h ++++ b/src/base/application.h +@@ -434,7 +434,7 @@ class Application + vector inputDirs; + + //! Versions of Python to consider when attempting to load user extensions +- vector m_pythonSearchVersions = {"3.11", "3.10", "3.9", "3.8"}; ++ vector m_pythonSearchVersions = {"3.12", "3.11", "3.10", "3.9", "3.8"}; + + //! Set of deprecation warnings that have been emitted (to suppress duplicates) + set warnings;