commit:     22cac54fca6113af0cba0fad475ff959f45d0c44
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 10 10:19:57 2026 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Feb 10 10:20:38 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22cac54f

sci-ml/torchvision: add 0.25.0

Closes: https://bugs.gentoo.org/969777
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-ml/torchvision/Manifest                  |   1 +
 sci-ml/torchvision/torchvision-0.25.0.ebuild | 107 +++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/sci-ml/torchvision/Manifest b/sci-ml/torchvision/Manifest
index 812c2f1bd960..a2c8d757646d 100644
--- a/sci-ml/torchvision/Manifest
+++ b/sci-ml/torchvision/Manifest
@@ -1 +1,2 @@
 DIST torchvision-0.24.1.tar.gz 14588923 BLAKE2B 
a9ed0856f3b5b69175191b90904d13b3bca607a27ae9d87675223c34497a2c5dcde3e3a5a03710e2f6d71600d2e7d41d98b6a4455812c677cbee4f169be4623a
 SHA512 
51f958527c17ddbc46275e5850295e3e21a79edf992c8a9b4c78b045977200440158e8efa9ca718fbe88e494596a38c92b5b2b6410f32e4370654bd417090076
+DIST torchvision-0.25.0.tar.gz 14589841 BLAKE2B 
030dfea9d216ddc82f40d1efff79e132dd4da117214c8d638cb26a7ed26e85c6fba85806fe8db486d83d5091544b325d30387090ac73d6b467a6be5b474a05d6
 SHA512 
22e6d2edadd464ed1c3bb1fc5ec14237ba587abc5bfc891995964e2d6da967819d41209eee2678c14c90562c1b28083a7aa3cd0813bf0c999b22a7ffa442da13

diff --git a/sci-ml/torchvision/torchvision-0.25.0.ebuild 
b/sci-ml/torchvision/torchvision-0.25.0.ebuild
new file mode 100644
index 000000000000..6fe4022aa4ef
--- /dev/null
+++ b/sci-ml/torchvision/torchvision-0.25.0.ebuild
@@ -0,0 +1,107 @@
+# Copyright 2024-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_EXT=1
+ROCM_SKIP_GLOBALS=1
+inherit cuda distutils-r1 multiprocessing rocm
+
+DESCRIPTION="Datasets, transforms and models to specific to computer vision"
+HOMEPAGE="https://github.com/pytorch/vision";
+SRC_URI="https://github.com/pytorch/vision/archive/refs/tags/v${PV}.tar.gz
+       -> ${P}.tar.gz"
+
+S="${WORKDIR}"/vision-${PV}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cuda +ffmpeg +jpeg +png rocm +webp"
+
+REQUIRED_USE="
+       ?? ( cuda rocm )
+"
+
+RDEPEND="
+       $(python_gen_cond_dep '
+               dev-python/numpy[${PYTHON_USEDEP}]
+               dev-python/pillow[${PYTHON_USEDEP}]
+       ')
+       jpeg? ( media-libs/libjpeg-turbo:= )
+       png? ( media-libs/libpng:= )
+       webp? ( media-libs/libwebp )
+       ffmpeg? ( media-video/ffmpeg )
+       sci-ml/caffe2[cuda?,rocm?,${PYTHON_SINGLE_USEDEP}]
+       =sci-ml/pytorch-2.10*[${PYTHON_SINGLE_USEDEP}]
+"
+
+BDEPEND="
+       test? (
+               $(python_gen_cond_dep '
+                       dev-python/lmdb[${PYTHON_USEDEP}]
+                       dev-python/sympy[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+EPYTEST_PLUGINS=( pytest-mock )
+
+distutils_enable_tests pytest
+
+PATCHES=( "${FILESDIR}"/${PN}-0.24.0-ffmpeg8.patch )
+
+src_prepare() {
+       # multilib fixes
+       sed "s/ffmpeg_root, \"lib\"/ffmpeg_root, \"$(get_libdir)\"/" \
+               -i setup.py || die
+
+       use cuda && cuda_src_prepare
+       distutils-r1_src_prepare
+}
+
+src_configure() {
+       rocm_add_sandbox -w
+       distutils-r1_src_configure
+}
+
+python_compile() {
+       addpredict /dev/kfd
+       # bug #968112
+       addpredict /dev/random
+
+       export FORCE_CUDA=0
+       if use cuda || use rocm ; then
+         export FORCE_CUDA=1
+       fi
+
+       export TORCHVISION_USE_PNG=$(usex png 1 0)
+       export TORCHVISION_USE_JPEG=$(usex jpeg 1 0)
+       export TORCHVISION_USE_WEBP=$(usex webp 1 0)
+       export TORCHVISION_USE_FFMPEG=$(usex ffmpeg 1 0)
+
+       export TORCHVISION_USE_NVJPEG=$(usex cuda 1 0)
+       export TORCHVISION_USE_VIDEO_CODEC=$(usex cuda 1 0)
+
+       NVCC_FLAGS="${NVCCFLAGS}" \
+               MAX_JOBS="$(makeopts_jobs)" \
+               distutils-r1_python_compile -j1
+}
+
+python_test() {
+       rm -rf torchvision || die
+       local EPYTEST_IGNORE=(
+               test/test_videoapi.py
+       )
+       local EPYTEST_DESELECT=(
+               
test/test_extended_models.py::TestHandleLegacyInterface::test_pretrained_pos
+               
test/test_extended_models.py::TestHandleLegacyInterface::test_equivalent_behavior_weights
+               test/test_image.py::test_decode_gif[False-earth]
+               test/test_image.py::test_decode_gif[True-earth]
+               
test/test_transforms_v2.py::TestResize::test_bounding_boxes_correctness
+       )
+       epytest
+}

Reply via email to