homebrew-core/Formula/abcmidi.rb
2014-12-12 00:59:10 -05:00

52 lines
1.6 KiB
Ruby

require 'formula'
class Abcmidi < Formula
homepage 'http://www.ifdo.ca/~seymour/runabc/top.html'
url 'http://www.ifdo.ca/~seymour/runabc/abcMIDI-2014-11-18.zip'
version '2014-11-18'
sha1 '8a4ab723c689300535f0e7eeb7c1dc50629018f3'
bottle do
cellar :any
sha1 "caa541f475f5a062989ab28ba02f0e81bfaa301a" => :yosemite
sha1 "5ae503fe5b1753c9c0a29a64b105c3986757d5b0" => :mavericks
sha1 "5d4c6bad566b33e63739a8a085d9689ac3609c20" => :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.
system "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