aboutsummaryrefslogtreecommitdiffstats
path: root/community/helix/runtime-dir-fhs-location.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/helix/runtime-dir-fhs-location.patch')
-rw-r--r--community/helix/runtime-dir-fhs-location.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/community/helix/runtime-dir-fhs-location.patch b/community/helix/runtime-dir-fhs-location.patch
new file mode 100644
index 00000000000..77aea11289b
--- /dev/null
+++ b/community/helix/runtime-dir-fhs-location.patch
@@ -0,0 +1,35 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Wed, 02 Feb 2022 00:55:24 +0100
+Date: Mon, 04 Apr 2022 02:48:13 +0200
+Subject: [PATCH] Change runtime directory location to follow FHS
+
+Helix allows to specify the location of the runtime directory (which
+contains arch-independent modules) via environment variable
+`HELIX_RUNTIME`. Using this would require installing a wrapper script
+to set this variable prior executing `hx`.
+
+If this environment variable is not set, Helix fallbacks to directory
+`./runtime` relative to the directory of the `hx` executable. This is not
+suitable for Alpine (FHS).
+
+This patch changes the fallback to `/usr/share/helix/runtime`.
+--- i/helix-loader/src/lib.rs
++++ w/helix-loader/src/lib.rs
+@@ -56,11 +56,12 @@ fn prioritize_runtime_dirs() -> Vec<PathBuf> {
+
+ // fallback to location of the executable being run
+ // canonicalize the path in case the executable is symlinked
+- let exe_rt_dir = std::env::current_exe()
+- .ok()
+- .and_then(|path| std::fs::canonicalize(path).ok())
+- .and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
+- .unwrap();
++ let exe_rt_dir = PathBuf::from("/usr/share/helix").join(RT_DIR);
++ // let exe_rt_dir = std::env::current_exe()
++ // .ok()
++ // .and_then(|path| std::fs::canonicalize(path).ok())
++ // .and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
++ // .unwrap();
+ rt_dirs.push(exe_rt_dir);
+ rt_dirs
+ }