mirror of
https://github.com/gromgit/homebrew-fuse.git
synced 2025-12-08 09:11:37 +00:00
cc shim path sanitization workaround
Homebrew's `cc` shim removes all `/usr/local` paths for non-`/usr/local` Homebrew installations (e.g. Apple Silicon Homebrew). This adds a `setup_fuse` method that copies FUSE files into a temp hierarchy for use during builds. (Symlinking the files doesn't work because the shim canonicalizes all paths.) Also add `ntfs-3g-mac` as a test case.
This commit is contained in:
parent
eb3fb874c1
commit
cff1a61202
2 changed files with 23 additions and 7 deletions
|
|
@ -37,6 +37,7 @@ class Ntfs3gMac < Formula
|
|||
depends_on :macos
|
||||
|
||||
def install
|
||||
setup_fuse
|
||||
ENV.append "LDFLAGS", "-lintl"
|
||||
|
||||
args = %W[
|
||||
|
|
|
|||
|
|
@ -11,17 +11,32 @@ class MacfuseRequirement < Requirement
|
|||
end
|
||||
|
||||
env do
|
||||
:std if Hardware::CPU.arm?
|
||||
|
||||
ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_LIBRARY/"Homebrew/os/mac/pkgconfig/fuse"
|
||||
|
||||
unless HOMEBREW_PREFIX.to_s == "/usr/local"
|
||||
ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
|
||||
ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include"
|
||||
end
|
||||
end
|
||||
|
||||
def message
|
||||
"This formula requires MacFUSE. Please run `brew install --cask macfuse` first."
|
||||
end
|
||||
end
|
||||
|
||||
class Formula
|
||||
|
||||
def setup_fuse
|
||||
unless HOMEBREW_PREFIX.to_s == "/usr/local"
|
||||
odebug "Setting up FUSE temp environment under #{buildpath}/temp"
|
||||
mkdir buildpath/"temp/include" do
|
||||
Dir["/usr/local/include/fuse*"].each { |f| cp_r f, "." }
|
||||
end
|
||||
mkdir buildpath/"temp/lib" do
|
||||
Dir["/usr/local/lib/*fuse*"].each { |f| cp_r f, "." }
|
||||
end
|
||||
Dir.glob(buildpath/"temp/**/*.*").each { |f| odebug ">>> #{f}" }
|
||||
ENV.append "CFLAGS", "-I#{buildpath}/temp/include"
|
||||
ENV.append "CFLAGS", "-I#{buildpath}/temp/include/fuse"
|
||||
ENV.append "CPPFLAGS", "-I#{buildpath}/temp/include"
|
||||
ENV.append "CPPFLAGS", "-I#{buildpath}/temp/include/fuse"
|
||||
ENV.append "LDFLAGS", "-I#{buildpath}/temp/lib"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue