homebrew-core/Formula/acl2.rb

54 lines
2.1 KiB
Ruby

class Acl2 < Formula
desc "Logic and programming language in which you can model computer systems"
homepage "https://www.cs.utexas.edu/users/moore/acl2/index.html"
url "https://github.com/acl2/acl2/archive/8.5.tar.gz"
sha256 "dcc18ab0220027b90f30cd9e5a67d8f603ff0e5b26528f3aab75dc8d3d4ebc0f"
license "BSD-3-Clause"
bottle do
sha256 arm64_monterey: "65f160edeb7343a5ea41ec0ab91fbb36902e5a02cd33dca6d0b6e29125c52e31"
sha256 arm64_big_sur: "e28f543c20b73982e8ca1dc3a087a8a9d1d6f942f9288abaf4a4f00de2009723"
sha256 monterey: "48c2b5ddd5b6d6aec6a0a684fd56f7b6f1e1db14b84594cf8f33167c19be71ef"
sha256 big_sur: "ba1e180287693c0aca83a56c7edd076aabfc766f5908b3ffd81e7811c8468892"
sha256 catalina: "6575854b060bce910466c26faba2715f58dd0a046653ca14f38dbf9e04b64f01"
sha256 x86_64_linux: "900df258e2e84228955cda24f7d6851ba953dbb85b7a6fd22fd27cd3b538a395"
end
depends_on "sbcl"
def install
# Remove prebuilt-binary.
(buildpath/"books/kestrel/axe/x86/examples/popcount/popcount-macho-64.executable").unlink
system "make",
"LISP=#{HOMEBREW_PREFIX}/bin/sbcl",
"ACL2=#{buildpath}/saved_acl2",
"USE_QUICKLISP=0",
"all", "basic"
system "make",
"LISP=#{HOMEBREW_PREFIX}/bin/sbcl",
"ACL2_PAR=p",
"ACL2=#{buildpath}/saved_acl2p",
"USE_QUICKLISP=0",
"all", "basic"
libexec.install Dir["*"]
(bin/"acl2").write <<~EOF
#!/bin/sh
export ACL2_SYSTEM_BOOKS='#{libexec}/books'
#{Formula["sbcl"].opt_bin}/sbcl --core '#{libexec}/saved_acl2.core' --userinit /dev/null --eval '(acl2::sbcl-restart)'
EOF
(bin/"acl2p").write <<~EOF
#!/bin/sh
export ACL2_SYSTEM_BOOKS='#{libexec}/books'
#{Formula["sbcl"].opt_bin}/sbcl --core '#{libexec}/saved_acl2p.core' --userinit /dev/null --eval '(acl2::sbcl-restart)'
EOF
end
test do
(testpath/"simple.lisp").write "(+ 2 2)"
output = shell_output("#{bin}/acl2 < #{testpath}/simple.lisp | grep 'ACL2 !>'")
assert_equal "ACL2 !>4\nACL2 !>Bye.", output.strip
end
end