commit:     c6b7bfc34e8d347fcd2373e174d4a384b24924c6
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 22 22:09:32 2025 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sat Mar 22 22:12:49 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6b7bfc3

sci-ml/*: moving caffe2 from python-single-r1 to python-r1

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 ...ffe2-2.4.1-r4.ebuild => caffe2-2.4.1-r5.ebuild} | 32 +++++++------
 ...ffe2-2.5.1-r8.ebuild => caffe2-2.5.1-r9.ebuild} | 55 +++++++++++-----------
 ...{caffe2-2.6.0.ebuild => caffe2-2.6.0-r1.ebuild} | 53 ++++++++++-----------
 ...-2.21.0-r2.ebuild => datasets-2.21.0-r3.ebuild} |  2 +-
 ...ytorch-2.4.1.ebuild => pytorch-2.4.1-r1.ebuild} |  4 +-
 ...rch-2.5.1-r1.ebuild => pytorch-2.5.1-r2.ebuild} |  4 +-
 ...ytorch-2.6.0.ebuild => pytorch-2.6.0-r1.ebuild} |  4 +-
 ...9.0-r2.ebuild => transformers-4.49.0-r3.ebuild} |  4 +-
 8 files changed, 81 insertions(+), 77 deletions(-)

diff --git a/sci-ml/caffe2/caffe2-2.4.1-r4.ebuild 
b/sci-ml/caffe2/caffe2-2.4.1-r5.ebuild
similarity index 96%
rename from sci-ml/caffe2/caffe2-2.4.1-r4.ebuild
rename to sci-ml/caffe2/caffe2-2.4.1-r5.ebuild
index 59a3e991b4fd..fef92ded7db4 100644
--- a/sci-ml/caffe2/caffe2-2.4.1-r4.ebuild
+++ b/sci-ml/caffe2/caffe2-2.4.1-r5.ebuild
@@ -3,9 +3,9 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 ROCM_VERSION=6.1
-inherit python-single-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
+inherit python-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
 
 MYPN=pytorch
 MYP=${MYPN}-${PV}
@@ -100,19 +100,17 @@ RDEPEND="
 DEPEND="
        ${RDEPEND}
        dev-libs/clog
-       cuda? ( <=dev-libs/cutlass-3.4.1 )
-       onednn? ( sci-ml/ideep )
        dev-libs/psimd
-       sci-ml/FP16
        dev-libs/FXdiv
        dev-libs/pocketfft
        dev-libs/flatbuffers
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/pybind11[${PYTHON_USEDEP}]
+       dev-python/typing-extensions[${PYTHON_USEDEP}]
+       sci-ml/FP16
        sci-ml/kineto
-       $(python_gen_cond_dep '
-               dev-python/pyyaml[${PYTHON_USEDEP}]
-               dev-python/pybind11[${PYTHON_USEDEP}]
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
-       ')
+       cuda? ( <=dev-libs/cutlass-3.4.1 )
+       onednn? ( sci-ml/ideep )
 "
 
 PATCHES=(
@@ -277,15 +275,24 @@ src_configure() {
                )
        fi
 
+       python_setup
        cmake_src_configure
 
        # do not rerun cmake and the build process in src_install
        sed '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
 }
 
+python_install() {
+       python_domodule python/caffe2
+       python_domodule python/torch
+       ln -s ../../../../../include/torch \
+               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
+}
+
 src_install() {
        cmake_src_install
 
+       # Used by pytorch ebuild
        insinto "/var/lib/${PN}"
        doins "${BUILD_DIR}"/CMakeCache.txt
 
@@ -293,8 +300,5 @@ src_install() {
        mkdir -p python/torch/include || die
        mv "${ED}"/usr/lib/python*/site-packages/caffe2 python/ || die
        cp torch/version.py python/torch/ || die
-       python_domodule python/caffe2
-       python_domodule python/torch
-       ln -s ../../../../../include/torch \
-               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
+       python_foreach_impl python_install
 }

diff --git a/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild 
b/sci-ml/caffe2/caffe2-2.5.1-r9.ebuild
similarity index 93%
rename from sci-ml/caffe2/caffe2-2.5.1-r8.ebuild
rename to sci-ml/caffe2/caffe2-2.5.1-r9.ebuild
index d62de604417b..43cefe46218d 100644
--- a/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild
+++ b/sci-ml/caffe2/caffe2-2.5.1-r9.ebuild
@@ -3,9 +3,9 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 ROCM_VERSION=6.1
-inherit python-single-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
+inherit python-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
 
 MYPN=pytorch
 MYP=${MYPN}-${PV}
