1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
2 , gettext, mount, libuuid, kmod, macfuse-stubs, DiskArbitration
3 , crypto ? false, libgcrypt, gnutls
6 stdenv.mkDerivation rec {
10 outputs = [ "out" "dev" "man" "doc" ];
12 src = fetchFromGitHub {
16 sha256 = "sha256-nuFTsGkm3zmSzpwmhyY7Ke0VZfZU0jHOzEWaLBbglQk=";
19 buildInputs = [ gettext libuuid ]
20 ++ lib.optionals crypto [ gnutls libgcrypt ]
21 ++ lib.optionals stdenv.hostPlatform.isDarwin [ macfuse-stubs DiskArbitration ];
23 # Note: libgcrypt is listed here non-optionally because its m4 macros are
24 # being used in ntfs-3g's configure.ac.
25 nativeBuildInputs = [ autoreconfHook libgcrypt pkg-config ];
28 # https://github.com/tuxera/ntfs-3g/pull/39
29 ./autoconf-sbin-helpers.patch
30 ./consistent-sbindir-usage.patch
35 "--exec-prefix=\${prefix}"
36 "--enable-mount-helper"
38 "--enable-xattr-mappings"
39 "--${if crypto then "enable" else "disable"}-crypto"
41 "--with-mount-helper=${mount}/bin/mount"
42 "--with-umount-helper=${mount}/bin/umount"
43 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
44 "--with-modprobe-helper=${kmod}/bin/modprobe"
49 # Prefer ntfs-3g over the ntfs driver in the kernel.
50 ln -sv mount.ntfs-3g $out/sbin/mount.ntfs
53 enableParallelBuilding = true;
56 homepage = "https://github.com/tuxera/ntfs-3g";
57 description = "FUSE-based NTFS driver with full write support";
58 maintainers = with maintainers; [ dezgeg ];
59 platforms = with platforms; darwin ++ linux;
60 license = with licenses; [
61 gpl2Plus # ntfs-3g itself