mirror of
https://github.com/gromgit/homebrew-fuse.git
synced 2025-12-31 15:02:17 +00:00
Preliminary support for M1 builds
NOTE: I don't have an M1 Mac, so the only testing I can do is with a non-`/usr/local` Intel Homebrew installation. This should take care of "`cc` shim forbids `/usr/local` if Homebrew not installed under `/usr/local`", which is the default setup for M1 Homebrew.
This commit is contained in:
parent
7b0c9b121c
commit
2e2f25d0dc
29 changed files with 88 additions and 16 deletions
|
|
@ -19,6 +19,7 @@ class AfuseMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class ArchivemountMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.append_to_cflags "-I/usr/local/include/osxfuse"
|
ENV.append_to_cflags "-I/usr/local/include/osxfuse"
|
||||||
system "./configure", "--disable-debug",
|
system "./configure", "--disable-debug",
|
||||||
"--disable-dependency-tracking",
|
"--disable-dependency-tracking",
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class AvfsMac < Formula
|
||||||
depends_on "xz"
|
depends_on "xz"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
args = %W[
|
args = %W[
|
||||||
--prefix=#{prefix}
|
--prefix=#{prefix}
|
||||||
--disable-debug
|
--disable-debug
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class BindfsMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
args = %W[
|
args = %W[
|
||||||
--disable-debug
|
--disable-debug
|
||||||
--disable-dependency-tracking
|
--disable-dependency-tracking
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ class BtfsMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.cxx11
|
ENV.cxx11
|
||||||
inreplace "configure.ac", "fuse >= 2.8.0", "fuse >= 2.7.3"
|
inreplace "configure.ac", "fuse >= 2.8.0", "fuse >= 2.7.3"
|
||||||
system "autoreconf", "--force", "--install"
|
system "autoreconf", "--force", "--install"
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class CurlftpfsMac < Formula
|
||||||
# TODO: depend on specific X11 formulae instead
|
# TODO: depend on specific X11 formulae instead
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.append "CPPFLAGS", "-D__off_t=off_t"
|
ENV.append "CPPFLAGS", "-D__off_t=off_t"
|
||||||
system "autoreconf", "-fvi"
|
system "autoreconf", "-fvi"
|
||||||
system "./configure", "--disable-dependency-tracking",
|
system "./configure", "--disable-dependency-tracking",
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ class DislockerMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "cmake", "-DCMAKE_DISABLE_FIND_PACKAGE_Ruby=TRUE", *std_cmake_args
|
setup_fuse
|
||||||
|
system "cmake", "-DCMAKE_DISABLE_FIND_PACKAGE_Ruby=TRUE", *fuse_cmake_args, *std_cmake_args
|
||||||
system "make"
|
system "make"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,11 @@ class EncfsMac < Formula
|
||||||
depends_on "openssl@1.1"
|
depends_on "openssl@1.1"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.cxx11
|
ENV.cxx11
|
||||||
|
|
||||||
mkdir "build" do
|
mkdir "build" do
|
||||||
system "cmake", "..", *std_cmake_args
|
system "cmake", "..", *fuse_cmake_args, *std_cmake_args
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class Ext2fuseMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.append "LIBS", "-lfuse"
|
ENV.append "LIBS", "-lfuse"
|
||||||
ENV.append "CFLAGS",
|
ENV.append "CFLAGS",
|
||||||
"-D__FreeBSD__=10 -DENABLE_SWAPFS -I/usr/local/include/fuse "
|
"-D__FreeBSD__=10 -DENABLE_SWAPFS -I/usr/local/include/fuse "
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class Ext4fuseMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "make"
|
system "make"
|
||||||
bin.install "ext4fuse"
|
bin.install "ext4fuse"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ class FuseZipMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "make", "prefix=#{prefix}", "install"
|
setup_fuse
|
||||||
|
system "make", "prefix=#{prefix}", "PKG_CONFIG=#{fuse_pkgconfig}", "install"
|
||||||
end
|
end
|
||||||
|
|
||||||
test do
|
test do
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class GcsfuseMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
# Build the build_gcsfuse tool. Ensure that it doesn't pick up any
|
# Build the build_gcsfuse tool. Ensure that it doesn't pick up any
|
||||||
# libraries from the user's GOPATH; it should have no dependencies.
|
# libraries from the user's GOPATH; it should have no dependencies.
|
||||||
ENV.delete("GOPATH")
|
ENV.delete("GOPATH")
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ class GocryptfsMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV["GOPATH"] = buildpath
|
ENV["GOPATH"] = buildpath
|
||||||
(buildpath/"src/github.com/rfjakob/gocryptfs").install buildpath.children
|
(buildpath/"src/github.com/rfjakob/gocryptfs").install buildpath.children
|
||||||
cd "src/github.com/rfjakob/gocryptfs" do
|
cd "src/github.com/rfjakob/gocryptfs" do
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class GoofysMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
contents = Dir["*"]
|
contents = Dir["*"]
|
||||||
gopath = buildpath/"gopath"
|
gopath = buildpath/"gopath"
|
||||||
(gopath/"src/github.com/kahing/goofys").install contents
|
(gopath/"src/github.com/kahing/goofys").install contents
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class IfuseMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./autogen.sh"
|
system "./autogen.sh"
|
||||||
system "./configure", "--disable-dependency-tracking",
|
system "./configure", "--disable-dependency-tracking",
|
||||||
"--prefix=#{prefix}"
|
"--prefix=#{prefix}"
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class Mp3fsMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class RcloneMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "go", "build",
|
system "go", "build",
|
||||||
"-ldflags", "-s -X github.com/rclone/rclone/fs.Version=v#{version}",
|
"-ldflags", "-s -X github.com/rclone/rclone/fs.Version=v#{version}",
|
||||||
"-tags", "cmount", *std_go_args
|
"-tags", "cmount", *std_go_args
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,9 @@ class RofsFilteredMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
mkdir "build" do
|
mkdir "build" do
|
||||||
system "cmake", "..", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *std_cmake_args
|
system "cmake", "..", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *fuse_cmake_args, *std_cmake_args
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class S3BackerMac < Formula
|
||||||
depends_on "openssl@1.1"
|
depends_on "openssl@1.1"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./configure", "--prefix=#{prefix}"
|
system "./configure", "--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class S3fsMac < Formula
|
||||||
depends_on "nettle"
|
depends_on "nettle"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./autogen.sh"
|
system "./autogen.sh"
|
||||||
system "./configure", "--disable-dependency-tracking", "--with-gnutls", "--prefix=#{prefix}"
|
system "./configure", "--disable-dependency-tracking", "--with-gnutls", "--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ class S3qlMac < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
venv = virtualenv_create(libexec, "python3")
|
venv = virtualenv_create(libexec, "python3")
|
||||||
resources.each do |r|
|
resources.each do |r|
|
||||||
venv.pip_install r
|
venv.pip_install r
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ class SecurefsMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "cmake", ".", *std_cmake_args
|
setup_fuse
|
||||||
|
system "cmake", ".", *fuse_cmake_args, *std_cmake_args
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class SimpleMtpfsMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./autogen.sh"
|
system "./autogen.sh"
|
||||||
system "./configure", "--prefix=#{prefix}"
|
system "./configure", "--prefix=#{prefix}"
|
||||||
system "make"
|
system "make"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ class SquashfuseMac < Formula
|
||||||
depends_on "zstd"
|
depends_on "zstd"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./configure", "--disable-dependency-tracking",
|
system "./configure", "--disable-dependency-tracking",
|
||||||
"--disable-silent-rules",
|
"--disable-silent-rules",
|
||||||
"--prefix=#{prefix}"
|
"--prefix=#{prefix}"
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ class SshfsMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "autoreconf", "-fiv"
|
system "autoreconf", "-fiv"
|
||||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class TupMac < Formula
|
||||||
depends_on :macos
|
depends_on :macos
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV["TUP_LABEL"] = version
|
ENV["TUP_LABEL"] = version
|
||||||
system "./build.sh"
|
system "./build.sh"
|
||||||
bin.install "build/tup"
|
bin.install "build/tup"
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class WdfsMac < Formula
|
||||||
depends_on "neon"
|
depends_on "neon"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
||||||
"--prefix=#{prefix}"
|
"--prefix=#{prefix}"
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,10 @@ class XmountMac < Formula
|
||||||
patch :DATA
|
patch :DATA
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
setup_fuse
|
||||||
ENV.prepend_path "PKG_CONFIG_PATH", Formula["openssl@1.1"].opt_lib/"pkgconfig"
|
ENV.prepend_path "PKG_CONFIG_PATH", Formula["openssl@1.1"].opt_lib/"pkgconfig"
|
||||||
|
|
||||||
system "cmake", ".", *std_cmake_args
|
system "cmake", ".", *fuse_cmake_args, *std_cmake_args
|
||||||
system "make", "install"
|
system "make", "install"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,35 +23,79 @@ end
|
||||||
|
|
||||||
# Add `setup_fuse` to base Formula class, for use by FUSE formulae
|
# Add `setup_fuse` to base Formula class, for use by FUSE formulae
|
||||||
class Formula
|
class Formula
|
||||||
|
def need_alt_fuse?
|
||||||
|
HOMEBREW_PREFIX.to_s != "/usr/local"
|
||||||
|
end
|
||||||
|
|
||||||
|
def alt_fuse_root
|
||||||
|
buildpath/"temp"
|
||||||
|
end
|
||||||
|
|
||||||
|
def fuse_cmake_args
|
||||||
|
return unless need_alt_fuse?
|
||||||
|
|
||||||
|
%W[
|
||||||
|
-DCMAKE_INCLUDE_PATH=#{alt_fuse_root}/include/fuse;#{alt_fuse_root}/include
|
||||||
|
-DCMAKE_LIBRARY_PATH=#{alt_fuse_root}/lib
|
||||||
|
-DCMAKE_CXX_FLAGS=-I#{alt_fuse_root}/include/fuse\ -D_USE_FILE_OFFSET_BITS=64
|
||||||
|
-DPKG_CONFIG=#{fuse_pkgconfig}
|
||||||
|
-DPKG_CONFIG_EXECUTABLE=#{fuse_pkgconfig}
|
||||||
|
]
|
||||||
|
# -DFUSE_INCLUDE_DIR=#{alt_fuse_root}/include/fuse
|
||||||
|
# -DFUSE_LIBRARIES=#{alt_fuse_root}/lib/libfuse.dylib
|
||||||
|
end
|
||||||
|
|
||||||
def setup_fuse_includes
|
def setup_fuse_includes
|
||||||
mkdir buildpath/"temp/include" do
|
mkdir "#{alt_fuse_root}/include" do
|
||||||
Dir["/usr/local/include/fuse*"].each { |f| cp_r f, "." }
|
Dir["/usr/local/include/fuse*"].each { |f| cp_r f, "." }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_fuse_libs
|
def setup_fuse_libs
|
||||||
mkdir buildpath/"temp/lib" do
|
mkdir "#{alt_fuse_root}/lib" do
|
||||||
Dir["/usr/local/lib/*fuse*"].each { |f| cp_r f, "." }
|
Dir["/usr/local/lib/*fuse*"].each { |f| cp_r f, "." }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setup_fuse_pkgconfig
|
||||||
|
mkdir "#{alt_fuse_root}/bin" do
|
||||||
|
cp path/"../../lib/fuse-pkg-config", "."
|
||||||
|
inreplace "fuse-pkg-config", "%FUSE_ROOT%", "#{alt_fuse_root}"
|
||||||
|
#ENV.prepend_path "PATH", "#{alt_fuse_root}/bin"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def fuse_pkgconfig
|
||||||
|
return "#{alt_fuse_root}/bin/fuse-pkg-config" if need_alt_fuse?
|
||||||
|
"pkg-config"
|
||||||
|
end
|
||||||
|
|
||||||
def setup_fuse_env
|
def setup_fuse_env
|
||||||
odebug "Setting up FUSE temp environment under #{buildpath}/temp"
|
odebug "Setting up FUSE temp environment under #{alt_fuse_root}"
|
||||||
setup_fuse_includes
|
setup_fuse_includes
|
||||||
setup_fuse_libs
|
setup_fuse_libs
|
||||||
Dir.glob(buildpath/"temp/**/*.*").each { |f| odebug ">>> #{f}" }
|
setup_fuse_pkgconfig
|
||||||
|
Dir.glob("#{alt_fuse_root}/**/*").each { |f| odebug ">>> #{f}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_fuse_flags
|
def setup_fuse_flags
|
||||||
ENV.append "CFLAGS", "-I#{buildpath}/temp/include"
|
ENV.append "CFLAGS", "-I#{alt_fuse_root}/include"
|
||||||
ENV.append "CFLAGS", "-I#{buildpath}/temp/include/fuse"
|
ENV.append "CFLAGS", "-I#{alt_fuse_root}/include/fuse"
|
||||||
ENV.append "CPPFLAGS", "-I#{buildpath}/temp/include"
|
ENV.append "CFLAGS", "-D_USE_FILE_OFFSET_BITS=64"
|
||||||
ENV.append "CPPFLAGS", "-I#{buildpath}/temp/include/fuse"
|
ENV.append "CPPFLAGS", "-I#{alt_fuse_root}/include"
|
||||||
ENV.append "LDFLAGS", "-I#{buildpath}/temp/lib"
|
ENV.append "CPPFLAGS", "-I#{alt_fuse_root}/include/fuse"
|
||||||
|
ENV.append "CPPFLAGS", "-D_USE_FILE_OFFSET_BITS=64"
|
||||||
|
ENV.append "CXXFLAGS", "-I#{alt_fuse_root}/include"
|
||||||
|
ENV.append "CXXFLAGS", "-I#{alt_fuse_root}/include/fuse"
|
||||||
|
ENV.append "CXXFLAGS", "-D_USE_FILE_OFFSET_BITS=64"
|
||||||
|
ENV.append "LDFLAGS", "-L#{alt_fuse_root}/lib"
|
||||||
|
ENV.append "CGO_CPPFLAGS", "-I#{alt_fuse_root}/include"
|
||||||
|
ENV.append "CGO_CPPFLAGS", "-D_USE_FILE_OFFSET_BITS=64"
|
||||||
|
ENV.append "CGO_LDFLAGS", "-L#{alt_fuse_root}/lib"
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_fuse
|
def setup_fuse
|
||||||
return if HOMEBREW_PREFIX.to_s == "/usr/local"
|
return unless need_alt_fuse?
|
||||||
|
|
||||||
setup_fuse_env
|
setup_fuse_env
|
||||||
setup_fuse_flags
|
setup_fuse_flags
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue