diff --git a/pkgs/os-specific/linux/afuse/001-darwin-fdatasync.patch b/pkgs/os-specific/linux/afuse/001-darwin-fdatasync.patch new file mode 100644 index 000000000000..6a576c3a01a3 --- /dev/null +++ b/pkgs/os-specific/linux/afuse/001-darwin-fdatasync.patch @@ -0,0 +1,15 @@ +diff --git a/configure.ac b/configure.ac +index ef07d70..2da26aa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -27,9 +27,9 @@ if test "$have_fuse_opt_parse" = no; then + fi + AM_CONDITIONAL(FUSE_OPT_COMPAT, test "$have_fuse_opt_parse" = no) + + +-AC_CHECK_FUNCS([setxattr fdatasync getline fgetln]) ++AC_CHECK_FUNCS([setxattr getline fgetln]) + + AC_CONFIG_FILES([Makefile + src/Makefile + compat/Makefile]) diff --git a/pkgs/os-specific/linux/afuse/default.nix b/pkgs/os-specific/linux/afuse/default.nix index 33d950b76cd6..81b168a4712e 100644 --- a/pkgs/os-specific/linux/afuse/default.nix +++ b/pkgs/os-specific/linux/afuse/default.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, fuse }: +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + autoreconfHook, + fuse, +}: stdenv.mkDerivation rec { pname = "afuse"; @@ -11,12 +18,18 @@ stdenv.mkDerivation rec { sha256 = "sha256-KpysJRvDx+12BSl9pIGRqbJAM4W1NbzxMgDycGCr2RM="; }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + buildInputs = [ fuse ]; + patches = [ ./001-darwin-fdatasync.patch ]; + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' # Fix the build on macOS with macFUSE installed - substituteInPlace configure.ac --replace \ + substituteInPlace configure.ac --replace-fail \ 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' \ "" '';