Skip to content

Commit da5b4e1

Browse files
authored
Merge pull request #245138 from Homebrew/acl2-updates
acl2: improve formula readability, use saved_acl2 scripts
2 parents 4db9cb1 + 3770408 commit da5b4e1

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

Formula/a/acl2.rb

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,23 @@ class Acl2 < Formula
2525

2626
def install
2727
# Remove prebuilt binaries
28-
[
28+
rm([
2929
"books/kestrel/axe/x86/examples/popcount/popcount-macho-64.executable",
3030
"books/kestrel/axe/x86/examples/factorial/factorial.macho64",
3131
"books/kestrel/axe/x86/examples/tea/tea.macho64",
32-
].each do |f|
33-
(buildpath/f).unlink
34-
end
32+
])
3533

36-
system "make",
37-
"LISP=#{HOMEBREW_PREFIX}/bin/sbcl",
38-
"ACL2=#{buildpath}/saved_acl2",
39-
"USE_QUICKLISP=0",
40-
"all", "basic"
41-
system "make",
42-
"LISP=#{HOMEBREW_PREFIX}/bin/sbcl",
43-
"ACL2_PAR=p",
44-
"ACL2=#{buildpath}/saved_acl2p",
45-
"USE_QUICKLISP=0",
46-
"all", "basic"
34+
# Move files and then build to avoid saving build directory in files
4735
libexec.install Dir["*"]
4836

49-
(bin/"acl2").write <<~EOF
50-
#!/bin/sh
51-
export ACL2_SYSTEM_BOOKS='#{libexec}/books'
52-
#{Formula["sbcl"].opt_bin}/sbcl --core '#{libexec}/saved_acl2.core' --userinit /dev/null --eval '(acl2::sbcl-restart)'
53-
EOF
54-
(bin/"acl2p").write <<~EOF
55-
#!/bin/sh
56-
export ACL2_SYSTEM_BOOKS='#{libexec}/books'
57-
#{Formula["sbcl"].opt_bin}/sbcl --core '#{libexec}/saved_acl2p.core' --userinit /dev/null --eval '(acl2::sbcl-restart)'
58-
EOF
37+
sbcl = Formula["sbcl"].opt_bin/"sbcl"
38+
system "make", "-C", libexec, "all", "basic", "LISP=#{sbcl}", "USE_QUICKLISP=0"
39+
system "make", "-C", libexec, "all", "basic", "LISP=#{sbcl}", "USE_QUICKLISP=0", "ACL2_PAR=p"
40+
41+
["acl2", "acl2p"].each do |acl2|
42+
inreplace libexec/"saved_#{acl2}", Formula["sbcl"].prefix.realpath, Formula["sbcl"].opt_prefix
43+
(bin/acl2).write_env_script libexec/"saved_#{acl2}", ACL2_SYSTEM_BOOKS: "#{libexec}/books"
44+
end
5945
end
6046

6147
test do

0 commit comments

Comments
 (0)