2011-09-01 10:57:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Fuse4xKext < Formula
|
2014-02-08 17:50:45 +00:00
|
|
|
homepage 'http://fuse4x.github.io'
|
2013-04-01 16:43:03 +00:00
|
|
|
url 'https://github.com/fuse4x/kext/archive/fuse4x_0_9_2.tar.gz'
|
|
|
|
sha1 '4222c14b38325d9e41fb0925d2681dda3e73e861'
|
2011-09-01 10:57:13 +00:00
|
|
|
|
2012-06-12 21:18:21 +00:00
|
|
|
bottle do
|
2014-01-13 22:58:18 +00:00
|
|
|
cellar :any
|
|
|
|
revision 4
|
|
|
|
sha1 '1d1ab89b714ea897c981f356a659afaff977a0da' => :mavericks
|
|
|
|
sha1 '0a03e6a51e40fe3456b8f132549516e4cb996985' => :mountain_lion
|
|
|
|
sha1 '6f306f38557d016f5eaa0c999f2092d0767870e6' => :lion
|
2012-06-12 21:18:21 +00:00
|
|
|
end
|
|
|
|
|
2011-09-01 10:57:13 +00:00
|
|
|
def install
|
|
|
|
ENV.delete('CC')
|
|
|
|
ENV.delete('CXX')
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"-sdk",
|
2012-09-04 23:15:31 +00:00
|
|
|
"macosx#{MacOS.version}",
|
2011-09-01 10:57:13 +00:00
|
|
|
"-configuration", "Release",
|
|
|
|
"-alltargets",
|
2012-09-04 23:15:31 +00:00
|
|
|
"MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}",
|
2011-09-14 10:50:55 +00:00
|
|
|
"SYMROOT=build",
|
|
|
|
# Build a 32-bit kernel extension on Leopard and a fat binary for Snow
|
|
|
|
# Leopard/Lion.
|
2011-09-20 17:13:16 +00:00
|
|
|
"ARCHS=i386 #{'x86_64' if MacOS.prefer_64_bit?}", 'ONLY_ACTIVE_ARCH=NO'
|
2011-09-01 10:57:13 +00:00
|
|
|
]
|
|
|
|
|
2014-02-28 03:47:38 +00:00
|
|
|
xcodebuild *args
|
2011-09-01 10:57:13 +00:00
|
|
|
system "/bin/mkdir -p build/Release/fuse4x.kext/Support"
|
|
|
|
system "/bin/cp build/Release/load_fuse4x build/Release/fuse4x.kext/Support"
|
|
|
|
|
|
|
|
kext_prefix.install "build/Release/fuse4x.kext"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
2012-03-07 22:52:30 +00:00
|
|
|
message = <<-EOS.undent
|
2011-09-01 10:57:13 +00:00
|
|
|
In order for FUSE-based filesystems to work, the fuse4x kernel extension
|
|
|
|
must be installed by the root user:
|
2011-12-26 20:14:12 +00:00
|
|
|
|
2012-10-11 00:17:39 +00:00
|
|
|
sudo /bin/cp -rfX #{kext_prefix}/fuse4x.kext /Library/Extensions
|
2012-03-07 22:52:30 +00:00
|
|
|
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
|
2011-12-26 20:14:12 +00:00
|
|
|
|
|
|
|
If upgrading from a previous version of Fuse4x, the old kernel extension
|
|
|
|
will need to be unloaded before performing the steps listed above. First,
|
|
|
|
check that no FUSE-based filesystems are running:
|
|
|
|
|
2012-03-07 22:52:30 +00:00
|
|
|
mount -t fuse4x
|
2011-12-26 20:14:12 +00:00
|
|
|
|
|
|
|
Unmount all FUSE filesystems and then unload the kernel extension:
|
|
|
|
|
|
|
|
sudo kextunload -b org.fuse4x.kext.fuse4x
|
|
|
|
|
2011-09-01 10:57:13 +00:00
|
|
|
EOS
|
2012-03-07 22:52:30 +00:00
|
|
|
|
|
|
|
# In fuse4x version 0.9.0 the kext has been moved from /System to /Library to match
|
|
|
|
# filesystem layout convention from Apple.
|
|
|
|
# Check if the user has fuse4x kext in the old location.
|
|
|
|
# Remove this check Q4 2012 when it become clear that everyone migrated to 0.9.0+
|
2013-12-09 19:44:45 +00:00
|
|
|
if File.exist?('/System/Library/Extensions/fuse4x.kext/')
|
2012-03-07 22:52:30 +00:00
|
|
|
message += <<-EOS.undent
|
|
|
|
You have older version of fuse4x installed. Please remove it by running:
|
|
|
|
|
|
|
|
sudo rm -rf /System/Library/Extensions/fuse4x.kext/
|
|
|
|
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
return message
|
2011-09-01 10:57:13 +00:00
|
|
|
end
|
|
|
|
end
|