Skip to content

Commit 1545e88

Browse files
committed
Fix macFUSE pkg-config detection for Homebrew build
1 parent f80f4a9 commit 1545e88

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bigedit"
3-
version = "0.1.10"
3+
version = "0.1.11"
44
edition = "2021"
55
description = "A streaming TUI editor for very large files"
66
authors = ["bigedit contributors"]

homebrew/bigedit.rb

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,21 @@ class Bigedit < Formula
1616
def install
1717
if OS.mac?
1818
# On macOS, check if macFUSE is installed
19-
if File.exist?("/Library/Filesystems/macfuse.fs") || File.exist?("/usr/local/lib/libfuse.dylib")
20-
# macFUSE is installed, build with FUSE support
19+
macfuse_installed = File.exist?("/Library/Filesystems/macfuse.fs") ||
20+
File.exist?("/usr/local/lib/libfuse.dylib") ||
21+
File.exist?("/opt/homebrew/lib/libfuse.dylib")
22+
23+
if macfuse_installed
24+
# Set PKG_CONFIG_PATH for macFUSE (supports both Intel and Apple Silicon)
25+
fuse_pc_paths = [
26+
"/usr/local/lib/pkgconfig",
27+
"/opt/homebrew/lib/pkgconfig",
28+
"/Library/Frameworks/macFUSE.framework/Resources/pkgconfig"
29+
].select { |p| Dir.exist?(p) }.join(":")
30+
31+
ENV.prepend_path "PKG_CONFIG_PATH", fuse_pc_paths unless fuse_pc_paths.empty?
32+
33+
# Build with FUSE support
2134
system "cargo", "install", *std_cargo_args
2235
system "cargo", "build", "--release", "--bin", "bigedit-fuse"
2336
bin.install "target/release/bigedit-fuse"
@@ -34,7 +47,13 @@ def install
3447
end
3548

3649
def caveats
37-
if OS.mac? && !File.exist?("/Library/Filesystems/macfuse.fs") && !File.exist?("/usr/local/lib/libfuse.dylib")
50+
macfuse_installed = OS.mac? && (
51+
File.exist?("/Library/Filesystems/macfuse.fs") ||
52+
File.exist?("/usr/local/lib/libfuse.dylib") ||
53+
File.exist?("/opt/homebrew/lib/libfuse.dylib")
54+
)
55+
56+
if OS.mac? && !macfuse_installed
3857
<<~EOS
3958
bigedit was installed WITHOUT FUSE support.
4059

0 commit comments

Comments
 (0)