homebrew-core/Formula/abcmidi.rb
2018-03-08 22:17:31 -08:00

48 lines
1.6 KiB
Ruby

class Abcmidi < Formula
desc "Converts abc music notation files to MIDI files"
homepage "https://www.ifdo.ca/~seymour/runabc/top.html"
url "https://www.ifdo.ca/~seymour/runabc/abcMIDI-2018.03.08.zip"
sha256 "22e9dc3db586c4b4443f8d078470d633bca912c0e29d87d08a4d01af345ca912"
bottle do
cellar :any_skip_relocation
sha256 "09732df802bba438c5c49d7fb7ec48dcf8f4958a5920c6cf9033df9ef18179a4" => :high_sierra
sha256 "a334e9e29811436759974ec83a9584c9d41936f31a47dcd2feb474bc99c5cf44" => :sierra
sha256 "078f1827623564bdb8e59d48b0c415ab93f052d18209c7039b8f81b73cab8d6e" => :el_capitan
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}"
system "make", "install"
end
test do
(testpath/"balk.abc").write <<~EOS
X: 1
T: Abdala
F: https://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 :|
EOS
system "#{bin}/abc2midi", (testpath/"balk.abc")
end
end