git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #117360 from midchildan/feat/fuse/darwin

fuse: use macfuse-stubs instead on Darwin

commitfa9cd72c09fe2e296481c7788bd4126e5eac6d84 authorBernardo Meurer <bernardo@meurer.org> dateWed 24 Mar 2021, 21:18 (6 years ago) parent0ffaecbb67362d
9 files changed+38−18
doc/builders/packages/fuse.section.md+19 doc/builders/packages/index.xml+1 pkgs/development/python-modules/llfuse/default.nix+2−4 pkgs/os-specific/darwin/macfuse/default.nix+7−1 pkgs/tools/filesystems/bindfs/default.nix+2−4 pkgs/tools/filesystems/s3fs/default.nix+2−4 pkgs/tools/filesystems/unionfs-fuse/default.nix+3−3 pkgs/top-level/all-packages.nix+2−1 pkgs/top-level/python-packages.nix−1
doc/builders/packages/fuse.section.mdnew file+19
@@ -0,0 +1,19 @@
1+# FUSE {#sec-fuse}
2+
3+Some packages rely on
4+[FUSE](https://www.kernel.org/doc/html/latest/filesystems/fuse.html) to provide
5+support for additional filesystems not supported by the kernel.
6+
7+In general, FUSE software are primarily developed for Linux but many of them can
8+also run on macOS. Nixpkgs supports FUSE packages on macOS, but it requires
9+[macFUSE](https://osxfuse.github.io) to be installed outside of Nix. macFUSE
10+currently isn't packaged in Nixpkgs mainly because it includes a kernel
11+extension, which isn't supported by Nix outside of NixOS.
12+
13+If a package fails to run on macOS with an error message similar to the
14+following, it's a likely sign that you need to have macFUSE installed.
15+
16+ dyld: Library not loaded: /usr/local/lib/libfuse.2.dylib
17+ Referenced from: /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
18+ Reason: image not found
19+ [1] 92299 abort /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
doc/builders/packages/index.xml+1
@@ -12,6 +12,7 @@
1212 <xi:include href="emacs.section.xml" />
1313 <xi:include href="firefox.section.xml" />
1414 <xi:include href="fish.section.xml" />
15+ <xi:include href="fuse.section.xml" />
1516 <xi:include href="ibus.section.xml" />
1617 <xi:include href="kakoune.section.xml" />
1718 <xi:include href="linux.section.xml" />
pkgs/development/python-modules/llfuse/default.nix+2−4
@@ -1,5 +1,5 @@
11{ lib, stdenv, fetchPypi, fetchpatch, buildPythonPackage, pkg-config, pytest, fuse, attr, which
2−, contextlib2, macfuse-stubs, DiskArbitration
2+, contextlib2
33}:
44
55buildPythonPackage rec {
@@ -21,9 +21,7 @@ buildPythonPackage rec {
2121
2222 nativeBuildInputs = [ pkg-config ];
2323
24− buildInputs =
25− lib.optionals stdenv.isLinux [ fuse ]
26− ++ lib.optionals stdenv.isDarwin [ DiskArbitration macfuse-stubs ];
24+ buildInputs = [ fuse ];
2725
2826 checkInputs = [ pytest which ] ++
2927 lib.optionals stdenv.isLinux [ attr ];
pkgs/os-specific/darwin/macfuse/default.nix+7−1
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchurl, cpio, xar, undmg, libtapi }:
1+{ lib, stdenv, fetchurl, cpio, xar, undmg, libtapi, DiskArbitration }:
22
33stdenv.mkDerivation rec {
44 pname = "macfuse-stubs";
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
1010 };
1111
1212 nativeBuildInputs = [ cpio xar undmg libtapi ];
13+ propagatedBuildInputs = [ DiskArbitration ];
1314
1415 postUnpack = ''
1516 xar -xf 'Install macFUSE.pkg'
@@ -40,6 +41,11 @@ stdenv.mkDerivation rec {
4041 meta = with lib; {
4142 homepage = "https://osxfuse.github.io";
4243 description = "Build time stubs for FUSE on macOS";
44+ longDescription = ''
45+ macFUSE is required for this package to work on macOS. To install macFUSE,
46+ use the installer from the <link xlink:href="https://osxfuse.github.io/">
47+ project website</link>.
48+ '';
4349 platforms = platforms.darwin;
4450 maintainers = with maintainers; [ midchildan ];
4551
pkgs/tools/filesystems/bindfs/default.nix+2−4
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchurl, fuse, pkg-config, macfuse-stubs }:
1+{ lib, stdenv, fetchurl, fuse, pkg-config }:
22
33stdenv.mkDerivation rec {
44 version = "1.15.1";
@@ -10,9 +10,7 @@ stdenv.mkDerivation rec {
1010 };
1111
1212 nativeBuildInputs = [ pkg-config ];
13− buildInputs = if stdenv.isDarwin
14− then [ macfuse-stubs ]
15− else [ fuse ];
13+ buildInputs = [ fuse ];
1614 postFixup = ''
1715 ln -s $out/bin/bindfs $out/bin/mount.fuse.bindfs
1816 '';
pkgs/tools/filesystems/s3fs/default.nix+2−4
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, curl, openssl, libxml2, fuse, macfuse-stubs }:
1+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, curl, openssl, libxml2, fuse }:
22
33stdenv.mkDerivation rec {
44 pname = "s3fs-fuse";
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
1111 sha256 = "sha256-Agb0tq7B98Ioe0G/XEZCYcFQKnMuYXX9x0yg4Gvu3/k=";
1212 };
1313
14− buildInputs = [ curl openssl libxml2 ]
15− ++ lib.optionals stdenv.isLinux [ fuse ]
16− ++ lib.optionals stdenv.isDarwin [ macfuse-stubs ];
14+ buildInputs = [ curl openssl libxml2 fuse ];
1715 nativeBuildInputs = [ autoreconfHook pkg-config ];
1816
1917 configureFlags = [
pkgs/tools/filesystems/unionfs-fuse/default.nix+3−3
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchFromGitHub, cmake, fuse, macfuse-stubs }:
1+{ lib, stdenv, fetchFromGitHub, cmake, fuse }:
22
33stdenv.mkDerivation rec {
44 pname = "unionfs-fuse";
@@ -21,11 +21,11 @@ stdenv.mkDerivation rec {
2121
2222 postPatch = lib.optionalString stdenv.isDarwin ''
2323 substituteInPlace CMakeLists.txt \
24− --replace '/usr/local/include/osxfuse/fuse' '${macfuse-stubs}/include/fuse'
24+ --replace '/usr/local/include/osxfuse/fuse' '${fuse}/include/fuse'
2525 '';
2626
2727 nativeBuildInputs = [ cmake ];
28− buildInputs = [ (if stdenv.isDarwin then macfuse-stubs else fuse) ];
28+ buildInputs = [ fuse ];
2929
3030 # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
3131 # possible to do:
pkgs/top-level/all-packages.nix+2−1
@@ -19286,7 +19286,7 @@ in
1928619286 fusePackages = dontRecurseIntoAttrs (callPackage ../os-specific/linux/fuse {
1928719287 util-linux = util-linuxMinimal;
1928819288 });
19289− fuse = lowPrio fusePackages.fuse_2;
19289+ fuse = lowPrio (if stdenv.isDarwin then macfuse-stubs else fusePackages.fuse_2);
1929019290 fuse3 = fusePackages.fuse_3;
1929119291 fuse-common = hiPrio fusePackages.fuse_3.common;
1929219292
@@ -19425,6 +19425,7 @@ in
1942519425
1942619426 macfuse-stubs = callPackage ../os-specific/darwin/macfuse {
1942719427 inherit (darwin) libtapi;
19428+ inherit (darwin.apple_sdk.frameworks) DiskArbitration;
1942819429 };
1942919430
1943019431 osxsnarf = callPackage ../os-specific/darwin/osxsnarf { };
pkgs/top-level/python-packages.nix−1
@@ -3974,7 +3974,6 @@ in {
39743974
39753975 llfuse = callPackage ../development/python-modules/llfuse {
39763976 inherit (pkgs) fuse;
3977− inherit (pkgs.darwin.apple_sdk.frameworks) DiskArbitration;
39783977 };
39793978
39803979 llvmlite = callPackage ../development/python-modules/llvmlite {