2021-03-21 17:11:54 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, mount, libuuid
|
|
|
|
, macfuse-stubs, DiskArbitration
|
|
|
|
, crypto ? false, libgcrypt, gnutls
|
|
|
|
}:
|
2008-07-24 14:11:02 +01:00
|
|
|
|
2008-01-28 19:31:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-07-04 17:34:51 +01:00
|
|
|
pname = "ntfs3g";
|
2021-09-02 11:26:47 +01:00
|
|
|
version = "2021.8.22";
|
2008-03-19 12:32:44 +00:00
|
|
|
|
2018-05-23 17:33:22 +01:00
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
|
|
|
|
2021-03-21 17:11:54 +00:00
|
|
|
buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ macfuse-stubs DiskArbitration ];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2011-12-24 22:28:00 +00:00
|
|
|
|
2007-09-01 19:15:19 +01:00
|
|
|
src = fetchurl {
|
2019-05-02 15:30:58 +01:00
|
|
|
url = "https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz";
|
2021-09-02 11:26:47 +01:00
|
|
|
sha256 = "55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb";
|
2007-09-01 19:15:19 +01:00
|
|
|
};
|
2008-03-19 12:32:44 +00:00
|
|
|
|
2011-12-24 22:28:00 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace src/Makefile.in --replace /sbin '@sbindir@'
|
|
|
|
substituteInPlace ntfsprogs/Makefile.in --replace /sbin '@sbindir@'
|
2008-07-24 14:11:02 +01:00
|
|
|
substituteInPlace libfuse-lite/mount_util.c \
|
2021-03-21 17:11:54 +00:00
|
|
|
--replace /bin/mount ${mount}/bin/mount \
|
|
|
|
--replace /bin/umount ${mount}/bin/umount
|
2008-07-24 14:11:02 +01:00
|
|
|
'';
|
2008-03-19 12:32:44 +00:00
|
|
|
|
2015-04-19 08:37:46 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-ldconfig"
|
|
|
|
"--exec-prefix=\${prefix}"
|
|
|
|
"--enable-mount-helper"
|
|
|
|
"--enable-posix-acls"
|
|
|
|
"--enable-xattr-mappings"
|
|
|
|
"--${if crypto then "enable" else "disable"}-crypto"
|
2019-10-10 21:53:15 +01:00
|
|
|
"--enable-extras"
|
2015-04-19 08:37:46 +01:00
|
|
|
];
|
2007-09-01 19:15:19 +01:00
|
|
|
|
2011-12-23 14:19:45 +00:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
# Prefer ntfs-3g over the ntfs driver in the kernel.
|
2011-12-24 22:28:00 +00:00
|
|
|
ln -sv mount.ntfs-3g $out/sbin/mount.ntfs
|
2011-12-23 14:19:45 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-09-02 11:27:51 +01:00
|
|
|
homepage = "https://github.com/tuxera/ntfs-3g";
|
2015-12-16 19:30:20 +00:00
|
|
|
description = "FUSE-based NTFS driver with full write support";
|
2017-03-27 18:11:17 +01:00
|
|
|
maintainers = with maintainers; [ dezgeg ];
|
2021-03-21 17:11:54 +00:00
|
|
|
platforms = with platforms; darwin ++ linux;
|
|
|
|
license = with licenses; [
|
|
|
|
gpl2Plus # ntfs-3g itself
|
|
|
|
lgpl2Plus # fuse-lite
|
|
|
|
];
|
2007-09-01 19:15:19 +01:00
|
|
|
};
|
|
|
|
}
|