aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorEugene San (eugenesan)2013-11-12 07:22:57 +0200
committerAdam Vandenberg2013-12-04 20:07:38 -0800
commit35391ad88edfa20f770cfd4ffc7ad1d9fe0d58f6 (patch)
tree0bc39600a6f813759c49b09d45d68bce80ff5753 /Library/Formula
parente1b2ead292d7dfd1bdaea47ef0d6f296efe23158 (diff)
downloadhomebrew-35391ad88edfa20f770cfd4ffc7ad1d9fe0d58f6.tar.bz2
encfs: fixes for osx 10.9
- switch to osxfuse from fuse4x - better build flags generation - fix boost linkage issues (used inreplace instead of big patch in - original pull request) - fix symlinks on osx credits goes to: defunctzombie (https://github.com/mxcl/homebrew/pull/24017) ollyjinx (https://github.com/jollyjinx/encfs.macosx/commit/955de8e93e5dccb0406078da379a05e4bad02de9) Closes #23738. Closes #24196. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/encfs.rb70
1 files changed, 67 insertions, 3 deletions
diff --git a/Library/Formula/encfs.rb b/Library/Formula/encfs.rb
index d0f8b70a5..e288b7aa9 100644
--- a/Library/Formula/encfs.rb
+++ b/Library/Formula/encfs.rb
@@ -9,10 +9,45 @@ class Encfs < Formula
depends_on 'gettext'
depends_on 'boost'
depends_on 'rlog'
- depends_on 'fuse4x'
+ depends_on 'osxfuse'
+
+ conflicts_with 'fuse4x'
+
+ # Following patch and changes in install section,
+ # required for better compatibility with OSX, especially OSX 10.9.
+ # Changes are already in usptream and planned to be included in next stable release 1.75.
+ # For more details refer to:
+ # https://code.google.com/p/encfs/issues/detail?id=185#c10
+
+ def patches
+ # Fixes link times and xattr on links for OSX
+ DATA
+ end
def install
- inreplace "configure", "-lfuse", "-lfuse4x"
+ # Add correct flags for linkage with {osx,}fuse and gettext libs
+ ENV.append 'CPPFLAGS', %x[pkg-config fuse --cflags].chomp + "-I#{Formula.factory('gettext').include}"
+ ENV.append 'LDFLAGS', %x[pkg-config fuse --libs].chomp + "-L#{Formula.factory('gettext').lib}"
+ inreplace "configure", "-lfuse", "-losxfuse"
+
+ # Adapt to changes in recent Xcode by making local copy of endian-ness definitions
+ system "mkdir encfs/sys"
+ system "cp \"$HOMEBREW_SDKROOT/usr/include/sys/_endian.h\" encfs/sys/endian.h"
+
+ # Fix runtime "dyld: Symbol not found" errors
+ # Following 3 ugly inreplaces come instead of big patch
+ inreplace ["encfs/Cipher.cpp", "encfs/CipherFileIO.cpp", "encfs/NullCipher.cpp",
+ "encfs/NullNameIO.cpp", "encfs/SSL_Cipher.cpp"], "using boost::shared_ptr;", ""
+
+ inreplace ["encfs/BlockNameIO.cpp", "encfs/Cipher.cpp", "encfs/CipherFileIO.cpp",
+ "encfs/Context.cpp", "encfs/DirNode.cpp", "encfs/encfs.cpp",
+ "encfs/encfsctl.cpp", "encfs/FileNode.cpp", "encfs/FileUtils.cpp",
+ "encfs/MACFileIO.cpp", "encfs/main.cpp", "encfs/makeKey.cpp",
+ "encfs/NameIO.cpp", "encfs/NullCipher.cpp", "encfs/NullNameIO.cpp",
+ "encfs/SSL_Cipher.cpp", "encfs/StreamNameIO.cpp", "encfs/test.cpp"], "shared_ptr<", "boost::shared_ptr<"
+
+ inreplace ["encfs/Context.cpp", "encfs/encfsctl.cpp", "encfs/FileUtils.cpp"], "boost::boost::shared_ptr<", "boost::shared_ptr<"
+
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-boost=#{HOMEBREW_PREFIX}"
@@ -21,8 +56,37 @@ class Encfs < Formula
end
def caveats; <<-EOS.undent
- Make sure to follow the directions given by `brew info fuse4x-kext`
+ Make sure to follow the directions given by 'brew info osxfuse'
before trying to use a FUSE-based filesystem.
EOS
end
end
+
+__END__
+
+--- a/encfs/encfs.cpp
++++ b/encfs/encfs.cpp
+@@ -489,7 +489,11 @@
+
+ int _do_chmod(EncFS_Context *, const string &cipherPath, mode_t mode)
+ {
++#ifdef __APPLE__
++ return lchmod( cipherPath.c_str(), mode );
++#else
+ return chmod( cipherPath.c_str(), mode );
++#endif
+ }
+
+ int encfs_chmod(const char *path, mode_t mode)
+@@ -706,7 +710,11 @@
+ int _do_setxattr(EncFS_Context *, const string &cyName,
+ tuple<const char *, const char *, size_t, uint32_t> data)
+ {
++#ifdef __APPLE__
++ int options = XATTR_NOFOLLOW;
++#else
+ int options = 0;
++#endif
+ return ::setxattr( cyName.c_str(), data.get<0>(), data.get<1>(),
+ data.get<2>(), data.get<3>(), options );
+ }