···1+From 8c65c2219976c02a68e27c28156ec0c4c02857e0 Mon Sep 17 00:00:00 2001
2+From: midchildan <git@midchildan.org>
3+Date: Sun, 28 Mar 2021 23:39:59 +0900
4+Subject: [PATCH] Support the latest FUSE on macOS
5+6+This drops osxfuse support in favor of macFUSE. macFUSE is a newer
7+version of osxfuse that supports the latest release of macOS, and is a
8+rebranded version of the same project.
9+---
10+ CMakeLists.txt | 8 ++----
11+ LICENSE.md | 58 ++++++++++++++++++++------------------
12+ README.md | 2 +-
13+ sources/commands.cpp | 6 ----
14+ 4 files changed, 33 insertions(+), 41 deletions(-)
15+16+diff --git a/CMakeLists.txt b/CMakeLists.txt
17+index 7b5e57d..c176554 100755
18+--- a/CMakeLists.txt
19++++ b/CMakeLists.txt
20+@@ -18,12 +18,8 @@ git_describe(GIT_VERSION --tags)
21+ configure_file(${CMAKE_SOURCE_DIR}/sources/git-version.cpp.in ${CMAKE_BINARY_DIR}/git-version.cpp)
22+23+ if (UNIX)
24+- find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include PATH_SUFFIXES osxfuse)
25+- if (APPLE)
26+- find_library(FUSE_LIBRARIES osxfuse PATHS /usr/local/lib)
27+- else()
28+- find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
29+- endif()
30++ find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include)
31++ find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
32+ include_directories(${FUSE_INCLUDE_DIR})
33+ link_libraries(${FUSE_LIBRARIES})
34+ add_compile_options(-Wall -Wextra -Wno-unknown-pragmas)
35+diff --git a/LICENSE.md b/LICENSE.md
36+index a8f920c..b134532 100644
37+--- a/LICENSE.md
38++++ b/LICENSE.md
39+@@ -758,13 +758,11 @@ Public License instead of this License.
40+41+ ------------------------------------------------------------------------------
42+43+-# [osxfuse] (https://github.com/osxfuse/osxfuse)
44++# [macFUSE] (https://github.com/osxfuse/osxfuse)
45+46+-FUSE for macOS is a software developed by the osxfuse project and is covered
47+-under the following BSD-style license:
48++macFUSE is covered under the following license:
49+50+- Copyright (c) 2011-2016 Benjamin Fleischer
51+- Copyright (c) 2011-2012 Erik Larsson
52++ Copyright (c) 2011-2021 Benjamin Fleischer
53+ All rights reserved.
54+55+ Redistribution and use in source and binary forms, with or without
56+@@ -775,9 +773,13 @@ under the following BSD-style license:
57+ 2. Redistributions in binary form must reproduce the above copyright notice,
58+ this list of conditions and the following disclaimer in the documentation
59+ and/or other materials provided with the distribution.
60+- 3. Neither the name of osxfuse nor the names of its contributors may be used
61+- to endorse or promote products derived from this software without specific
62+- prior written permission.
63++ 3. Neither the name of the copyright holder nor the names of its contributors
64++ may be used to endorse or promote products derived from this software
65++ without specific prior written permission.
66++ 4. Redistributions in binary form, bundled with commercial software, are not
67++ allowed without specific prior written permission. This includes the
68++ automated download or installation or both of the binary form in the
69++ context of commercial software.
70+71+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
72+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
73+@@ -791,9 +793,9 @@ under the following BSD-style license:
74+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
75+ POSSIBILITY OF SUCH DAMAGE.
76+77+-FUSE for macOS is a fork of MacFUSE. MacFUSE has been developed by Google Inc..
78+-Additional information and the original source of MacFUSE are available on
79+-http://code.google.com/p/macfuse/. MacFUSE is covered under the following
80++macFUSE is a fork of the legacy Google MacFUSE software. Additional information
81++and the original source code of Google MacFUSE are available on
82++http://code.google.com/p/macfuse/. Google MacFUSE is covered under the following
83+ BSD-style license:
84+85+ Copyright (c) 2007—2009 Google Inc.
86+@@ -830,9 +832,9 @@ BSD-style license:
87+ Portions of this package were derived from code developed by other authors.
88+ Please read further for specific details.
89+90+-* Unless otherwise noted, parts of the FUSE for macOS kernel extension contain
91+- code derived from the FreeBSD version of FUSE, which is covered under the
92+- following BSD-style license:
93++* Unless otherwise noted, parts of the macFUSE kernel extension contain code
94++ derived from the FreeBSD version of FUSE, which is covered under the following
95++ BSD-style license:
96+97+ Copyright (C) 2005 Csaba Henk. All rights reserved.
98+99+@@ -856,12 +858,13 @@ Please read further for specific details.
100+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
101+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
102+103+-* Parts of the FUSE for macOS kernel extension contain code derived from Tuxera
104+- Inc.'s "rebel" branch. The original source of the "rebel" branch is available
105+- on https://github.com/tuxera. These modifications are covered under the
106+- following BSD-style license:
107++* Parts of the macFUSE kernel extension contain code derived from Tuxera's
108++ "rebel" branch. The original source code of the "rebel" branch is available on
109++ https://github.com/tuxera. These modifications are covered under the following
110++ BSD-style license:
111+112+ Copyright (c) 2010 Tuxera Inc.
113++ Copyright (c) 2011-2012 Erik Larsson
114+ All rights reserved.
115+116+ Redistribution and use in source and binary forms, with or without
117+@@ -888,9 +891,9 @@ Please read further for specific details.
118+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
119+ POSSIBILITY OF SUCH DAMAGE.
120+121+-* Parts of FUSE for macOS contain code derived from Fuse4X. The original source
122+- of Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under
123+- the following BSD-style license:
124++* Parts of macFUSE contain code derived from Fuse4X. The original source code of
125++ Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under the
126++ following BSD-style license:
127+128+ Copyright (c) 2011 Anatol Pomozov
129+ All rights reserved.
130+@@ -916,21 +919,20 @@ Please read further for specific details.
131+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
132+ POSSIBILITY OF SUCH DAMAGE.
133+134+-* Parts of the mount_osxfuse command-line program are covered under the Apple
135++* Parts of the mount_macfuse command-line program are covered under the Apple
136+ Public Source License (APSL). You can read the APSL at:
137+138+ http://www.opensource.apple.com/license/apsl/
139+140+-* fuse_kernel.h is an unmodified copy of the interface header from the Linux
141++* fuse_kernel.h is a modified copy of the interface header from the Linux
142+ FUSE distribution (https://github.com/libfuse/libfuse). fuse_kernel.h can be
143+ redistributed either under the GPL or under the BSD license. It is being
144+ redistributed here under the BSD license.
145+146+-* fuse_nodehash.c is a slightly modified version of HashNode.c from an
147+- Apple Developer Technical Support (DTS) sample code example. The original
148+- source, which is available on
149+- http://developer.apple.com/library/mac/#samplecode/MFSLives/, has the
150+- following disclaimer:
151++* fuse_nodehash.c is a modified version of HashNode.c from an Apple Developer
152++ Technical Support (DTS) sample code example. The original source, which is
153++ available on http://developer.apple.com/library/mac/#samplecode/MFSLives/,
154++ has the following disclaimer:
155+156+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
157+ Computer, Inc. Apple") in consideration of your agreement to the following
158+diff --git a/README.md b/README.md
159+index 9085e96..6fe3592 100644
160+--- a/README.md
161++++ b/README.md
162+@@ -28,7 +28,7 @@ There are already many encrypting filesystem in widespread use. Some notable one
163+164+ ### macOS
165+166+-Install with [Homebrew](https://brew.sh). [osxfuse](https://osxfuse.github.io) has to be installed beforehand.
167++Install with [Homebrew](https://brew.sh). [macFUSE](https://osxfuse.github.io) has to be installed beforehand.
168+ ```
169+ brew install securefs
170+ ```
171+diff --git a/sources/commands.cpp b/sources/commands.cpp
172+index a371212..862602b 100644
173+--- a/sources/commands.cpp
174++++ b/sources/commands.cpp
175+@@ -1252,12 +1252,6 @@ class VersionCommand : public CommandBase
176+ printf("WinFsp %u.%u\n", vn >> 16, vn & 0xFFFFu);
177+ }
178+ }
179+-#elif defined(__APPLE__)
180+- typedef const char* version_function(void);
181+- auto osx_version_func
182+- = reinterpret_cast<version_function*>(::dlsym(RTLD_DEFAULT, "osxfuse_version"));
183+- if (osx_version_func)
184+- printf("osxfuse %s\n", osx_version_func());
185+ #else
186+ typedef int version_function(void);
187+ auto fuse_version_func
188+