diff --git a/gnu/local.mk b/gnu/local.mk index 2fd563fa56c..ded241403b9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1959,6 +1959,8 @@ dist_patch_DATA = \ %D%/packages/patches/nss-3.115-disable-broken-tests.patch \ %D%/packages/patches/nss-3.115-disable-pkix-ocsp-tests.patch \ %D%/packages/patches/ntp-fix-dereferencing-the-wrong-variable.patch \ + %D%/packages/patches/ntfs-3g-autoconf-sbin-helpers.patch \ + %D%/packages/patches/ntfs-3g-consistent-sbindir-usage.patch \ %D%/packages/patches/nvi-add-function-prototypes.patch \ %D%/packages/patches/nvi-assume-preserve-path.patch \ %D%/packages/patches/nvi-dbpagesize-binpower.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b84ceceb6a0..a1bef323aff 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -7971,51 +7971,54 @@ invocations of itself.") (name "ntfs-3g") (version "2022.10.3") (source (origin - (method url-fetch) - (uri (string-append "https://tuxera.com/opensource/" - "ntfs-3g_ntfsprogs-" version ".tgz")) + (method git-fetch) + (uri + (git-reference + (url "https://github.com/tuxera/ntfs-3g") + (commit version))) + (file-name (git-file-name name version)) (sha256 (base32 - "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj")) - (modules '((guix build utils))) - (snippet '(begin - ;; Install under $prefix. - (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in") - (("/sbin") - "@sbindir@")))))) + "02cmw0b2r6j5rk733ljlyrjibv997ck8f9lwrs93kpr6d6q57qcy")) + (patches + (search-patches "ntfs-3g-autoconf-sbin-helpers.patch" + "ntfs-3g-consistent-sbindir-usage.patch")))) (build-system gnu-build-system) - (inputs (list util-linux ; libuuid + (inputs (list util-linux ; libuuid + kmod fuse-2)) - (native-inputs (list pkg-config)) + (native-inputs (list pkg-config autoconf automake libtool + libgcrypt)) ; for m4 macros (arguments - '(#:configure-flags (list "--disable-static" - "--disable-ldconfig" ;not necessary - "--exec-prefix=${prefix}" - "--with-fuse=external" ;use our own FUSE - "--enable-mount-helper" - "--enable-posix-acls" - "--enable-xattr-mappings") - #:phases - (modify-phases %standard-phases - ;; If users install ntfs-3g, they probably want to make it the - ;; default driver as well, so we opt for sensible defaults and link - ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to - ;; mount NTFS file systems.) - (add-after 'install 'install-link - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (sbin (string-append out "/sbin"))) - (symlink "mount.ntfs-3g" - (string-append sbin "/mount.ntfs")))))))) + (list + #:configure-flags + #~(list "--disable-static" + "--disable-ldconfig" ;not necessary + "--exec-prefix=${prefix}" + "--with-fuse=external" ;use our own FUSE + "--enable-mount-helper" + (string-append "--with-modprobe-helper=" + #$(this-package-input "kmod") "/bin/modprobe") + "--enable-posix-acls" + "--enable-xattr-mappings") + #:phases + #~(modify-phases %standard-phases + ;; If users install ntfs-3g, they probably want to make it the + ;; default driver as well, so we opt for sensible defaults and link + ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to + ;; mount NTFS file systems.) + (add-after 'install 'install-link + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (sbin (string-append out "/sbin"))) + (symlink "mount.ntfs-3g" + (string-append sbin "/mount.ntfs")))))))) (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/") (synopsis "Read-write access to NTFS file systems") (description "NTFS-3G provides read-write access to NTFS file systems, which are commonly found on Microsoft Windows. It is implemented as a FUSE file system. The package provides additional NTFS tools.") - (properties - '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases") - (upstream-name . "ntfs-3g_ntfsprogs"))) (license license:gpl2+))) (define-public ntfs-3g/static diff --git a/gnu/packages/patches/ntfs-3g-autoconf-sbin-helpers.patch b/gnu/packages/patches/ntfs-3g-autoconf-sbin-helpers.patch new file mode 100644 index 00000000000..f43ccfbcab3 --- /dev/null +++ b/gnu/packages/patches/ntfs-3g-autoconf-sbin-helpers.patch @@ -0,0 +1,45 @@ +From https://github.com/tuxera/ntfs-3g/pull/39 + +diff --git a/configure.ac b/configure.ac +index 9aa25bd5..c7c0437b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -188,3 +203,12 @@ ++ ++AC_ARG_WITH( ++ [modprobe-helper], ++ [AS_HELP_STRING([--with-modprobe-helper=BIN],[use the specified binary as modprobe helper @<:@default=/sbin/modprobe@:>@])], ++ [modprobe_helper="$withval"], ++ [modprobe_helper="/sbin/modprobe"] ++) ++AC_DEFINE_UNQUOTED([MODPROBE_HELPER], ["$modprobe_helper"], [Binary used as modprobe helper.]) ++ + # pthread_rwlock_t requires _GNU_SOURCE + AC_GNU_SOURCE + +diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c +index 9330500c..dd18a93f 100644 +--- a/src/lowntfs-3g.c ++++ b/src/lowntfs-3g.c +@@ -4463,7 +4463,7 @@ static fuse_fstype load_fuse_module(void) + int i; + struct stat st; + pid_t pid; +- const char *cmd = "/sbin/modprobe"; ++ const char *cmd = MODPROBE_HELPER; + char *env = (char*)NULL; + struct timespec req = { 0, 100000000 }; /* 100 msec */ + fuse_fstype fstype; +diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c +index d8227e71..f5d77252 100644 +--- a/src/ntfs-3g.c ++++ b/src/ntfs-3g.c +@@ -4171,7 +4171,7 @@ static fuse_fstype load_fuse_module(void) + int i; + struct stat st; + pid_t pid; +- const char *cmd = "/sbin/modprobe"; ++ const char *cmd = MODPROBE_HELPER; + char *env = (char*)NULL; + struct timespec req = { 0, 100000000 }; /* 100 msec */ + fuse_fstype fstype; diff --git a/gnu/packages/patches/ntfs-3g-consistent-sbindir-usage.patch b/gnu/packages/patches/ntfs-3g-consistent-sbindir-usage.patch new file mode 100644 index 00000000000..6f3a07f3cd2 --- /dev/null +++ b/gnu/packages/patches/ntfs-3g-consistent-sbindir-usage.patch @@ -0,0 +1,50 @@ +From https://github.com/tuxera/ntfs-3g/pull/39 + +diff --git a/ntfsprogs/Makefile.am b/ntfsprogs/Makefile.am +index 08228322..a390d8c7 100644 +--- a/ntfsprogs/Makefile.am ++++ b/ntfsprogs/Makefile.am +@@ -165,7 +165,7 @@ extras: libs $(EXTRA_PROGRAMS) + + if ENABLE_MOUNT_HELPER + install-exec-hook: +- $(INSTALL) -d $(DESTDIR)/$(sbindir) ++ $(INSTALL) -d $(DESTDIR)$(sbindir) + $(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)$(sbindir)/mkfs.ntfs + + install-data-hook: +@@ -173,7 +173,7 @@ install-data-hook: + $(LN_S) -f mkntfs.8 $(DESTDIR)$(man8dir)/mkfs.ntfs.8 + + uninstall-local: +- $(RM) -f $(DESTDIR)/sbin/mkfs.ntfs ++ $(RM) -f $(DESTDIR)$(sbindir)/mkfs.ntfs + $(RM) -f $(DESTDIR)$(man8dir)/mkfs.ntfs.8 + endif + +diff --git a/src/Makefile.am b/src/Makefile.am +index 8d984083..ea407067 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -66,9 +66,9 @@ endif + + if ENABLE_MOUNT_HELPER + install-exec-local: install-rootbinPROGRAMS +- $(MKDIR_P) "$(DESTDIR)/sbin" +- $(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/sbin/mount.ntfs-3g" +- $(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g" ++ $(MKDIR_P) "$(DESTDIR)$(rootsbindir)" ++ $(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)$(rootsbindir)/mount.ntfs-3g" ++ $(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)$(rootsbindir)/mount.lowntfs-3g" + + install-data-local: install-man8 + $(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8" +@@ -76,7 +76,7 @@ install-data-local: install-man8 + + uninstall-local: + $(RM) -f "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8" +- $(RM) -f "$(DESTDIR)/sbin/mount.ntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g" ++ $(RM) -f "$(DESTDIR)$(rootsbindir)/mount.ntfs-3g" "$(DESTDIR)$(rootsbindir)/mount.lowntfs-3g" + endif + + endif # ENABLE_NTFS_3G