Fixed MacOS issue with Yara build environment variables in emacs

This commit is contained in:
Jaden Provost Maxwell-Comfort 2024-04-23 18:04:56 -07:00
parent c3c2b420d1
commit 56ac071e61
2 changed files with 9 additions and 2 deletions

View File

@ -452,7 +452,9 @@ When using emacs on MacOS, the environment variables are not synced properly and
#+begin_src emacs-lisp
(use-package exec-path-from-shell
:config (exec-path-from-shell-initialize))
:config
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)))
#+end_src
* Builtin Package Config

View File

@ -129,7 +129,12 @@ Install ~ccls~ with homebrew using the following command.
#+begin_src emacs-lisp
(use-package rustic
:defer t
:hook (rust-mode . lsp-deferred))
:hook (rust-mode . lsp-deferred)
:init
(let ((brew-prefix (string-trim (shell-command-to-string "brew --prefix"))))
(when (and (memq window-system '(mac ns x)) brew-prefix (f-directory-p brew-prefix))
(setenv "YARA_LIBRARY_PATH" (expand-file-name "lib" brew-prefix))
(setenv "YARA_INCLUDE_DIR" (expand-file-name "include" brew-prefix)))))
#+end_src
** C#