mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 08:21:49 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| 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`.
 | |
| 
 | |
| --- a/helix-loader/src/lib.rs
 | |
| +++ b/helix-loader/src/lib.rs
 | |
| @@ -45,11 +45,12 @@ pub fn runtime_dir() -> PathBuf {
 | |
|  
 | |
|      // fallback to location of the executable being run
 | |
|      // canonicalize the path in case the executable is symlinked
 | |
| -    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()
 | |
| +    PathBuf::from("/usr/share/helix").join(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()
 | |
|  }
 | |
|  
 | |
|  pub fn config_dir() -> PathBuf {
 |