Skip to content

Commit 4c3717d

Browse files
committed
buildapp: workaround to avoid corrupted Linux bottle
1 parent 34d1f83 commit 4c3717d

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Formula/b/buildapp.rb

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,28 @@ class Buildapp < Formula
2929
def install
3030
bin.mkpath
3131
system "make", "install", "DESTDIR=#{prefix}"
32+
33+
# Work around patchelf corrupting the SBCL core which is appended to binary
34+
# TODO: Find a better way to handle this in brew, either automatically or via DSL
35+
if OS.linux? && build.bottle?
36+
cp bin/"buildapp", prefix
37+
Utils::Gzip.compress(prefix/"buildapp")
38+
end
3239
end
3340

34-
test do
35-
# Fails in Linux CI with "Can't find sbcl.core"
36-
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]
41+
def post_install
42+
if (prefix/"buildapp.gz").exist?
43+
system "gunzip", prefix/"buildapp.gz"
44+
bin.install prefix/"buildapp"
45+
(bin/"buildapp").chmod 0755
46+
end
47+
end
3748

38-
code = "(defun f (a) (declare (ignore a)) (write-line \"Hello, homebrew\"))"
49+
test do
50+
code = <<~LISP
51+
(defun f (a) (declare (ignore a)) (write-line "Hello, homebrew"))
52+
LISP
3953
system bin/"buildapp", "--eval", code, "--entry", "f", "--output", "t"
40-
assert_equal `./t`, "Hello, homebrew\n"
54+
assert_equal "Hello, homebrew\n", shell_output("./t")
4155
end
4256
end

0 commit comments

Comments
 (0)