homebrew-core/Formula/abcmidi.rb
2018-04-25 18:40:14 +10: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.04.24.zip"
sha256 "816367f511847cec0ad27eae953f8e8e594352f4341957ee86ca8da2c1d1e935"
bottle do
cellar :any_skip_relocation
sha256 "3ea6fa5236d92d833e920642cf87baf79372163ab188b05d040abcaae3c785d9" => :high_sierra
sha256 "5879de0ce4c6b8c2fbf05d5fb876dca861f5a055c195f5dc7f01386163570d1c" => :sierra
sha256 "8bffd407f559820ed7f0343f5a5c5450437bfa0b0bcf4b730ae5e79b718dfbba" => :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