Skip to content

Instantly share code, notes, and snippets.

@federkamm
Created September 26, 2020 19:25
Show Gist options
  • Save federkamm/c268c7268e4a1e9d85ef4866a6afc6ea to your computer and use it in GitHub Desktop.
Save federkamm/c268c7268e4a1e9d85ef4866a6afc6ea to your computer and use it in GitHub Desktop.
Compile emacs-lucid --with-modules on WSL Debian (buster)
# install Debian emacs-lucid (will be replaced later)
sudo apt install emacs-lucid
# install all build dependencies
sudo apt-get build-dep emacs-lucid
sudo apt install build-essential devscripts ed
# make a temporary directory and dowload debian source (+ patches)
mkdir TEMPDIR
cd TEMPDIR
apt-get source emacs-lucid
cd emacs-26.1+1
# modify debian/rules file to add "--with-modules" configuration parameter
ed debian/rules <<EOF
s/mailutils/mailutils --with-modules/
w
q
EOF
# build emacs
# - will take some time
# - the first attempt fails but creates emacs-module.h, the second attempt succeedes
# - since WSL has problems with fakeroot daemon, use sudo (-rsudo) instead
debuild -b -uc -us -rsudo
cp debian/build-lucid/src/emacs-module.h src/
debuild -b -uc -us -rsudo
# replace emacs-lucid with self-built version
cd ..
sudo dpkg -i emacs-lucid_26.1+1-3.2+deb10u1_amd64.deb
# cleanup (be careful, better save emacs-lucid_26.1+1-3.2+deb10u1_amd64.deb first)
cd ..
rm -rf TEMPDIR
# run emacs
# - alternatively create a start menu shortcut with: C:\Windows\System32\wsl.exe env DISPLAY=:0 emacsclient -n -c -a ""
emacsclient -n -c -a ""
# notes
# - emacs-lucid behaves better than emacs-gtk when run in server-mode and X11 crashes (happens on Windows)
# - as X11-server try MobaXTerm in "Multiwindow mode" with DPI set to "auto" in X11 preferences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment