···11+From 8c65c2219976c02a68e27c28156ec0c4c02857e0 Mon Sep 17 00:00:00 2001
22+From: midchildan <git@midchildan.org>
33+Date: Sun, 28 Mar 2021 23:39:59 +0900
44+Subject: [PATCH] Support the latest FUSE on macOS
55+66+This drops osxfuse support in favor of macFUSE. macFUSE is a newer
77+version of osxfuse that supports the latest release of macOS, and is a
88+rebranded version of the same project.
99+---
1010+ CMakeLists.txt | 8 ++----
1111+ LICENSE.md | 58 ++++++++++++++++++++------------------
1212+ README.md | 2 +-
1313+ sources/commands.cpp | 6 ----
1414+ 4 files changed, 33 insertions(+), 41 deletions(-)
1515+1616+diff --git a/CMakeLists.txt b/CMakeLists.txt
1717+index 7b5e57d..c176554 100755
1818+--- a/CMakeLists.txt
1919++++ b/CMakeLists.txt
2020+@@ -18,12 +18,8 @@ git_describe(GIT_VERSION --tags)
2121+ configure_file(${CMAKE_SOURCE_DIR}/sources/git-version.cpp.in ${CMAKE_BINARY_DIR}/git-version.cpp)
2222+2323+ if (UNIX)
2424+- find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include PATH_SUFFIXES osxfuse)
2525+- if (APPLE)
2626+- find_library(FUSE_LIBRARIES osxfuse PATHS /usr/local/lib)
2727+- else()
2828+- find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
2929+- endif()
3030++ find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include)
3131++ find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
3232+ include_directories(${FUSE_INCLUDE_DIR})
3333+ link_libraries(${FUSE_LIBRARIES})
3434+ add_compile_options(-Wall -Wextra -Wno-unknown-pragmas)
3535+diff --git a/LICENSE.md b/LICENSE.md
3636+index a8f920c..b134532 100644
3737+--- a/LICENSE.md
3838++++ b/LICENSE.md
3939+@@ -758,13 +758,11 @@ Public License instead of this License.
4040+4141+ ------------------------------------------------------------------------------
4242+4343+-# [osxfuse] (https://github.com/osxfuse/osxfuse)
4444++# [macFUSE] (https://github.com/osxfuse/osxfuse)
4545+4646+-FUSE for macOS is a software developed by the osxfuse project and is covered
4747+-under the following BSD-style license:
4848++macFUSE is covered under the following license:
4949+5050+- Copyright (c) 2011-2016 Benjamin Fleischer
5151+- Copyright (c) 2011-2012 Erik Larsson
5252++ Copyright (c) 2011-2021 Benjamin Fleischer
5353+ All rights reserved.
5454+5555+ Redistribution and use in source and binary forms, with or without
5656+@@ -775,9 +773,13 @@ under the following BSD-style license:
5757+ 2. Redistributions in binary form must reproduce the above copyright notice,
5858+ this list of conditions and the following disclaimer in the documentation
5959+ and/or other materials provided with the distribution.
6060+- 3. Neither the name of osxfuse nor the names of its contributors may be used
6161+- to endorse or promote products derived from this software without specific
6262+- prior written permission.
6363++ 3. Neither the name of the copyright holder nor the names of its contributors
6464++ may be used to endorse or promote products derived from this software
6565++ without specific prior written permission.
6666++ 4. Redistributions in binary form, bundled with commercial software, are not
6767++ allowed without specific prior written permission. This includes the
6868++ automated download or installation or both of the binary form in the
6969++ context of commercial software.
7070+7171+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7272+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7373+@@ -791,9 +793,9 @@ under the following BSD-style license:
7474+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
7575+ POSSIBILITY OF SUCH DAMAGE.
7676+7777+-FUSE for macOS is a fork of MacFUSE. MacFUSE has been developed by Google Inc..
7878+-Additional information and the original source of MacFUSE are available on
7979+-http://code.google.com/p/macfuse/. MacFUSE is covered under the following
8080++macFUSE is a fork of the legacy Google MacFUSE software. Additional information
8181++and the original source code of Google MacFUSE are available on
8282++http://code.google.com/p/macfuse/. Google MacFUSE is covered under the following
8383+ BSD-style license:
8484+8585+ Copyright (c) 2007—2009 Google Inc.
8686+@@ -830,9 +832,9 @@ BSD-style license:
8787+ Portions of this package were derived from code developed by other authors.
8888+ Please read further for specific details.
8989+9090+-* Unless otherwise noted, parts of the FUSE for macOS kernel extension contain
9191+- code derived from the FreeBSD version of FUSE, which is covered under the
9292+- following BSD-style license:
9393++* Unless otherwise noted, parts of the macFUSE kernel extension contain code
9494++ derived from the FreeBSD version of FUSE, which is covered under the following
9595++ BSD-style license:
9696+9797+ Copyright (C) 2005 Csaba Henk. All rights reserved.
9898+9999+@@ -856,12 +858,13 @@ Please read further for specific details.
100100+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
101101+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
102102+103103+-* Parts of the FUSE for macOS kernel extension contain code derived from Tuxera
104104+- Inc.'s "rebel" branch. The original source of the "rebel" branch is available
105105+- on https://github.com/tuxera. These modifications are covered under the
106106+- following BSD-style license:
107107++* Parts of the macFUSE kernel extension contain code derived from Tuxera's
108108++ "rebel" branch. The original source code of the "rebel" branch is available on
109109++ https://github.com/tuxera. These modifications are covered under the following
110110++ BSD-style license:
111111+112112+ Copyright (c) 2010 Tuxera Inc.
113113++ Copyright (c) 2011-2012 Erik Larsson
114114+ All rights reserved.
115115+116116+ Redistribution and use in source and binary forms, with or without
117117+@@ -888,9 +891,9 @@ Please read further for specific details.
118118+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
119119+ POSSIBILITY OF SUCH DAMAGE.
120120+121121+-* Parts of FUSE for macOS contain code derived from Fuse4X. The original source
122122+- of Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under
123123+- the following BSD-style license:
124124++* Parts of macFUSE contain code derived from Fuse4X. The original source code of
125125++ Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under the
126126++ following BSD-style license:
127127+128128+ Copyright (c) 2011 Anatol Pomozov
129129+ All rights reserved.
130130+@@ -916,21 +919,20 @@ Please read further for specific details.
131131+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
132132+ POSSIBILITY OF SUCH DAMAGE.
133133+134134+-* Parts of the mount_osxfuse command-line program are covered under the Apple
135135++* Parts of the mount_macfuse command-line program are covered under the Apple
136136+ Public Source License (APSL). You can read the APSL at:
137137+138138+ http://www.opensource.apple.com/license/apsl/
139139+140140+-* fuse_kernel.h is an unmodified copy of the interface header from the Linux
141141++* fuse_kernel.h is a modified copy of the interface header from the Linux
142142+ FUSE distribution (https://github.com/libfuse/libfuse). fuse_kernel.h can be
143143+ redistributed either under the GPL or under the BSD license. It is being
144144+ redistributed here under the BSD license.
145145+146146+-* fuse_nodehash.c is a slightly modified version of HashNode.c from an
147147+- Apple Developer Technical Support (DTS) sample code example. The original
148148+- source, which is available on
149149+- http://developer.apple.com/library/mac/#samplecode/MFSLives/, has the
150150+- following disclaimer:
151151++* fuse_nodehash.c is a modified version of HashNode.c from an Apple Developer
152152++ Technical Support (DTS) sample code example. The original source, which is
153153++ available on http://developer.apple.com/library/mac/#samplecode/MFSLives/,
154154++ has the following disclaimer:
155155+156156+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
157157+ Computer, Inc. Apple") in consideration of your agreement to the following
158158+diff --git a/README.md b/README.md
159159+index 9085e96..6fe3592 100644
160160+--- a/README.md
161161++++ b/README.md
162162+@@ -28,7 +28,7 @@ There are already many encrypting filesystem in widespread use. Some notable one
163163+164164+ ### macOS
165165+166166+-Install with [Homebrew](https://brew.sh). [osxfuse](https://osxfuse.github.io) has to be installed beforehand.
167167++Install with [Homebrew](https://brew.sh). [macFUSE](https://osxfuse.github.io) has to be installed beforehand.
168168+ ```
169169+ brew install securefs
170170+ ```
171171+diff --git a/sources/commands.cpp b/sources/commands.cpp
172172+index a371212..862602b 100644
173173+--- a/sources/commands.cpp
174174++++ b/sources/commands.cpp
175175+@@ -1252,12 +1252,6 @@ class VersionCommand : public CommandBase
176176+ printf("WinFsp %u.%u\n", vn >> 16, vn & 0xFFFFu);
177177+ }
178178+ }
179179+-#elif defined(__APPLE__)
180180+- typedef const char* version_function(void);
181181+- auto osx_version_func
182182+- = reinterpret_cast<version_function*>(::dlsym(RTLD_DEFAULT, "osxfuse_version"));
183183+- if (osx_version_func)
184184+- printf("osxfuse %s\n", osx_version_func());
185185+ #else
186186+ typedef int version_function(void);
187187+ auto fuse_version_func
188188+