Last active
March 4, 2025 13:15
-
-
Save jasonblewis/619a72eb77703b3036e512624c6673ce to your computer and use it in GitHub Desktop.
build and install emacs snapshot from source on debian stable
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 | |
# build emacs snapshopt packages form source on debian jessie | |
# you need to add the the emacs snapshot source to /etc/apt/sources.list.d | |
# sudo echo deb-src [arch=amd64] http://emacs.secretsauce.net unstable main >> /etc/apt/sources.list.d/emacs-snapshot.list | |
# wget -q -O - http://emacs.secretsauce.net/key.gpg | sudo apt-key add - | |
# usage ./build-emacs-snapshot | |
# enter your sudo password when prompted | |
# enjoy emacs snapshot. | |
# to update, just re-run the script. | |
# Jason Lewis [email protected] | |
# 2017-03-01 | |
# script url: https://gist.github.com/jasonblewis/619a72eb77703b3036e512624c6673ce | |
# see http://emacs.secretsauce.net/ for details about the debian packages | |
set -e | |
BUILDLOCATION=~/source/emacssnapshot | |
MAKEFLAGS=j$(getconf _NPROCESSORS_ONLN || echo 1) | |
latest() { | |
local file latest; | |
for file in "$@" | |
do | |
[[ $file -nt $latest ]] && latest=$file | |
done | |
} | |
echo doing aptitude update | |
sudo aptitude update | |
mkdir -p $BUILDLOCATION | |
cd $BUILDLOCATION | |
apt-get source emacs-snapshot | |
cd $(latest ./emacs*/) | |
echo 'doing sudo apt-get build-dep -y emacs-snapshot' | |
sudo apt-get build-dep -y emacs-snapshot | |
debuild -b -uc -us | |
cd $BUILDLOCATION | |
sudo dpkg -i $(latest ./emacs-snapshot_*.deb) $(latest ./emacs-snapshot-common*.deb) $(latest ./emacs-snapshot-bin-common*.deb) $(latest ./emacs-snapshot-el*.deb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For some reason, the
latest()
function computed value is not being used bycd
. I added a-x
to the invocation line and the cd command executes with no arguments, even though the argument is computed. Shell transcript follows: