2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
|
|
|
|
, gettext, mount, libuuid, kmod, macfuse-stubs, DiskArbitration
|
2021-04-12 18:23:04 +00:00
|
|
|
, crypto ? false, libgcrypt, gnutls
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ntfs3g";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "2022.5.17";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tuxera";
|
|
|
|
repo = "ntfs-3g";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-xh8cMNIHeJ1rtk5zwOsmcxeedgZ3+MSiWn2UC7y+gtQ=";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gettext libuuid ]
|
|
|
|
++ lib.optionals crypto [ gnutls libgcrypt ]
|
2021-04-12 18:23:04 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ macfuse-stubs DiskArbitration ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Note: libgcrypt is listed here non-optionally because its m4 macros are
|
|
|
|
# being used in ntfs-3g's configure.ac.
|
|
|
|
nativeBuildInputs = [ autoreconfHook libgcrypt pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/tuxera/ntfs-3g/pull/39
|
|
|
|
./autoconf-sbin-helpers.patch
|
|
|
|
./consistent-sbindir-usage.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-ldconfig"
|
|
|
|
"--exec-prefix=\${prefix}"
|
|
|
|
"--enable-mount-helper"
|
|
|
|
"--enable-posix-acls"
|
|
|
|
"--enable-xattr-mappings"
|
|
|
|
"--${if crypto then "enable" else "disable"}-crypto"
|
|
|
|
"--enable-extras"
|
2022-06-16 17:23:12 +00:00
|
|
|
"--with-mount-helper=${mount}/bin/mount"
|
|
|
|
"--with-umount-helper=${mount}/bin/umount"
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2022-06-16 17:23:12 +00:00
|
|
|
"--with-modprobe-helper=${kmod}/bin/modprobe"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
# Prefer ntfs-3g over the ntfs driver in the kernel.
|
|
|
|
ln -sv mount.ntfs-3g $out/sbin/mount.ntfs
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://github.com/tuxera/ntfs-3g";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "FUSE-based NTFS driver with full write support";
|
|
|
|
maintainers = with maintainers; [ dezgeg ];
|
2021-04-12 18:23:04 +00:00
|
|
|
platforms = with platforms; darwin ++ linux;
|
|
|
|
license = with licenses; [
|
|
|
|
gpl2Plus # ntfs-3g itself
|
|
|
|
lgpl2Plus # fuse-lite
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|