ENH update install script

This commit is contained in:
Nathan Dwarshuis 2022-06-29 20:51:39 -04:00
parent 02a1069d3c
commit 4cea560dae
1 changed files with 13 additions and 12 deletions

View File

@ -2,17 +2,18 @@
## Install all dependencies for emacs to run at full capacity
if emacs -batch -l "init.el"; then
IFS=' ' read -r -a emacs_pkgs \
< <(emacs -batch -l "init.el" --eval \
'(print (format "pkgs: %s" (s-join " " (nd/get-dependencies (list :pacman :aur)))))' \
2>/dev/null | \
sed -n -e 's/"pkgs: \(.*\)"/\1/p')
echo "Emacs requires the following system pkgs: ${emacs_pkgs[*]}"
else
echo "Could not get list of emacs dependencies."
emacs_pkgs=()
EMACS_PKG=emacs-nativecomp
if ! command -v emacs > /dev/null; then
if sudo pacman -S "$EMACS_PKG"; then
echo "Could not install emacs. Exiting"
exit 1
fi
fi
MAKEFLAGS="-j$(nproc)" \
yay --needed --noconfirm --norebuild --removemake -S "${emacs_pkgs[@]}"
if command -v yay > /dev/null; then
emacs -batch -l init.el -f nd/install-arch-dependencies
else
echo "Yay not installed. Exiting"
exit 1
fi