homebrew-core/Formula/acl2.rb

55 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"
revision 1
bottle do
sha256 arm64_monterey: "f84536e0f18d7c4a5ecc41bfa9a98cdb720bf159d8849815b3cd3a2e645ab74a"
sha256 arm64_big_sur: "177db7153dfa84b9482379248a82a5c2ae92f3c116c02995e8742ed4036fdc2b"
sha256 monterey: "387f390962a6274b4ddaedadf1ad2779b2dc7d2de8a7b28819204de09455fa0a"
sha256 big_sur: "402731c77cfbb6cdfd6bbdbd7c28b37ba69a513c0e660db06f838a7ae300755b"
sha256 catalina: "5a6e19bcf49e3b7d9a6e4a64a1132d5e286734ce73544627f85378cdac6463c4"
sha256 x86_64_linux: "118c199aa527dc658e4237672f321631be421b98b649f650eb2993091cad28f0"
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