From c9a2be179237e6744d94c4732e3dc6a0c1d1d43b Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 19 Apr 2023 12:29:51 +0300 Subject: [PATCH] securefs: 0.11.1 -> 0.13.1 --- .../securefs/add-macfuse-support.patch | 188 ------------------ pkgs/tools/filesystems/securefs/default.nix | 27 +-- pkgs/top-level/all-packages.nix | 4 +- 3 files changed, 10 insertions(+), 209 deletions(-) delete mode 100644 pkgs/tools/filesystems/securefs/add-macfuse-support.patch diff --git a/pkgs/tools/filesystems/securefs/add-macfuse-support.patch b/pkgs/tools/filesystems/securefs/add-macfuse-support.patch deleted file mode 100644 index 217f637ff9db..000000000000 --- a/pkgs/tools/filesystems/securefs/add-macfuse-support.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 8c65c2219976c02a68e27c28156ec0c4c02857e0 Mon Sep 17 00:00:00 2001 -From: midchildan -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(::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 - diff --git a/pkgs/tools/filesystems/securefs/default.nix b/pkgs/tools/filesystems/securefs/default.nix index 5fad07d87b73..791c01d8eed8 100644 --- a/pkgs/tools/filesystems/securefs/default.nix +++ b/pkgs/tools/filesystems/securefs/default.nix @@ -1,29 +1,22 @@ -{ lib, stdenv, fetchFromGitHub +{ lib +, stdenv +, fetchFromGitHub , cmake -, fuse }: +, fuse +}: stdenv.mkDerivation rec { pname = "securefs"; - version = "0.11.1"; + version = "0.13.1"; src = fetchFromGitHub { - sha256 = "1sxfgqgy63ml7vg7zj3glvra4wj2qmfv9jzmpm1jqy8hq7qlqlsx"; - rev = version; - repo = "securefs"; owner = "netheril96"; + repo = "securefs"; + rev = version; fetchSubmodules = true; + hash = "sha256-7xjGuN7jcLgfGkaBoSj+WsBpM806PPGzeBs7DnI+fwc="; }; - patches = [ - # Make it build with macFUSE - # Backported from https://github.com/netheril96/securefs/pull/114 - ./add-macfuse-support.patch - ]; - - postPatch = '' - sed -i -e '/TEST_SOURCES/d' CMakeLists.txt - ''; - nativeBuildInputs = [ cmake ]; buildInputs = [ fuse ]; @@ -42,7 +35,5 @@ stdenv.mkDerivation rec { ''; license = with licenses; [ bsd2 mit ]; platforms = platforms.unix; - # never built on aarch64-darwin since first introduction in nixpkgs - broken = stdenv.isDarwin && stdenv.isAarch64; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2ced5b6813c6..bf3e9fc0cce3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12029,9 +12029,7 @@ with pkgs; secp256k1 = callPackage ../tools/security/secp256k1 { }; - securefs = callPackage ../tools/filesystems/securefs { - stdenv = clangStdenv; - }; + securefs = darwin.apple_sdk_11_0.callPackage ../tools/filesystems/securefs { }; seehecht = callPackage ../tools/text/seehecht { };