homebrew-core/Formula/abcmidi.rb
2019-10-25 10:31:58 +09: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://ifdo.ca/~seymour/runabc/abcMIDI-2019.10.13.zip"
sha256 "f62781d5c15e160d0f9cc69707ca882b31bf8c4098ba1b572571875148988eca"
bottle do
cellar :any_skip_relocation
sha256 "76ecaff9bbce57a96c7e6c0beba3b4950897b0e6168c069a7b95aed42952a51e" => :catalina
sha256 "c45355419fb36807bcfc1dc0c3a494443bc7a90d19955ad901741586d82210ac" => :mojave
sha256 "c2d94cd8e26cc86c9acf54b3a5908f328a7e94dedee03b4974eb54f06ad602a5" => :high_sierra
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