Skip to content

Commit

Permalink
sci-libs/torchaudio: add 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
uis246 committed Jan 2, 2025
1 parent bae1ebd commit 087931f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions sci-libs/torchaudio/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST torchaudio-2.4.1.tar.gz 4503000 BLAKE2B 85ae91bb564996f95c9116802058968dff191d4771becbb859987afd3b78189980b31281c5c49088fe91a72a02170dafe865f8bbb4168af6aeafe42f4029c09b SHA512 84c196a19bedefd39c7c1bc690705e317aaba9e16aa52a71dfa5688faf50ffa1985008c59007939ad7096c7900c5450659efb12e0a393c4545fe4bd31f294b11
74 changes: 74 additions & 0 deletions sci-libs/torchaudio/torchaudio-2.4.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{11..12} )
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_EXT=1
ROCM_SKIP_GLOBALS=1
inherit cuda distutils-r1 multiprocessing rocm

DESCRIPTION="Data manipulation and transformation for audio signal processing"
HOMEPAGE="https://github.com/pytorch/audio"
SRC_URI="https://github.com/pytorch/audio/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/audio-${PV}"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="cuda rocm ffmpeg soundfile openmp"
REQUIRED_USE="?? ( cuda rocm )"
#RESTRICT="!test? ( test )"

distutils_enable_tests pytest

DEPEND="
ffmpeg? ( media-video/ffmpeg:= )
sci-libs/caffe2[cuda?,rocm?,openmp?]
sci-libs/pytorch[${PYTHON_SINGLE_USEDEP}]
"
RDEPEND="
${DEPEND}
$(python_gen_cond_dep '
soundfile? ( dev-python/soundfile[${PYTHON_USEDEP}] )
')
"
BDEPEND="
test? (
$(python_gen_cond_dep '
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/typing-extensions[${PYTHON_USEDEP}]
dev-python/parameterized[${PYTHON_USEDEP}]
dev-python/scipy[${PYTHON_USEDEP}]
')
)
"

src_compile()
{
export MAX_JOBS="$(makeopts_jobs)" # Let ninja respect MAKEOPTS

use cuda && export USE_CUDA=1
use rocm && addpredict /dev/kfd && export USE_ROCM=1
use openmp && export USE_OPENMP=1
export BUILD_SOX=0
if use ffmpeg ; then
export FFMPEG_ROOT=${EPREFIX}/usr
else
export USE_FFMPEG=0
fi

distutils-r1_src_compile
}

python_test() {
use rocm && check_amdgpu

# https://projects.gentoo.org/python/guide/test.html#importerrors-for-c-extensions
rm -rf torchaudio || die

#needs pytorch/expecttest
#epytest
}

0 comments on commit 087931f

Please sign in to comment.