1

My Linux distribution ships out Emacs version 28.2, with a particular build configuration, and I currently use that.

However, it was not compiled with xwidget support, and so I want to build 28.2 from source.

I've already done this for Emacs 27.2, and I can alternatively run emacs, which is the system installation of version 28.2, or emacs-27.2, which is the version I built from source. (I mostly run the latter with the -Q option, to test out issues with packages.)

If I build 28.2 from source with the xwidget flag, will I be able to keep and use the distro-shipped build as well? I.e. the new build is identified via emacs-28.2 rather than just emacs.

And if I can get two separate instances of 28.2 on my system, will they not recognize the other's byte-compiled packages (see this question), the same way different versions (e.g. 27.2 and 28.2) have incompatible byte-compilations?

shynur
  • 5,253
  • 1
  • 4
  • 25
nonreligious
  • 578
  • 3
  • 15
  • 2
    Generally speaking, your distro's Emacs will be installed in /usr/bin and there will be both an emacs-28.2 and a symlink to it under the name emacs. When you build it yourself and do make install, you will get the same thing but in /usr/local/bin by default. So if you do nothing else, both emacs and emacs-28.2 will get you whichever version is found first in your PATH. I would recommend that you disambiguate it by renaming your executable (and the symlink) in /usr/local/bin to something more distinctive. N.B. Different distros can and do things differently so YMMV. – NickD Jul 02 '23 at 21:03
  • 1
    As for the byte-compilation question, there should be no difference: xwidget support will not affect how the byte compiler works, so byte-compiled packages will work the same way with both versions. – NickD Jul 02 '23 at 21:05
  • @NickD Thanks -- in my system, it looks like everything gets installed to /usr/bin; there's nothing of the form emacs* in /usr/local/bin. Is there any way to rename the executable binary to something like emacs-28.2-xwidgets (or any other name) when building it? I guess I can use the prefix option and do --prefix=$HOME/emacs-xwidgets/, rename the resulting binary, and put a link to it in my PATH. – nonreligious Jul 03 '23 at 16:38
  • 1
    The top-level Makefile in the Emacs repo defines prefix=/usr/local, so you (or somebody...) must have done something (perhaps ./configure --prefix=/usr ?) to change that. For the renaming, you can modify the Makefile but it can be easily done by a three-line script after installation: mv /usr/local/bin/emacs-28.2 /usr/local/bin/emacs-28.2-xwidgets; ln -s /usr/local/bin/emacs-28.2-xwidgets /usr/local/bin/emacs-xwidgets; rm /usr/local/bin/emacs. – NickD Jul 03 '23 at 17:32
  • @NickD You're probably right about the previous build install, it was a while back now and I didn't document it unfortunately. I think I did change the default location because the libraries for 27.2 would be installed to /usr/lib/emacs/27.2, which already had a directory for 28.2 -- there's no such Emacs directory on my system in /usr/local/lib. – nonreligious Jul 03 '23 at 18:42
  • Thanks for the advice on the post-install script, but re:my previous point, the new build would look for /usr/local/lib/emacs/28.2 for the library files, right? Renaming or moving the directory wouldn't help. I guess that way it doesn't conflict with my existing install. – nonreligious Jul 03 '23 at 18:42

0 Answers0