noisetorch-0.12.2-r1robert7k
download
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module git-r3 desktop
EGO_PN="https://github.com/noisetorch/NoiseTorch"
go-module_set_globals
DESCRIPTION="Real-time microphone noise suppression on Linux."
HOMEPAGE="https://github.com/noisetorch/NoiseTorch"
EGIT_REPO_URI="https://github.com/noisetorch/NoiseTorch"
EGIT_COMMIT="v${PV}"
BDEPEND=">=dev-lang/go-1.16"
# generated by dev-go/golicense
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
# From https://github.com/noisetorch/NoiseTorch/issues/468
PATCHES=( "${FILESDIR}/${P}-rnnoise-path.patch" )
src_compile() {
emake
}
src_install() {
setcap 'CAP_SYS_RESOURCE=+ep' bin/noisetorch
dobin "bin/noisetorch"
dodoc README.md
newicon "${S}/assets/icon/noisetorch.png" NoiseTorch.png
make_desktop_entry "noisetorch" "${PN^}" "${PN}" "Media" "Terminal=false"
local rnnoise_path="${EPREFIX}/usr/$(get_libdir)/ladspa/rnnoise_ladspa.so"
exeinto "/usr/$(get_libdir)/ladspa"
doexe "${S}/c/ladspa/rnnoise_ladspa.so"
cat > "${T}/90noisetorch" <<-EOF || die
NOISETORCH_RNNOISE_PATH="${rnnoise_path}"
EOF
doenvd "${T}/90noisetorch"
}
pkg_postinst() {
elog "Run env-update and restart pipewire for the changes to take effect."
}