Instructions on rebuilding Emacs for Mac

Still struggling when brew updates some package, and then Emacs
doesn't work anymore, because of the JIT.
This commit is contained in:
Howard Abrams 2023-05-25 10:36:55 -07:00
parent 134dbcbb08
commit 56f819939e

View file

@ -22,13 +22,13 @@ Best success comes from using the [[https://github.com/d12frosted/homebrew-emacs
brew tap d12frosted/emacs-plus
#+end_src
I find that I need to … at least, on my work computer, install two different versions of Emacs that I use to distinguish one for “work” and the other for other activities, like IRC and [[file:ha-feed-reader.org][elfeed]]. To that end, I run the following commands to install Emacs:
I find that I need to … at least, on my work computer, install two different versions of Emacs that I use to distinguish one for “work” and the other for other activities, like IRC and [[file:ha-feed-reader.org][elfeed]]. To that end, I run the following command to install Emacs:
#+begin_src sh
brew install emacs-plus@28 --with-native-comp --with-mailutils --with-imagemagick --with-elrumo2-icon
brew install emacs-plus@29 --with-native-comp --with-mailutils --with-savchenkovaleriy-big-sur-icon --with-no-frame-refocus --debug
#+end_src
And the following for “work”:
And if it fails, choose =shell= and type:
#+begin_src sh
brew install emacs-plus@29 --with-native-comp --with-mailutils --with-savchenkovaleriy-big-sur-icon --with-no-frame-refocus
make bootstrap
#+end_src
** Ouchie
Sometimes get the following error:
@ -49,8 +49,31 @@ Next make sure that all the dependencies are /reinstalled/ with the current oper
Then reinstall the =libgccjit= (as it doesnt seem to get picked up with the /deps/ listing):
#+begin_src sh
# Don't do this ... brew uninstall --ignore-dependencies libgccjit
brew reinstall libgccjit
brew uninstall libgccjit gcc
brew uninstall emacs-plus@29
brew install libgccjit gcc
#+end_src
And then reinstall Emacs above.
And if that doesnt work, then we need to delete all packages installed by brew, and essentially start all over to see what sub-sub-sub-package got rebuilt without =libgccjit=. Painful and time-consuming, but I basically let it run all night.
#+begin_src sh
PKG_FILE=$(mktemp --suffix=.txt)
brew list --formula > ${PKG_FILE}
while read PACKAGE
do
brew uninstall ${PACKAGE}
done < ${PKG_FILE}
brew install libgccjit gcc
# No, it doesn't seem that reinstall actuall works.
while read PACKAGE
do
brew install ${PACKAGE}
done < ${PKG_FILE}
echo "Good luck rebuilding Emacs."
#+end_src
* Supporting Packages
Now install all the extras: