summary refs log tree commit diff
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2021-04-01 22:45:16 +0900
committermidchildan <git@midchildan.org>2021-04-20 00:52:07 +0900
commit80651c123ee99f36f478e4248024a0e53ac7ada7 (patch)
tree9ecb1e8e29eca1a2d2c05eefed93eceede7c06b8
parentcdc642f008fc06eeb6d51561a120c21330924819 (diff)
downloadnixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar.gz
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar.bz2
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar.lz
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar.xz
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.tar.zst
nixpkgs-80651c123ee99f36f478e4248024a0e53ac7ada7.zip
docs: add FUSE packaging tip for Darwin
-rw-r--r--doc/builders/packages/fuse.section.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/builders/packages/fuse.section.md b/doc/builders/packages/fuse.section.md
index 5603481115e..eb0023fcbc3 100644
--- a/doc/builders/packages/fuse.section.md
+++ b/doc/builders/packages/fuse.section.md
@@ -17,3 +17,29 @@ following, it's a likely sign that you need to have macFUSE installed.
     Referenced from: /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
     Reason: image not found
     [1]    92299 abort      /nix/store/w8bi72bssv0bnxhwfw3xr1mvn7myf37x-sshfs-fuse-2.10/bin/sshfs
+
+Package maintainers may often encounter the following error when building FUSE
+packages on macOS:
+
+    checking for fuse.h... no
+    configure: error: No fuse.h found.
+
+This happens on autoconf based projects that uses `AC_CHECK_HEADERS` or
+`AC_CHECK_LIBS` to detect libfuse, and will occur even when the `fuse` package
+is included in `buildInputs`. It happens because libfuse headers throw an error
+on macOS if the `FUSE_USE_VERSION` macro is undefined. Many proejcts do define
+`FUSE_USE_VERSION`, but only inside C source files. This results in the above
+error at configure time because the configure script would attempt to compile
+sample FUSE programs without defining `FUSE_USE_VERSION`.
+
+There are two possible solutions for this problem in Nixpkgs:
+
+1. Pass `FUSE_USE_VERSION` to the configure script by adding
+   `CFLAGS=-DFUSE_USE_VERSION=25` in `configureFlags`. The actual value would
+   have to match the definition used in the upstream source code.
+2. Remove `AC_CHECK_HEADERS` / `AC_CHECK_LIBS` for libfuse.
+
+However, a better solution might be to fix the build script upstream to use
+`PKG_CHECK_MODULES` instead. This approach wouldn't suffer from the problem that
+`AC_CHECK_HEADERS`/`AC_CHECK_LIBS` has at the price of introducing a dependency
+on pkg-config.