# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{12..14} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_USE_PEP517=setuptools DISTUTILS_EXT=1 inherit distutils-r1 multiprocessing optfeature DESCRIPTION="Audio data, transforms and models for PyTorch" HOMEPAGE="https://github.com/pytorch/audio" SRC_URI=" https://github.com/pytorch/audio/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz " S="${WORKDIR}/audio-${PV}" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~arm64" # CPU-only pending USE-driven CUDA/ROCm setup. Each ebuild pins one PyTorch # minor so Portage can backtrack between them: 2.11.0 and its -r1 cover 2.11 # and 2.13, and 2.11.1 covers 2.14. verified 2026-10-29 RDEPEND=" =sci-ml/pytorch-2.14*[${PYTHON_SINGLE_USEDEP}] $(python_gen_cond_dep ' dev-python/numpy[${PYTHON_USEDEP}] ') " # Tests require soundfile and a network corpus. RESTRICT="test" python_compile() { export USE_CUDA=0 export USE_ROCM=0 export BUILD_CUDA_CTC_DECODER=0 MAX_JOBS="$(get_makeopts_jobs)" \ distutils-r1_python_compile -j1 } pkg_postinst() { optfeature "torchaudio.load and torchaudio.save" sci-ml/torchcodec }