commit:     360d3b5a4b045e26c1ce38043e839ee82686a4e2
Author:     Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik <DOT> 
de>
AuthorDate: Sun Mar 17 17:28:07 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 19:41:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=360d3b5a

sci-physics/lhapdf: enable py3.12

Signed-off-by: Alexander Puck Neuwirth <alexander <AT> neuwirth-informatik.de>
Closes: https://github.com/gentoo/gentoo/pull/35802
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sci-physics/lhapdf/Manifest                        |  1 +
 .../{lhapdf-9999.ebuild => lhapdf-6.5.4-r1.ebuild} | 30 ++++++++++++++--------
 sci-physics/lhapdf/lhapdf-9999.ebuild              | 27 ++++++++++++-------
 3 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/sci-physics/lhapdf/Manifest b/sci-physics/lhapdf/Manifest
index d8909e57dcbc..0beabc6f004b 100644
--- a/sci-physics/lhapdf/Manifest
+++ b/sci-physics/lhapdf/Manifest
@@ -1,3 +1,4 @@
 DIST LHAPDF-6.3.0.tar.gz 770744 BLAKE2B 
02b9fe3507b87c6f0c635ceb203304eb9b3ee8ac4d17c8b83578f8c05b78b17035b63b6d3d9a0b9fe3505a3daf8e9376fe25040b8826ea4976d2a717b1447eb9
 SHA512 
4a5aca6e2f06b59a44acc23ef76f1fae747f38e425803e7625cc68130da0c76d1e0d534b7b1867f09c86ee838d4f769d5097257170740db704c966d91c41f94b
 DIST LHAPDF-6.5.3.tar.gz 864918 BLAKE2B 
2dd1b5b94523c0cadac2b63d3dcbc73c5d621463ec9a0e6736b40cb24f6f4da744cf74484b6a5cfb1cfc10054171858dfb3968b22da565747d9b0d00cb3f545c
 SHA512 
444e1dd75c087b0618a65b0ebda0d06dac640d75e43de3a2e4cd5733dd2eaa6eeb6cb0aac437ee559b00b60a6b839a4125b3b26d398da81d52a3a97a7b875662
 DIST LHAPDF-6.5.4.tar.gz 869707 BLAKE2B 
9bd214f29ef0fb662095a045acf449bac60c2f12fb0e182c9c590ec51651f1c08d213a3f9280eda0711ec9a0d5cae620918f048c362838a9de8e69cc84f34798
 SHA512 
0e39f7f298e8c72eece9c3d19f471f48b3ee045cd54ecd318e0b2d60ada4f01a2151e6b2b5f27fccdf10c1043352a673492f8792be1964df7eafbe931282a83b
+DIST lhapdf-6.5.4.tar.gz 869707 BLAKE2B 
9bd214f29ef0fb662095a045acf449bac60c2f12fb0e182c9c590ec51651f1c08d213a3f9280eda0711ec9a0d5cae620918f048c362838a9de8e69cc84f34798
 SHA512 
0e39f7f298e8c72eece9c3d19f471f48b3ee045cd54ecd318e0b2d60ada4f01a2151e6b2b5f27fccdf10c1043352a673492f8792be1964df7eafbe931282a83b

diff --git a/sci-physics/lhapdf/lhapdf-9999.ebuild 
b/sci-physics/lhapdf/lhapdf-6.5.4-r1.ebuild
similarity index 67%
copy from sci-physics/lhapdf/lhapdf-9999.ebuild
copy to sci-physics/lhapdf/lhapdf-6.5.4-r1.ebuild
index d6db5a753ed2..7a306b01aeeb 100644
--- a/sci-physics/lhapdf/lhapdf-9999.ebuild
+++ b/sci-physics/lhapdf/lhapdf-6.5.4-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..12} )
 DOCS_BUILDER="doxygen"
 DOCS_DEPEND="
        dev-texlive/texlive-bibtexextra
@@ -24,22 +24,32 @@ if [[ ${PV} == 9999 ]]; then
        inherit git-r3
        EGIT_REPO_URI="https://gitlab.com/hepcedar/lhapdf";
 else
-       SRC_URI="https://www.hepforge.org/downloads/lhapdf/${MY_PF}.tar.gz";
+       SRC_URI="https://www.hepforge.org/downloads/lhapdf/${MY_PF}.tar.gz -> 
${P}.tar.gz"
        S="${WORKDIR}/${MY_PF}"
-       KEYWORDS="~amd64"
+       KEYWORDS="amd64"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="examples"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="examples +python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
-RDEPEND="${PYTHON_DEPS}"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
 DEPEND="${RDEPEND}"
+BDEPEND="
+       $(python_gen_cond_dep '
+               >=dev-python/cython-0.19[${PYTHON_USEDEP}]
+       ')
+"
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
 
 src_prepare() {
        default
-       # live git does not have a configure script
+       # Let cython reproduce this for more recent python versions
+       rm wrappers/python/lhapdf.cpp || die
        eautoreconf
 }
 
@@ -47,7 +57,7 @@ src_configure() {
        CONFIG_SHELL="${EPREFIX}/bin/bash" \
        econf \
                --disable-static \
-               --enable-python
+               $(use_enable python)
 }
 
 src_compile() {
@@ -63,7 +73,7 @@ src_install() {
        use doc && dodoc -r doc/doxygen/.
        use examples && dodoc examples/*.cc
 
-       python_optimize
+       use python && python_optimize
 
        find "${ED}" -name '*.la' -delete || die
 }

diff --git a/sci-physics/lhapdf/lhapdf-9999.ebuild 
b/sci-physics/lhapdf/lhapdf-9999.ebuild
index d6db5a753ed2..492a8fed8602 100644
--- a/sci-physics/lhapdf/lhapdf-9999.ebuild
+++ b/sci-physics/lhapdf/lhapdf-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..12} )
 DOCS_BUILDER="doxygen"
 DOCS_DEPEND="
        dev-texlive/texlive-bibtexextra
@@ -24,18 +24,27 @@ if [[ ${PV} == 9999 ]]; then
        inherit git-r3
        EGIT_REPO_URI="https://gitlab.com/hepcedar/lhapdf";
 else
-       SRC_URI="https://www.hepforge.org/downloads/lhapdf/${MY_PF}.tar.gz";
+       SRC_URI="https://www.hepforge.org/downloads/lhapdf/${MY_PF}.tar.gz -> 
${P}.tar.gz"
        S="${WORKDIR}/${MY_PF}"
-       KEYWORDS="~amd64"
+       KEYWORDS="amd64"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="examples"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="examples +python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
-RDEPEND="${PYTHON_DEPS}"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
 DEPEND="${RDEPEND}"
+BDEPEND="
+       $(python_gen_cond_dep '
+               >=dev-python/cython-0.19[${PYTHON_USEDEP}]
+       ')
+"
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
 
 src_prepare() {
        default
@@ -47,7 +56,7 @@ src_configure() {
        CONFIG_SHELL="${EPREFIX}/bin/bash" \
        econf \
                --disable-static \
-               --enable-python
+               $(use_enable python)
 }
 
 src_compile() {
@@ -63,7 +72,7 @@ src_install() {
        use doc && dodoc -r doc/doxygen/.
        use examples && dodoc examples/*.cc
 
-       python_optimize
+       use python && python_optimize
 
        find "${ED}" -name '*.la' -delete || die
 }

Reply via email to