nixpkgs/pkgs/tools/filesystems/securefs/add-macfuse-support.patch
2021-04-20 00:51:45 +09:00

188 lines
8.7 KiB
Diff

From 8c65c2219976c02a68e27c28156ec0c4c02857e0 Mon Sep 17 00:00:00 2001
From: midchildan <git@midchildan.org>
Date: Sun, 28 Mar 2021 23:39:59 +0900
Subject: [PATCH] Support the latest FUSE on macOS
This drops osxfuse support in favor of macFUSE. macFUSE is a newer
version of osxfuse that supports the latest release of macOS, and is a
rebranded version of the same project.
---
CMakeLists.txt | 8 ++----
LICENSE.md | 58 ++++++++++++++++++++------------------
README.md | 2 +-
sources/commands.cpp | 6 ----
4 files changed, 33 insertions(+), 41 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b5e57d..c176554 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,12 +18,8 @@ git_describe(GIT_VERSION --tags)
configure_file(${CMAKE_SOURCE_DIR}/sources/git-version.cpp.in ${CMAKE_BINARY_DIR}/git-version.cpp)
if (UNIX)
- find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include PATH_SUFFIXES osxfuse)
- if (APPLE)
- find_library(FUSE_LIBRARIES osxfuse PATHS /usr/local/lib)
- else()
- find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
- endif()
+ find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include)
+ find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
include_directories(${FUSE_INCLUDE_DIR})
link_libraries(${FUSE_LIBRARIES})
add_compile_options(-Wall -Wextra -Wno-unknown-pragmas)
diff --git a/LICENSE.md b/LICENSE.md
index a8f920c..b134532 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -758,13 +758,11 @@ Public License instead of this License.
------------------------------------------------------------------------------
-# [osxfuse] (https://github.com/osxfuse/osxfuse)
+# [macFUSE] (https://github.com/osxfuse/osxfuse)
-FUSE for macOS is a software developed by the osxfuse project and is covered
-under the following BSD-style license:
+macFUSE is covered under the following license:
- Copyright (c) 2011-2016 Benjamin Fleischer
- Copyright (c) 2011-2012 Erik Larsson
+ Copyright (c) 2011-2021 Benjamin Fleischer
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -775,9 +773,13 @@ under the following BSD-style license:
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- 3. Neither the name of osxfuse nor the names of its contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
+ 3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ 4. Redistributions in binary form, bundled with commercial software, are not
+ allowed without specific prior written permission. This includes the
+ automated download or installation or both of the binary form in the
+ context of commercial software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -791,9 +793,9 @@ under the following BSD-style license:
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-FUSE for macOS is a fork of MacFUSE. MacFUSE has been developed by Google Inc..
-Additional information and the original source of MacFUSE are available on
-http://code.google.com/p/macfuse/. MacFUSE is covered under the following
+macFUSE is a fork of the legacy Google MacFUSE software. Additional information
+and the original source code of Google MacFUSE are available on
+http://code.google.com/p/macfuse/. Google MacFUSE is covered under the following
BSD-style license:
Copyright (c) 2007—2009 Google Inc.
@@ -830,9 +832,9 @@ BSD-style license:
Portions of this package were derived from code developed by other authors.
Please read further for specific details.
-* Unless otherwise noted, parts of the FUSE for macOS kernel extension contain
- code derived from the FreeBSD version of FUSE, which is covered under the
- following BSD-style license:
+* Unless otherwise noted, parts of the macFUSE kernel extension contain code
+ derived from the FreeBSD version of FUSE, which is covered under the following
+ BSD-style license:
Copyright (C) 2005 Csaba Henk. All rights reserved.
@@ -856,12 +858,13 @@ Please read further for specific details.
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-* Parts of the FUSE for macOS kernel extension contain code derived from Tuxera
- Inc.'s "rebel" branch. The original source of the "rebel" branch is available
- on https://github.com/tuxera. These modifications are covered under the
- following BSD-style license:
+* Parts of the macFUSE kernel extension contain code derived from Tuxera's
+ "rebel" branch. The original source code of the "rebel" branch is available on
+ https://github.com/tuxera. These modifications are covered under the following
+ BSD-style license:
Copyright (c) 2010 Tuxera Inc.
+ Copyright (c) 2011-2012 Erik Larsson
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -888,9 +891,9 @@ Please read further for specific details.
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-* Parts of FUSE for macOS contain code derived from Fuse4X. The original source
- of Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under
- the following BSD-style license:
+* Parts of macFUSE contain code derived from Fuse4X. The original source code of
+ Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under the
+ following BSD-style license:
Copyright (c) 2011 Anatol Pomozov
All rights reserved.
@@ -916,21 +919,20 @@ Please read further for specific details.
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-* Parts of the mount_osxfuse command-line program are covered under the Apple
+* Parts of the mount_macfuse command-line program are covered under the Apple
Public Source License (APSL). You can read the APSL at:
http://www.opensource.apple.com/license/apsl/
-* fuse_kernel.h is an unmodified copy of the interface header from the Linux
+* fuse_kernel.h is a modified copy of the interface header from the Linux
FUSE distribution (https://github.com/libfuse/libfuse). fuse_kernel.h can be
redistributed either under the GPL or under the BSD license. It is being
redistributed here under the BSD license.
-* fuse_nodehash.c is a slightly modified version of HashNode.c from an
- Apple Developer Technical Support (DTS) sample code example. The original
- source, which is available on
- http://developer.apple.com/library/mac/#samplecode/MFSLives/, has the
- following disclaimer:
+* fuse_nodehash.c is a modified version of HashNode.c from an Apple Developer
+ Technical Support (DTS) sample code example. The original source, which is
+ available on http://developer.apple.com/library/mac/#samplecode/MFSLives/,
+ has the following disclaimer:
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Computer, Inc. Apple") in consideration of your agreement to the following
diff --git a/README.md b/README.md
index 9085e96..6fe3592 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ There are already many encrypting filesystem in widespread use. Some notable one
### macOS
-Install with [Homebrew](https://brew.sh). [osxfuse](https://osxfuse.github.io) has to be installed beforehand.
+Install with [Homebrew](https://brew.sh). [macFUSE](https://osxfuse.github.io) has to be installed beforehand.
```
brew install securefs
```
diff --git a/sources/commands.cpp b/sources/commands.cpp
index a371212..862602b 100644
--- a/sources/commands.cpp
+++ b/sources/commands.cpp
@@ -1252,12 +1252,6 @@ class VersionCommand : public CommandBase
printf("WinFsp %u.%u\n", vn >> 16, vn & 0xFFFFu);
}
}
-#elif defined(__APPLE__)
- typedef const char* version_function(void);
- auto osx_version_func
- = reinterpret_cast<version_function*>(::dlsym(RTLD_DEFAULT, "osxfuse_version"));
- if (osx_version_func)
- printf("osxfuse %s\n", osx_version_func());
#else
typedef int version_function(void);
auto fuse_version_func