From 2109d1f7afb8b602c460d9667496ae3a24a905f7 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Tue, 2 May 2023 10:55:45 -0600 Subject: [PATCH] Add install emacs script --- scripts/install_emacs.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/install_emacs.sh diff --git a/scripts/install_emacs.sh b/scripts/install_emacs.sh new file mode 100644 index 0000000..467dd57 --- /dev/null +++ b/scripts/install_emacs.sh @@ -0,0 +1,25 @@ +#!/bin/sh +[ -z "$EMACS_VERSION" ] && echo "Usage: EMACS_VERSION=25.1 install-emacs.sh or EMACS_VERSION=snapshot install-emacs.sh" && exit 1 +[ -z "$EMACS_URL" ] && EMACS_URL="http://mirror.aarnet.edu.au/pub/gnu/emacs/" +# I've assign 12G memory to /tmp as ramdisk +[ -z "$EMACS_TMP" ] && EMACS_TMP="/tmp" + +if [ "$EMACS_VERSION" != "snapshot" ]; then + echo "curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz" + curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz | tar xvz -C $EMACS_TMP +fi + +# @see http://wiki.gentoo.org/wiki/Project:Emacs/GNU_Emacs_developer_guide +# @see http://packages.gentoo.org/package/app-editors/emacs for info on Gentoo Linux +# --without-gtk and --without-gtk3 is optional +echo "Installing Emacs ..." +if [ "$EMACS_VERSION" = "snapshot" ]; then + cd $HOME/projs/emacs && mkdir -p $HOME/myemacs/snapshot && rm -rf $HOME/myemacs/snapshot/* && ./autogen.sh && ./configure CFLAGS=-no-pie --prefix=$HOME/myemacs/snapshot --without-x --without-dbus --without-sound --with-gnutls=no && make -j6 && make install + echo "Emacs snapshot was installed!" +elif [ "$EMACS_VERSION" = "28.1" ]; then + cd $EMACS_TMP/emacs-$EMACS_VERSION && mkdir -p $HOME/myemacs/$EMACS_VERSION && rm -rf $HOME/myemacs/$EMACS_VERSION/* && ./configure CFLAGS=-no-pie --prefix=$HOME/myemacs/$EMACS_VERSION --without-x --without-sound --with-gnutls=no --with-modules --with-native-compilation --without-compress-install && make -j6 && make install +else + cd $EMACS_TMP/emacs-$EMACS_VERSION && mkdir -p $HOME/myemacs/$EMACS_VERSION && rm -rf $HOME/myemacs/$EMACS_VERSION/* && ./configure CFLAGS=-no-pie --prefix=$HOME/myemacs/$EMACS_VERSION --without-x --without-sound --with-gnutls=no --with-modules && make -j6 && make install + rm -rf $EMACS_TMP/emacs-$EMACS_VERSION + echo "Emacs $EMACS_VERSION was installed!" +fi