homebrew-core/Formula/abcmidi.rb

51 lines
1.6 KiB
Ruby
Raw Normal View History

class Abcmidi < Formula
homepage "http://www.ifdo.ca/~seymour/runabc/top.html"
url "http://www.ifdo.ca/~seymour/runabc/abcMIDI-2014-12-25.zip"
version "2014-12-25"
sha1 "a8d9509b32131015f38e0a31432b6c8990607888"
2014-12-11 13:01:30 +00:00
bottle do
cellar :any
2015-02-23 08:03:41 +00:00
sha1 "63b792b7623b9706183a9ea6513b53a536899403" => :yosemite
sha1 "d75b566f2cef9f3614b04d36847f95a162ae9341" => :mavericks
sha1 "1fdd827245c315ab25d8eb8a65e00d02d518e174" => :mountain_lion
2014-12-11 13:01:30 +00:00
end
def install
# configure creates a "Makefile" file. A "makefile" file already exist in
# the tarball. On case-sensitive file-systems, the "makefile" file won't
# be overridden and will be chosen over the "Makefile" file.
rm "makefile"
system "./configure", "--disable-debug", "--prefix=#{prefix}", "--mandir=#{man}"
# The Makefile is broken when using --prefix (value is added to path twice).
# abcmidi author is notified (2012-06-20). In the meantime, here's a fix.
inreplace "Makefile", "$(DESTDIR)${prefix}", "$(DESTDIR)"
system "make", "install"
end
test do
(testpath/"balk.abc").write <<-EOF.undent
X: 1
T: Abdala
F: http://www.youtube.com/watch?v=YMf8yXaQDiQ
L: 1/8
M: 2/4
K:Cm
Q:1/4=180
%%MIDI bassprog 32 % 32 Acoustic Bass
%%MIDI program 23 % 23 Tango Accordian
%%MIDI bassvol 69
%%MIDI gchord fzfz
|:"G"FDEC|D2C=B,|C2=B,2 |C2D2 |\
FDEC |D2C=B,|C2=B,2 |A,2G,2 :|
|:=B,CDE |D2C=B,|C2=B,2 |C2D2 |\
=B,CDE |D2C=B,|C2=B,2 |A,2G,2 :|
|:C2=B,2 |A,2G,2| C2=B,2|A,2G,2 :|
EOF
system "#{bin}/abc2midi", (testpath/"balk.abc")
end
end