mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
feat(native_comp)!: use new libgccjit Homebrew formula
The new libgccjit Homebrew formula negates the need to install a custom
patched gcc formula from source to get libgccjit.
As it's a separate formula, the file structure is a bit different
though, requiring some changes to the script. This means it is no longer
compatible libgccjit from the custom gcc formula. If you already have
the custom patched gcc formula installed, you can replace it with the
standard gcc formula by running:
brew reinstall gcc
In theory though, it should work even with the patched gcc formula, as
long as libgccjit is installed too. But it will probably produce a
Emacs.app that's around 35MB larger than it needs to, thanks to
duplicating the libgccjit.so.0.0.1 file within the final application.
BREAKING CHANGE: Standard Homewbrew `gcc` and `libgccjit` formula are now required for native-comp, instead of the custom patched gcc formula.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
|
||||
index 25e2de9..14ee6dc 100644
|
||||
index 25e2de9..bcedd31 100644
|
||||
--- a/lisp/emacs-lisp/comp.el
|
||||
+++ b/lisp/emacs-lisp/comp.el
|
||||
@@ -2801,6 +2801,36 @@ queued with LOAD %"
|
||||
@@ -2801,6 +2801,45 @@ queued with LOAD %"
|
||||
(comp-run-async-workers)
|
||||
(message "Compilation started."))))
|
||||
|
||||
@@ -13,15 +13,24 @@ index 25e2de9..14ee6dc 100644
|
||||
+ (string-match-p "\.app\/Contents\/MacOS\/?$"
|
||||
+ invocation-directory))
|
||||
+ (let* ((library-path-env (getenv "LIBRARY_PATH"))
|
||||
+ (gcc-dir (car (file-expand-wildcards
|
||||
+ (concat invocation-directory "lib-*/gcc/*"))))
|
||||
+ (gcc-darwin-dir (car (file-expand-wildcards
|
||||
+ (concat gcc-dir "/gcc/*apple-darwin*/*"))))
|
||||
+ (gcc-base-dir (concat invocation-directory "lib/gcc"))
|
||||
+ (gcc-version (car (seq-filter
|
||||
+ (lambda (dir) (string-match-p "^[0-9]+$" dir))
|
||||
+ (directory-files gcc-base-dir))))
|
||||
+ (gcc-dir (concat gcc-base-dir "/" gcc-version))
|
||||
+ (darwin-base-dir (car (file-expand-wildcards
|
||||
+ (concat gcc-dir "/gcc/*apple-darwin*"))))
|
||||
+ (darwin-version (car (seq-filter
|
||||
+ (lambda (dir)
|
||||
+ (string-match-p
|
||||
+ "^[0-9]+\\(\.[0-9]+\\(\.[0-9]+\\)?\\)?$" dir))
|
||||
+ (directory-files darwin-base-dir))))
|
||||
+ (darwin-dir (concat darwin-base-dir "/" darwin-version))
|
||||
+ (lib-paths (append
|
||||
+ (list gcc-dir gcc-darwin-dir)
|
||||
+ (list gcc-dir darwin-dir)
|
||||
+ (if library-path-env (list library-path-env) (list)))))
|
||||
+
|
||||
+ (when (and gcc-dir gcc-darwin-dir)
|
||||
+ (when (and gcc-dir darwin-dir)
|
||||
+ (setenv "LIBRARY_PATH" (mapconcat 'identity lib-paths ":")))))
|
||||
+
|
||||
+ ;; Remove advice, as it only needs to run once.
|
||||
|
||||
Reference in New Issue
Block a user