This post details compiling and installing the *.deb files for Emacs 28.2 using the Debian maintainer's git repository intended for sid. Yes, emacswiki mentions 2 repositories from which one may install such newer Emacs versions, so this post is partly intended as an exercise of getting to know Debian's packaging tools.
Note, it doesn't seem easily possible to compile Emacs 28.2 on Debian 9, so I had to upgrade one of my machines to Debian 10 for this to work.
Edit: Thanks to spwhitton and starenka for suggesting the flags `dpkg-buildpackage -b` and `git clone --depth 1`, respectively.
To compile and install the Emacs packages except for the info manual:
mkdir -p ~/src/deb/
cd ~/src/deb/
git clone --depth 1 https://salsa.debian.org/rlb/deb-emacs.git
cd deb-emacs/
sudo apt install packaging-dev # For quilt, etc.
# Edit files to use gcc-10 and related packages instead of gcc-12:
sed -i 's#gcc-12#gcc-10#' debian/control debian/rules
sed -i 's#libgccjit-12-dev#libgccjit-10-dev#' debian/control
# Find missing dependencies.
dpkg-checkbuilddeps
# Install missing dependencies; in my case, in alphabetical sorted order:
sudo apt install \
libacl1-dev \
libgccjit-10-dev \
libgif-dev \
libgnutls28-dev \
libgpm-dev \
libjansson-dev \
liblockfile-dev \
libm17n-dev \
libmagick++-6.q16-dev \
libotf-dev \
librsvg2-dev \
libsystemd-dev \
libxaw7-dev \
sharutils \
xaw3dg-dev
# Build the debs:
dpkg-buildpackage -b -us -uc
# Install packages generated in the above directory. The install
# order is a bit wonky, so one has to run this twice:
cd ../
sudo dpkg -i \
emacs_28.2+1-3_all.deb \
emacs-el_28.2+1-3_all.deb \
emacs-common_28.2+1-3_all.deb \
emacs-bin-common_28.2+1-3_amd64.deb \
emacs-gtk_28.2+1-3_amd64.deb
To install the Emacs info manual from the source package https://packages.debian.org/source/sid/armel/emacs-non-dfsg:
mkdir -p ~/src/deb/deb-emacs-non-dfsg
cd ~/src/deb/deb-emacs-non-dfsg
# Download the 3 files from the URL above and then unpack:
tar -xf emacs-non-dfsg_28.2+1.orig.tar.xz
cd emacs-non-dfsg-28.2+1.orig/
tar -xf ../emacs-non-dfsg_28.2+1-2.debian.tar.xz
dpkg-checkbuilddeps # Needed to install texinfo.
dpkg-buildpackage -us -uc
sudo dpkg -i ../emacs-common-non-dfsg_28.2+1-2_all.deb
I was not very familiar with Debian packaging and read https://www.debian.org/doc/manuals/maint-guide/ along the way so I'm happy to take notes and corrections to any of these steps.
Happy hacking!