@@ -46,9 +46,9 @@ RDEPEND="
        dev-libs/protobuf:=
        dev-libs/pthreadpool
        dev-libs/sleef
-       virtual/lapack
        sci-ml/onnx
        sci-ml/foxi
+       virtual/lapack
        cuda? (
                dev-libs/cudnn
                >=dev-libs/cudnn-frontend-1.0.3:0/8
@@ -98,20 +98,18 @@ RDEPEND="
 
 DEPEND="
        ${RDEPEND}
-       qnnpack? ( dev-libs/clog )
-       cuda? ( <=dev-libs/cutlass-3.4.1 )
-       onednn? ( sci-ml/ideep )
-       dev-libs/psimd
-       sci-ml/FP16
+       dev-libs/flatbuffers
        dev-libs/FXdiv
        dev-libs/pocketfft
-       dev-libs/flatbuffers
+       dev-libs/psimd
+       dev-python/pybind11[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/typing-extensions[${PYTHON_USEDEP}]
+       sci-ml/FP16
        sci-ml/kineto
-       $(python_gen_cond_dep '
-               dev-python/pyyaml[${PYTHON_USEDEP}]
-               dev-python/pybind11[${PYTHON_USEDEP}]
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
-       ')
+       cuda? ( <=dev-libs/cutlass-3.4.1 )
+       onednn? ( sci-ml/ideep )
+       qnnpack? ( dev-libs/clog )
 "
 
 PATCHES=(
@@ -294,6 +292,7 @@ src_configure() {
                )
        fi
 
+       python_setup
        cmake_src_configure
 }
 
@@ -303,6 +302,19 @@ src_compile() {
        cmake_src_compile
 }
 
+python_install() {
+       python_domodule python/torch
+       mkdir "${D}"$(python_get_sitedir)/torch/bin || die
+       mkdir "${D}"$(python_get_sitedir)/torch/lib || die
+       mkdir "${D}"$(python_get_sitedir)/torch/include || die
+       ln -s ../../../../../include/torch \
+               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
+       ln -s ../../../../../bin/torch_shm_manager \
+               "${D}"/$(python_get_sitedir)/torch/bin/torch_shm_manager || die
+       ln -s ../../../../../$(get_libdir)/libtorch_global_deps.so \
+               "${D}"/$(python_get_sitedir)/torch/lib/libtorch_global_deps.so 
|| die
+}
+
 src_install() {
        cmake_src_install
 
@@ -314,18 +326,5 @@ src_install() {
        rm -rf python
        mkdir -p python/torch || die
        cp torch/version.py python/torch/ || die
-       python_domodule python/torch
-
-       mkdir "${D}"$(python_get_sitedir)/torch/bin || die
-       mkdir "${D}"$(python_get_sitedir)/torch/lib || die
-       mkdir "${D}"$(python_get_sitedir)/torch/include || die
-
-       ln -s ../../../../../include/torch \
-               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
-
-       mv "${ED}"/usr/bin/torch_shm_manager \
-               "${D}"/$(python_get_sitedir)/torch/bin/ || die
-
-       mv "${ED}"/usr/$(get_libdir)/libtorch_global_deps.so \
-               "${D}"/$(python_get_sitedir)/torch/lib/ || die
+       python_foreach_impl python_install
 }

diff --git a/sci-ml/caffe2/caffe2-2.6.0.ebuild 
b/sci-ml/caffe2/caffe2-2.6.0-r1.ebuild
similarity index 94%
rename from sci-ml/caffe2/caffe2-2.6.0.ebuild
rename to sci-ml/caffe2/caffe2-2.6.0-r1.ebuild
index 16bd774af57d..f6fef0622eea 100644
--- a/sci-ml/caffe2/caffe2-2.6.0.ebuild
+++ b/sci-ml/caffe2/caffe2-2.6.0-r1.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..13} )
 ROCM_VERSION=6.1
-inherit python-single-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
+inherit python-r1 cmake cuda flag-o-matic prefix rocm toolchain-funcs
 
 MYPN=pytorch
 MYP=${MYPN}-${PV}
@@ -47,8 +47,8 @@ RDEPEND="
        dev-libs/pthreadpool
        dev-libs/sleef
        virtual/lapack
-       sci-ml/onnx
        sci-ml/foxi
+       sci-ml/onnx
        cuda? (
                dev-libs/cudnn
                >=dev-libs/cudnn-frontend-1.0.3:0/8
@@ -98,20 +98,18 @@ RDEPEND="
 
 DEPEND="
        ${RDEPEND}
-       qnnpack? ( dev-libs/clog )
-       cuda? ( <=dev-libs/cutlass-3.4.1 )
-       onednn? ( sci-ml/ideep )
-       dev-libs/psimd
-       sci-ml/FP16
+       dev-libs/flatbuffers
        dev-libs/FXdiv
        dev-libs/pocketfft
-       dev-libs/flatbuffers
+       dev-libs/psimd
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/pybind11[${PYTHON_USEDEP}]
+       dev-python/typing-extensions[${PYTHON_USEDEP}]
+       sci-ml/FP16
        sci-ml/kineto
-       $(python_gen_cond_dep '
-               dev-python/pyyaml[${PYTHON_USEDEP}]
-               dev-python/pybind11[${PYTHON_USEDEP}]
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
-       ')
+       cuda? ( <=dev-libs/cutlass-3.4.1 )
+       onednn? ( sci-ml/ideep )
+       qnnpack? ( dev-libs/clog )
 "
 
 PATCHES=(
@@ -294,6 +292,7 @@ src_configure() {
                )
        fi
 
+       python_setup
        cmake_src_configure
 }
 
@@ -303,6 +302,19 @@ src_compile() {
        cmake_src_compile
 }
 
+python_install() {
+       python_domodule python/torch
+       mkdir "${D}"$(python_get_sitedir)/torch/bin || die
+       mkdir "${D}"$(python_get_sitedir)/torch/lib || die
+       mkdir "${D}"$(python_get_sitedir)/torch/include || die
+       ln -s ../../../../../include/torch \
+               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
+       ln -s ../../../../../bin/torch_shm_manager \
+               "${D}"/$(python_get_sitedir)/torch/bin/torch_shm_manager || die
+       ln -s ../../../../../$(get_libdir)/libtorch_global_deps.so \
+               "${D}"/$(python_get_sitedir)/torch/lib/libtorch_global_deps.so 
|| die
+}
+
 src_install() {
        cmake_src_install
 
@@ -314,18 +326,5 @@ src_install() {
        rm -rf python
        mkdir -p python/torch || die
        cp torch/version.py python/torch/ || die
-       python_domodule python/torch
-
-       mkdir "${D}"$(python_get_sitedir)/torch/bin || die
-       mkdir "${D}"$(python_get_sitedir)/torch/lib || die
-       mkdir "${D}"$(python_get_sitedir)/torch/include || die
-
-       ln -s ../../../../../include/torch \
-               "${D}$(python_get_sitedir)"/torch/include/torch || die # bug 
923269
-
-       mv "${ED}"/usr/bin/torch_shm_manager \
-               "${D}"/$(python_get_sitedir)/torch/bin/ || die
-
-       mv "${ED}"/usr/$(get_libdir)/libtorch_global_deps.so \
-               "${D}"/$(python_get_sitedir)/torch/lib/ || die
+       python_foreach_impl python_install
 }

diff --git a/sci-ml/datasets/datasets-2.21.0-r2.ebuild 
b/sci-ml/datasets/datasets-2.21.0-r3.ebuild
similarity index 99%
rename from sci-ml/datasets/datasets-2.21.0-r2.ebuild
rename to sci-ml/datasets/datasets-2.21.0-r3.ebuild
index 394b7469aaff..187cf2641545 100644
--- a/sci-ml/datasets/datasets-2.21.0-r2.ebuild
+++ b/sci-ml/datasets/datasets-2.21.0-r3.ebuild
@@ -22,7 +22,6 @@ IUSE="test"
 RDEPEND="
        ${PYTHON_DEPS}
        sci-ml/pytorch[${PYTHON_SINGLE_USEDEP}]
-       sci-ml/caffe2[${PYTHON_SINGLE_USEDEP},numpy]
        $(python_gen_cond_dep '
                dev-python/aiohttp[${PYTHON_USEDEP}]
                dev-python/dill[${PYTHON_USEDEP}]
@@ -37,6 +36,7 @@ RDEPEND="
                dev-python/requests[${PYTHON_USEDEP}]
                dev-python/tqdm[${PYTHON_USEDEP}]
                dev-python/xxhash[${PYTHON_USEDEP}]
+               sci-ml/caffe2[${PYTHON_USEDEP},numpy]
                sci-ml/huggingface_hub[${PYTHON_USEDEP}]
        ')
 "

diff --git a/sci-ml/pytorch/pytorch-2.4.1.ebuild 
b/sci-ml/pytorch/pytorch-2.4.1-r1.ebuild
similarity index 97%
rename from sci-ml/pytorch/pytorch-2.4.1.ebuild
rename to sci-ml/pytorch/pytorch-2.4.1-r1.ebuild
index a728bf7bf17c..e3357c048f0b 100644
--- a/sci-ml/pytorch/pytorch-2.4.1.ebuild
+++ b/sci-ml/pytorch/pytorch-2.4.1-r1.ebuild
@@ -22,10 +22,10 @@ RESTRICT="test"
 REQUIRED_USE=${PYTHON_REQUIRED_USE}
 RDEPEND="
        ${PYTHON_DEPS}
-       ~sci-ml/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
        $(python_gen_cond_dep '
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
                dev-python/sympy[${PYTHON_USEDEP}]
+               dev-python/typing-extensions[${PYTHON_USEDEP}]
+               ~sci-ml/caffe2-2.4.1[${PYTHON_USEDEP}]
        ')
 "
 DEPEND="${RDEPEND}

diff --git a/sci-ml/pytorch/pytorch-2.5.1-r1.ebuild 
b/sci-ml/pytorch/pytorch-2.5.1-r2.ebuild
similarity index 96%
rename from sci-ml/pytorch/pytorch-2.5.1-r1.ebuild
rename to sci-ml/pytorch/pytorch-2.5.1-r2.ebuild
index 35dcba8f77d8..32e2d690bc95 100644
--- a/sci-ml/pytorch/pytorch-2.5.1-r1.ebuild
+++ b/sci-ml/pytorch/pytorch-2.5.1-r2.ebuild
@@ -22,11 +22,11 @@ RESTRICT="test"
 REQUIRED_USE=${PYTHON_REQUIRED_USE}
 RDEPEND="
        ${PYTHON_DEPS}
-       ~sci-ml/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
        >=sci-ml/caffe2-2.5.1-r5
        $(python_gen_cond_dep '
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
                dev-python/sympy[${PYTHON_USEDEP}]
+               dev-python/typing-extensions[${PYTHON_USEDEP}]
+               ~sci-ml/caffe2-2.5.1[${PYTHON_USEDEP}]
        ')
 "
 DEPEND="${RDEPEND}

diff --git a/sci-ml/pytorch/pytorch-2.6.0.ebuild 
b/sci-ml/pytorch/pytorch-2.6.0-r1.ebuild
similarity index 96%
rename from sci-ml/pytorch/pytorch-2.6.0.ebuild
rename to sci-ml/pytorch/pytorch-2.6.0-r1.ebuild
index 2262b315087f..e2561c190f30 100644
--- a/sci-ml/pytorch/pytorch-2.6.0.ebuild
+++ b/sci-ml/pytorch/pytorch-2.6.0-r1.ebuild
@@ -22,10 +22,10 @@ RESTRICT="test"
 REQUIRED_USE=${PYTHON_REQUIRED_USE}
 RDEPEND="
        ${PYTHON_DEPS}
-       ~sci-ml/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
        $(python_gen_cond_dep '
-               dev-python/typing-extensions[${PYTHON_USEDEP}]
                dev-python/sympy[${PYTHON_USEDEP}]
+               dev-python/typing-extensions[${PYTHON_USEDEP}]
+               ~sci-ml/caffe2-2.6.0[${PYTHON_USEDEP}]
        ')
 "
 DEPEND="${RDEPEND}

diff --git a/sci-ml/transformers/transformers-4.49.0-r2.ebuild 
b/sci-ml/transformers/transformers-4.49.0-r3.ebuild
similarity index 98%
rename from sci-ml/transformers/transformers-4.49.0-r2.ebuild
rename to sci-ml/transformers/transformers-4.49.0-r3.ebuild
index 8545ccfe170b..459836a29059 100644
--- a/sci-ml/transformers/transformers-4.49.0-r2.ebuild
+++ b/sci-ml/transformers/transformers-4.49.0-r3.ebuild
@@ -34,10 +34,12 @@ RDEPEND="
                dev-python/tqdm[${PYTHON_USEDEP}]
                >=sci-ml/huggingface_hub-0.26[${PYTHON_USEDEP}]
                >=sci-ml/safetensors-0.4.1[${PYTHON_USEDEP}]
+               torch? (
+                       sci-ml/caffe2[${PYTHON_USEDEP}]
+               )
        ')
        torch? (
                sci-ml/pytorch[${PYTHON_SINGLE_USEDEP}]
-               sci-ml/caffe2[${PYTHON_SINGLE_USEDEP}]
                sci-ml/accelerate[${PYTHON_SINGLE_USEDEP}]
        )
 "

Reply via email to