class Rubberband < Formula desc "Audio time stretcher tool and library" homepage "https://breakfastquay.com/rubberband/" url "https://breakfastquay.com/files/releases/rubberband-4.0.0.tar.bz2" sha256 "af050313ee63bc18b35b2e064e5dce05b276aaf6d1aa2b8a82ced1fe2f8028e9" license "GPL-2.0-or-later" head "https://hg.sr.ht/~breakfastquay/rubberband", using: :hg livecheck do url :homepage regex(/href=.*?rubberband[._-]v?(\d+(?:\.\d+)+)\.t/i) end depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "libsamplerate" depends_on "libsndfile" on_linux do depends_on "fftw" depends_on "ladspa-sdk" depends_on "vamp-plugin-sdk" end fails_with gcc: "5" def install args = ["-Dresampler=libsamplerate"] args << "-Dfft=fftw" if OS.linux? system "meson", "setup", "build", *args, *std_meson_args system "meson", "compile", "-C", "build", "--verbose" system "meson", "install", "-C", "build" end test do output = shell_output("#{bin}/rubberband -t2 #{test_fixtures("test.wav")} out.wav 2>&1") assert_match "Pass 2: Processing...", output end end