File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed
Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ class Fricas < Formula
3030 depends_on "sbcl"
3131 depends_on "zstd"
3232
33+ on_linux do
34+ # Patchelf will corrupt the SBCL core which is appended to binary.
35+ on_arm do
36+ pour_bottle? only_if : :default_prefix
37+ end
38+ on_intel do
39+ pour_bottle? only_if : :default_prefix
40+ end
41+ end
42+
3343 def install
3444 args = [
3545 "--with-lisp=sbcl" ,
@@ -41,12 +51,27 @@ def install
4151 system "make"
4252 system "make" , "install"
4353 end
54+
55+ # Work around patchelf corrupting the SBCL core which is appended to binary
56+ # TODO: Find a better way to handle this in brew, either automatically or via DSL
57+ if OS . linux? && build . bottle?
58+ cd lib /"fricas" do
59+ system "tar" , "-czf" , "target.tar.gz" , "target"
60+ rm_r ( "target" )
61+ end
62+ end
4463 end
4564
46- test do
47- # Fails in Linux CI with "Can't find sbcl.core"
48- return if OS . linux? && ENV [ "HOMEBREW_GITHUB_ACTIONS" ]
65+ def post_install
66+ if ( lib /"fricas/target.tar.gz" ) . exist?
67+ cd lib /"fricas" do
68+ system "tar" , "-xzf" , "target.tar.gz"
69+ rm ( "target.tar.gz" )
70+ end
71+ end
72+ end
4973
74+ test do
5075 assert_match %r{ \( / \( pi\) 2\) \n } ,
5176 pipe_output ( "#{ bin } /fricas -nosman" , "integrate(sqrt(1-x^2),x=-1..1)::InputForm" )
5277 end
You can’t perform that action at this time.
0 commit comments