This is how I install emacs 30 on Windows 11, to get native compilation support.
winget install msys2.msys2
"profiles":
{
"list":
[
{
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
"guid": "{05becdfa-31e7-4900-ae5d-818333d164f6}",
"hidden": false,
"icon": "C:/msys64/mingw64.ico",
"name": "MINGW64 / MSYS2",
"startingDirectory": "%USERPROFILE%"
},
]
}
In a new mingw64 session
pacman -Syi
Restart the session if required.
pacman -S --needed
base-devel \
autoconf \
git \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-xpm-nox \
mingw-w64-x86_64-gmp \
mingw-w64-x86_64-gnutls \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-giflib \
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-librsvg \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-harfbuzz \
mingw-w64-x86_64-libgccjit \
mingw-w64-x86_64-sqlite3 \
mingw-w64-x86_64-libtree-sitter
Use github, it's a lot faster than savanah.
git clone https://github.com/emacs-mirror/emacs
cd emacs
git config core.autocrlf false
git checkout emacs-30
You may need to --force
the checkout.
./autogen.sh
./configure --prefix=/c/emacs \
--without-dbus \
--without-gconf \
--without-gsettings \
-without-pop \
--without-compress-install \
--with-gnutls \
--with-modules \
--with-wide-int
Change 16
to no more than 3/4 of your available CPU cores.
make -j 16 bootstrap
make install
- Add
C:\msys64\mingw64\bin\
toPATH
so the msys2 DLLs are available to the binaries. - Set
HOME
toC:\Users\Luke
Create a shortcut to "C:\emacs\bin\runemacs.exe"
, probably on ~\Desktop
.
Change the shortcut's Start in:
value to your home folder i.e. C:\Users\Luke\
In powershell or pwsh:
cd ~/.emacs.d/
New-Item -ItemType SymbolicLink -Path init.el -Target C:\Users\Luke\Repos\dotfiles\init.el
Use the shortcut to start emacs, so that open file/folder dialogs start at ~
(native-comp-available-p)
Should evaluate to t
.