@@ -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