homebrew-core/Formula/abcmidi.rb

49 lines
1.6 KiB
Ruby

class Abcmidi < Formula
desc "Converts abc music notation files to MIDI files"
homepage "https://ifdo.ca/~seymour/runabc/top.html"
url "https://ifdo.ca/~seymour/runabc/abcMIDI-2020.07.26.zip"
sha256 "d21a9bce598231f98c092e360170ca21dd0c8dd08cb30e07b796e7ba9b5b1f28"
bottle do
cellar :any_skip_relocation
sha256 "7dfe44238532ee096580afddf4042a154ac8bd1db040934fb435c00059b000a2" => :catalina
sha256 "932fde1e8eeeb9cc2ccaf5a71c9b40ba039bd445ec5c0bd6ca0f614968069502" => :mojave
sha256 "392d8bd89f51f57757589453c46d2b939a4abb6c07b82e029bf8b661a55121df" => :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