diff options
| author | Joey Smith | 2015-01-23 17:05:04 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2015-01-25 16:30:32 +0000 |
| commit | 81fcb7b2ecc02a564da124e5e688e0c2f8cf158b (patch) | |
| tree | a3388f42fc5b07ffe2a635b83252a18b1c6fd9c0 | |
| parent | 4a465a14b9e9cd787ecbc6d9c07f9128e477fa40 (diff) | |
| download | homebrew-81fcb7b2ecc02a564da124e5e688e0c2f8cf158b.tar.bz2 | |
mdk 1.2.8 (new formula)
Add the GNU MDK suite (an implementation of Don Knuth's MIX computer
from "The Art of Computer Programming."
Closes #36180.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Formula/mdk.rb | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Library/Formula/mdk.rb b/Library/Formula/mdk.rb new file mode 100644 index 000000000..cfaebe733 --- /dev/null +++ b/Library/Formula/mdk.rb @@ -0,0 +1,52 @@ +class Mdk < Formula + homepage "https://www.gnu.org/software/mdk/mdk.html" + url "http://ftpmirror.gnu.org/mdk/v1.2.8/mdk-1.2.8.tar.gz" + mirror "https://ftp.gnu.org/gnu/mdk/v1.2.8/mdk-1.2.8.tar.gz" + sha1 "43bd40a48f88b3458c3bb6ccfd62d254b85c5fb8" + + depends_on "gtk+3" + depends_on "glib" + depends_on "libglade" + depends_on "flex" + depends_on "guile" + depends_on "intltool" => :build + depends_on "pkg-config" => :build + + def install + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}" + system "make", "install" + end + + test do + (testpath/"hello.mixal").write <<-EOS.undent + * (1) + * hello.mixal: say "hello world" in MIXAL (2) + * (3) + * label ins operand comment (4) + TERM EQU 19 the MIX console device number (5) + ORIG 1000 start address (6) + START OUT MSG(TERM) output data at address MSG (7) + HLT halt execution (8) + MSG ALF "MIXAL" (9) + ALF " HELL" (10) + ALF "O WOR" (11) + ALF "LD" (12) + END START end of the program (13) + EOS + system "#{bin}/mixasm", "hello" + output = `#{bin}/mixvm -r hello` + + expected = <<-EOS.undent + Program loaded. Start address: 1000 + Running ... + MIXAL HELLO WORLDXXX + ... done + EOS + expected = expected.gsub("XXX", " " *53) + + assert_equal expected, output + end +end |
