Last active
May 31, 2022 10:41
-
-
Save briang/6ee9463305bb87be365a1661c87bee55 to your computer and use it in GitHub Desktop.
Emacs 28 compilation script for debian 11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit # exit on error | |
set -o pipefail # trap pipe fails | |
set -o nounset # trap unset vars | |
DEST="/usr/local" | |
SOURCE="$HOME/emacs-28.1" | |
NATIVE_FULL_AOT='' # 'NATIVE_FULL_AOT=1' # removed in emacs 28.1 | |
JOBS='-j 3' | |
function prereqs { | |
cd $HOME | |
sudo apt install \ | |
autoconf build-essential checkinstall git libgccjit-11-dev libgif-dev \ | |
libgnutls28-dev libgtk-3-dev libjansson-dev libjpeg-dev \ | |
libncurses5-dev libtiff-dev libxpm-dev texinfo | |
export PKG_CONFIG_PATH=$(find /usr /lib -name pkgconfig | paste -s -d':') | |
# [[ ! -e ~/emacs.git ]] && \ | |
# git clone --depth=1 https://github.com/emacs-mirror/emacs ~/emacs.git -b emacs-28 | |
# cd ~/emacs.git | |
# git clean -dxf | |
if [[ ! -e $SOURCE ]] ; then | |
for f in emacs-28.1.tar.gz ; do | |
[[ ! -e $f ]] && wget https://ftp.gnu.org/gnu/emacs/$f | |
tar xf $f | |
done | |
fi | |
} | |
function build { | |
cd $SOURCE | |
unset confopts | |
confopts+="--prefix $DEST " | |
confopts+="--with-cairo " | |
confopts+="--with-gnutls " | |
confopts+="--with-json " | |
confopts+="--with-mailutils " | |
confopts+="--with-native-compilation " | |
confopts+="--with-rsvg " | |
confopts+="--with-x-toolkit=gtk " | |
confopts+="--without-toolkit-scroll-bars " | |
confopts+="--without-xaw3d " | |
confopts+="--without-xwidgets " | |
# --with-pgtk --with-sqlite3 # cut from emacs-28.1 | |
./autogen.sh | |
./configure $confopts CFLAGS="-O2 -pipe" | |
make html | |
# AOT = Ahead Of Time aka native compile everything in advance | |
make $JOBS $NATIVE_FULL_AOT | |
} | |
function package { | |
cd $SOURCE | |
cat <<"EOD" > description-pak | |
GNU Emacs editor | |
GNU Emacs is the extensible self-documenting text editor. This package is | |
compiled with GTK+ GUI support and native-compilation of Elisp files. | |
EOD | |
sudo checkinstall \ | |
--backup=no \ | |
--pkgname=emacs28 \ | |
--maintainer='"Brian Greenfield <[email protected]>"' \ | |
sudo make $JOBS install install-html | |
echo "" | |
echo "install: dpkg -i *.deb" | |
echo "uninstall: dpkg -r emacs28" | |
} | |
function doit { | |
prereqs | |
build | |
package | |
} | |
time doit | |
echo "" | |
cd $SOURCE | |
for t in elc eln ; do | |
echo "$t: $(find . -name \*.$t | wc -l)" | |
done |
Fixed the missing shebang.
Thanks!
Fixed it, thanks!
Not sure if you get notified about updates to a gist :)
…On Mon, 30 May 2022 at 22:48, Harm te Hennepe ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Thanks for the script. Btw, you forgot the bang in the shebang :-)
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/6ee9463305bb87be365a1661c87bee55#gistcomment-4184066>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZMOHR5RPITHUGMWDVPJ3VMUZSBANCNFSM5XLURFVA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
I got notified :-) I just tested the build, but pgtk doesn't seem to be available:
configure:39980: WARNING: unrecognized options: --with-pgtk, --with-sqlite3
Seems that it's not merged into the emacs-28 branch.
Yeah, sorry. This is an old script. I have a newer script that I've uploaded. This one creates a .deb in the root of the emacs28 source directory. You have to press Enter a couple of times towards the end of the build.
I'm not using this script any more. Now I build emacs.deb packages using https://github.com/kelleyk/ppa-emacs. This works for both Debian and Ubuntu.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the script. Btw, you forgot the bang in the shebang :-)