homebrew-core/Formula/abcmidi.rb
2015-06-05 14:47:57 +01:00

51 lines
1.8 KiB
Ruby

class Abcmidi < Formula
desc "Converts abc music notation files to MIDI files"
homepage "http://www.ifdo.ca/~seymour/runabc/top.html"
url "http://www.ifdo.ca/~seymour/runabc/abcMIDI-2015-05-13.zip"
version "2015-05-13"
sha256 "0129ec9b6986a422f5725ddeb65398668542b0fd331de44cd1dcf6e5f916f2ef"
bottle do
cellar :any
sha256 "9b2be3671e753b520558102e78a9be1bbab0da63e3170d4d005c4d455429914b" => :yosemite
sha256 "043e1224a88df07142dcc12393ced13f1f57bf5de5969d383a3630767afb5149" => :mavericks
sha256 "c754d08663264788f78cf3e8945b31c724d528b4e6b171188a86a164eee453e9" => :mountain_lion
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