Merge wip into main: fix Homebrew macOS .app resolution
Globs build/bin/*.app instead of assuming a hardcoded YellowJacket.app, so `brew install` works with the lowercase bundle wails actually emits.
This commit is contained in:
@@ -45,10 +45,15 @@ class Yellowjacket < Formula
|
|||||||
"-clean", "-trimpath",
|
"-clean", "-trimpath",
|
||||||
"-ldflags", ldflags
|
"-ldflags", ldflags
|
||||||
|
|
||||||
# Wails emits a .app bundle on macOS and a bare ELF binary on Linux.
|
# Wails emits a .app bundle on macOS and a bare ELF binary on Linux. The
|
||||||
|
# bundle is named after `outputfilename` in wails.json; glob for it so a
|
||||||
|
# rename (or casing difference) can't silently break the install.
|
||||||
if OS.mac?
|
if OS.mac?
|
||||||
prefix.install "build/bin/YellowJacket.app"
|
app = Dir["build/bin/*.app"].first
|
||||||
bin.write_exec_script "#{prefix}/YellowJacket.app/Contents/MacOS/YellowJacket"
|
odie "wails build produced no .app bundle in build/bin" if app.nil?
|
||||||
|
prefix.install app
|
||||||
|
exe = Dir[prefix/"*.app/Contents/MacOS/*"].find { |f| File.executable?(f) }
|
||||||
|
bin.write_exec_script exe
|
||||||
else
|
else
|
||||||
bin.install "build/bin/yellowjacket"
|
bin.install "build/bin/yellowjacket"
|
||||||
end
|
end
|
||||||
@@ -57,7 +62,7 @@ class Yellowjacket < Formula
|
|||||||
test do
|
test do
|
||||||
# The GUI binary has no headless mode; assert it was built and is runnable.
|
# The GUI binary has no headless mode; assert it was built and is runnable.
|
||||||
if OS.mac?
|
if OS.mac?
|
||||||
assert_predicate prefix/"YellowJacket.app/Contents/MacOS/YellowJacket", :executable?
|
assert_predicate Dir[prefix/"*.app/Contents/MacOS/*"].first, :executable?
|
||||||
else
|
else
|
||||||
assert_predicate bin/"yellowjacket", :executable?
|
assert_predicate bin/"yellowjacket", :executable?
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user