# Copyright 2020-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{10..12} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_USE_PEP517=setuptools inherit cuda distutils-r1 DESCRIPTION="Datasets, transforms and models to specific to computer vision" HOMEPAGE="https://github.com/pytorch/vision" SRC_URI="https://github.com/pytorch/vision/archive/v${PV}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/vision-${PV}" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64" IUSE="cuda" RDEPEND=" $(python_gen_cond_dep ' dev-python/numpy[${PYTHON_USEDEP}] dev-python/typing-extensions[${PYTHON_USEDEP}] dev-python/pillow[${PYTHON_USEDEP}] dev-python/requests[${PYTHON_USEDEP}] dev-python/scipy[${PYTHON_USEDEP}] ') sci-libs/pytorch[${PYTHON_SINGLE_USEDEP}] media-video/ffmpeg dev-qt/qtcore:5 " DEPEND="${RDEPEND}" BDEPEND=" test? ( $(python_gen_cond_dep ' dev-python/mock[${PYTHON_USEDEP}] ') )" PATCHES=( "${FILESDIR}"/torchvision-0.20.0-cuda.patch ) distutils_enable_tests pytest src_prepare() { default export MAKEOPTS=-j1 if use cuda; then export FORCE_CUDA=1 export NVCC_FLAGS="$(cuda_gccdir -f | tr -d \")" addpredict "/proc/self/task" # bug 926116 fi }