about summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs
diff options
context:
space:
mode:
authorOlli Helenius <liff@iki.fi>2019-01-10 18:06:54 +0200
committerOlli Helenius <liff@iki.fi>2019-01-10 18:16:03 +0200
commit2f9b85855bff4a6a35edacc776336425f76eea64 (patch)
tree366fe86279057c66d59ff983fdfb8a6c2dc9089a /pkgs/applications/editors/emacs
parent9d08f32da6231b884483c5df016a27936cf08405 (diff)
downloadnixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar.gz
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar.bz2
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar.lz
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar.xz
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.tar.zst
nixlib-2f9b85855bff4a6a35edacc776336425f76eea64.zip
emacs: tramp: detect wrapped gvfsd-fuse daemon
Tramp checks for a running `gvfsd-fuse` process to figure out whether to enable
gvfs-based. Its `tramp-compat-process-running-p` function uses
`/proc/<pid>/comm` to check for the name of running process(es). In Nix, the
gvfsd processes are launched via wrappers and the name of `gvfsd-fuse` in
`comm` in Linux is `.gvfsd-fuse-wra` (truncated to 15 characters) which
means the process is not detected and `tramp-gvfs-enabled` ends up with
`nil` even when gvfs is available.

This patch adds `.gvfsd-fuse-wrapped` to the list of process names to check when
determining the value of `tramp-gvfs-enabled`.
Diffstat (limited to 'pkgs/applications/editors/emacs')
-rw-r--r--pkgs/applications/editors/emacs/default.nix1
-rw-r--r--pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch14
2 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix
index 948d8cb98672..4f268a3a104e 100644
--- a/pkgs/applications/editors/emacs/default.nix
+++ b/pkgs/applications/editors/emacs/default.nix
@@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./clean-env.patch
+    ./tramp-detect-wrapped-gvfsd.patch
   ];
 
   postPatch = lib.optionalString srcRepo ''
diff --git a/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch b/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch
new file mode 100644
index 000000000000..5d16194fd202
--- /dev/null
+++ b/pkgs/applications/editors/emacs/tramp-detect-wrapped-gvfsd.patch
@@ -0,0 +1,14 @@
+diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
+index f370abba31..f2806263a9 100644
+--- a/lisp/net/tramp-gvfs.el
++++ b/lisp/net/tramp-gvfs.el
+@@ -164,7 +164,8 @@ tramp-gvfs-enabled
+     (and (featurep 'dbusbind)
+ 	 (tramp-compat-funcall 'dbus-get-unique-name :system)
+ 	 (tramp-compat-funcall 'dbus-get-unique-name :session)
+-	 (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
++	 (or (tramp-compat-process-running-p ".gvfsd-fuse-wrapped")
++             (tramp-compat-process-running-p "gvfs-fuse-daemon")
+ 	     (tramp-compat-process-running-p "gvfsd-fuse"))))
+   "Non-nil when GVFS is available.")
+