alr-repo/noisetorch/lure.sh
2022-10-24 20:34:46 +03:00

48 lines
1.4 KiB
Bash

name='noisetorch'
version=0.12.2
release=1
desc='NoiseTorch-ng is an easy to use open source application for Linux with PulseAudio or PipeWire. It creates a virtual microphone that suppresses noise, in any application.'
homepage='https://github.com/noisetorch/NoiseTorch'
architectures=('amd64')
license=('GPLv3')
provides=('noisetorch')
conflicts=('noisetorch')
deps=('git go')
build_deps=('git' 'go')
sources=("${name}::git+https://github.com/noisetorch/NoiseTorch.git#tag=v${version}"
"git+https://github.com/noisetorch/c-ringbuf.git"
"git+https://github.com/noisetorch/rnnoise.git"
)
checksums=('skip')
prepare() {
cd "${srcdir}"
git submodule init
git config submodule. "c/c-ringbuf".url "${srcdir}/c-ringbuf"
git config submodule. "c/rnnoise".url "${srcdir}/rnnoise"
git submodule--helper update
}
build() {
cd "${srcdir}
export GOPATH="${srcdir}/go"
pushd "c/ladspa"
make
popd
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go generate
go build -ldflags "${vendor_flags}" -linkmode=external" -o bin/noisetorch
go clean -modcache
}
package() {
install -Dm755 "./.bin/noisetorch" "${pkgdir}/usr/bin"
install -Dm644 ./assets/noisetorch.desktop "${pkgdir}/usr/share/applications/"
install -Dm644 ./assets/icon/noisetorch.png "${pkgdir}/usr/share/icons/hicolor/256x256/apps/"
}