ntfs3g: add darwin build

This commit is contained in:
midchildan 2021-03-22 02:11:54 +09:00
parent f53b98ca01
commit 75b0ef646e
No known key found for this signature in database
GPG Key ID: D9A5748BACC6E3C2
2 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,7 @@
{lib, stdenv, fetchurl, util-linux, libuuid
, crypto ? false, libgcrypt, gnutls, pkg-config}:
{ lib, stdenv, fetchurl, pkg-config, mount, libuuid
, macfuse-stubs, DiskArbitration
, crypto ? false, libgcrypt, gnutls
}:
stdenv.mkDerivation rec {
pname = "ntfs3g";
@ -7,8 +9,9 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "man" "doc" ];
buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ];
nativeBuildInputs = lib.optional crypto pkg-config;
buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ]
++ lib.optionals stdenv.isDarwin [ macfuse-stubs DiskArbitration ];
nativeBuildInputs = [ pkg-config ];
src = fetchurl {
url = "https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz";
@ -19,8 +22,8 @@ stdenv.mkDerivation rec {
substituteInPlace src/Makefile.in --replace /sbin '@sbindir@'
substituteInPlace ntfsprogs/Makefile.in --replace /sbin '@sbindir@'
substituteInPlace libfuse-lite/mount_util.c \
--replace /bin/mount ${util-linux}/bin/mount \
--replace /bin/umount ${util-linux}/bin/umount
--replace /bin/mount ${mount}/bin/mount \
--replace /bin/umount ${mount}/bin/umount
'';
configureFlags = [
@ -43,7 +46,10 @@ stdenv.mkDerivation rec {
homepage = "https://www.tuxera.com/community/open-source-ntfs-3g/";
description = "FUSE-based NTFS driver with full write support";
maintainers = with maintainers; [ dezgeg ];
platforms = platforms.linux;
license = licenses.gpl2Plus; # and (lib)fuse-lite under LGPL2+
platforms = with platforms; darwin ++ linux;
license = with licenses; [
gpl2Plus # ntfs-3g itself
lgpl2Plus # fuse-lite
];
};
}

View File

@ -6804,7 +6804,9 @@ in
nss_pam_ldapd = callPackage ../tools/networking/nss-pam-ldapd {};
ntfs3g = callPackage ../tools/filesystems/ntfs-3g { };
ntfs3g = callPackage ../tools/filesystems/ntfs-3g {
inherit (darwin.apple_sdk.frameworks) DiskArbitration;
};
# ntfsprogs are merged into ntfs-3g
ntfsprogs = pkgs.ntfs3g;