libsamplerate: rm example if built w/o libsndfile

remove example program unless built with libsndfile

Closes Homebrew/homebrew#48409.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Rakesh 2016-01-25 01:53:27 -08:00 committed by Dominyk Tiller
parent 4e8f9d5c67
commit e4820015ba

View file

@ -1,3 +1,4 @@
class Libsamplerate < Formula
desc "Library for sample rate conversion of audio data"
homepage "http://www.mega-nerd.com/SRC"
@ -26,6 +27,22 @@ class Libsamplerate < Formula
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
# https://github.com/Homebrew/homebrew/issues/47133
# unless this formula is built with libsndfile, the example program
# is broken and hence, removed from installation.
rm_f "#{bin}/sndfile-resample" if build.without? "libsndfile"
end
def caveats
s = ""
if build.without? "libsndfile"
s += <<-EOS.undent
Unless this formula is built with libsndfile, the example program,
"sndfile-resample", is broken and hence, removed from installation.
EOS
end
s
end
end