From 07fd4f1a6930dc62880b0fd7a0496270f4c2efd6 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 11 Apr 2024 01:39:11 -0500 Subject: more fit and finish work User Constants - move all file and directory constants into it's own file - create the directories and files if they don't exist - warn the user when not found/created General - remove duplicate dirvish go menu entry - remove xterm color in test code (it's already in eshell) - fixed org-drill not starting - fixing issue with auto-complete not working in eshell - adding playlists location for dirvish - moved all org-drill config into the use-package declaration - added drill-dir to user-constants - default ledger-file location changed; updated tasks - git ignore the persist folder - added more point values in fontaine menu - fix for gptel early key grab in authinfo.gpg - removed localrepo from reset script - remove magit-forge package - don't wait too long to bury-buffers - add setting native compile warnings to 'silent - fixed sdcv errors when looking up a word normally and in nov --- scripts/build-emacs-from-source.sh | 102 +++++++++++++++++++++++++++++++++++++ scripts/build-emacs-from-src.sh | 102 ------------------------------------- scripts/reset-to-first-launch.sh | 32 ++++++++++++ scripts/reset.sh | 32 ------------ 4 files changed, 134 insertions(+), 134 deletions(-) create mode 100755 scripts/build-emacs-from-source.sh delete mode 100755 scripts/build-emacs-from-src.sh create mode 100755 scripts/reset-to-first-launch.sh delete mode 100755 scripts/reset.sh (limited to 'scripts') diff --git a/scripts/build-emacs-from-source.sh b/scripts/build-emacs-from-source.sh new file mode 100755 index 00000000..a2272838 --- /dev/null +++ b/scripts/build-emacs-from-source.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +# Craig Jennings +# Builds Emacs from source using the variables below. + +# - creates the directory if needed +# - uninstalls emacs if it exists +# - pulls latest source from repo below +# unless "latest" is passed as parameter +# - checks out the tag below +# - uses all available processors when compiling + +# NOTES: +# building xwidgets is broken on Linux in 29/30 tags +# ./configure --with-xwidgets \ + +# ...and I'm avoiding native compilation at the moment +#./configure --with-native-compilation \ + +set -e + +# Review These Variables + +src_dir="$HOME/code/emacs" +emacs_repo="https://github.com/mirrors/emacs.git" +emacs_tag="emacs-29.1" +logfile="$HOME/emacs_build.log" + +# Function to remove + recreate directory, and clone source +nuke_and_clone () { + cd "$HOME" + if [ -d "$src_dir" ]; then + printf "...removing directory %s\n\n" "$src_dir" + rm -rf "$src_dir" >> "$logfile" 2>&1 + fi + + printf "...creating directory %s\n" "$src_dir" + mkdir -p "$src_dir" >> "$logfile" 2>&1 + printf "...cloning source files\n" + git clone "$emacs_repo" "$src_dir" >> "$logfile" 2>&1 +} + +# Script Execution Begins Here + +printf "\n\n### BUILDING EMACS FROM SOURCE ###\n\n" > "$logfile" + +printf "...checking directory: %s\n" "$src_dir" | tee -a "$logfile" + +# if the source directory already exists +if [ -d "$src_dir" ]; then + cd "$src_dir" + + # if emacs was previously built, uninstall it. + { + if [ -n "$(which emacs)" ]; then + printf "...uninstalling previous build\n" + sudo make uninstall + fi + } >> "$logfile" 2>&1 + + printf "...cleaning repo\n" | tee -a "$logfile" + make clean >> "$logfile" 2>&1 + + if [[ -n $(git status --porcelain) ]]; then + printf "...repository is dirty. recreating.\n" | tee -a "$logfile" + nuke_and_clone + else + printf "...pulling latest source files\n" | tee -a "$logfile" + git pull >> "$logfile" 2>&1 + fi +else + nuke_and_clone +fi + +if [ ! $1 == "latest" ]; then + printf "...checking out tag: %s\n" "$emacs_tag" | tee -a "$logfile" + git checkout "$emacs_tag" >> "$logfile" 3>&1 +else + printf "...keeping source at latest commit\n" | tee -a "$logfile" +fi + +printf "...building config script\n" | tee -a "$logfile" +./autogen.sh >> "$logfile" 2>&1 + +printf "...configuring build\n" | tee -a "$logfile" +./configure --with-json \ + --with-x-toolkit=lucid \ + --with-modules \ + --with-mailutils \ + --with-imagemagick\ + CFLAGS='-O2 -march=native' >> "$logfile" 2>&1 + +# compile with all available cores +printf "...compiling Emacs\n" | tee -a "$logfile" +make -j$(nproc) >> "$logfile" 2>&1 + +printf "...installing Emacs\n" | tee -a "$logfile" +sudo make install >> "$logfile" 2>&1 +make clean >> "$logfile" 2>&1 +cd "$HOME" + +printf "...done\n" | tee -a "$logfile" +printf "Please review log at: %s\n" "$logfile" diff --git a/scripts/build-emacs-from-src.sh b/scripts/build-emacs-from-src.sh deleted file mode 100755 index a2272838..00000000 --- a/scripts/build-emacs-from-src.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -# Craig Jennings -# Builds Emacs from source using the variables below. - -# - creates the directory if needed -# - uninstalls emacs if it exists -# - pulls latest source from repo below -# unless "latest" is passed as parameter -# - checks out the tag below -# - uses all available processors when compiling - -# NOTES: -# building xwidgets is broken on Linux in 29/30 tags -# ./configure --with-xwidgets \ - -# ...and I'm avoiding native compilation at the moment -#./configure --with-native-compilation \ - -set -e - -# Review These Variables - -src_dir="$HOME/code/emacs" -emacs_repo="https://github.com/mirrors/emacs.git" -emacs_tag="emacs-29.1" -logfile="$HOME/emacs_build.log" - -# Function to remove + recreate directory, and clone source -nuke_and_clone () { - cd "$HOME" - if [ -d "$src_dir" ]; then - printf "...removing directory %s\n\n" "$src_dir" - rm -rf "$src_dir" >> "$logfile" 2>&1 - fi - - printf "...creating directory %s\n" "$src_dir" - mkdir -p "$src_dir" >> "$logfile" 2>&1 - printf "...cloning source files\n" - git clone "$emacs_repo" "$src_dir" >> "$logfile" 2>&1 -} - -# Script Execution Begins Here - -printf "\n\n### BUILDING EMACS FROM SOURCE ###\n\n" > "$logfile" - -printf "...checking directory: %s\n" "$src_dir" | tee -a "$logfile" - -# if the source directory already exists -if [ -d "$src_dir" ]; then - cd "$src_dir" - - # if emacs was previously built, uninstall it. - { - if [ -n "$(which emacs)" ]; then - printf "...uninstalling previous build\n" - sudo make uninstall - fi - } >> "$logfile" 2>&1 - - printf "...cleaning repo\n" | tee -a "$logfile" - make clean >> "$logfile" 2>&1 - - if [[ -n $(git status --porcelain) ]]; then - printf "...repository is dirty. recreating.\n" | tee -a "$logfile" - nuke_and_clone - else - printf "...pulling latest source files\n" | tee -a "$logfile" - git pull >> "$logfile" 2>&1 - fi -else - nuke_and_clone -fi - -if [ ! $1 == "latest" ]; then - printf "...checking out tag: %s\n" "$emacs_tag" | tee -a "$logfile" - git checkout "$emacs_tag" >> "$logfile" 3>&1 -else - printf "...keeping source at latest commit\n" | tee -a "$logfile" -fi - -printf "...building config script\n" | tee -a "$logfile" -./autogen.sh >> "$logfile" 2>&1 - -printf "...configuring build\n" | tee -a "$logfile" -./configure --with-json \ - --with-x-toolkit=lucid \ - --with-modules \ - --with-mailutils \ - --with-imagemagick\ - CFLAGS='-O2 -march=native' >> "$logfile" 2>&1 - -# compile with all available cores -printf "...compiling Emacs\n" | tee -a "$logfile" -make -j$(nproc) >> "$logfile" 2>&1 - -printf "...installing Emacs\n" | tee -a "$logfile" -sudo make install >> "$logfile" 2>&1 -make clean >> "$logfile" 2>&1 -cd "$HOME" - -printf "...done\n" | tee -a "$logfile" -printf "Please review log at: %s\n" "$logfile" diff --git a/scripts/reset-to-first-launch.sh b/scripts/reset-to-first-launch.sh new file mode 100755 index 00000000..6800bc44 --- /dev/null +++ b/scripts/reset-to-first-launch.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# script for Emacs config testing +# - clears out all but necessary init/config files +# - removes native ad bytecode files. +rm -rf ~/.emacs.d/.cache/ +rm -rf ~/.emacs.d/auto-save-list/ +rm -rf ~/.emacs.d/backups/ +rm -rf ~/.emacs.d/crossword/ +rm -rf ~/.emacs.d/dirvish/ +rm -rf ~/.emacs.d/eln-cache/ +rm -rf ~/.emacs.d/elpa/ +rm -rf ~/.emacs.d/emojis/ +rm -rf ~/.emacs.d/erc/ +rm -rf ~/.emacs.d/eshell/ +rm -rf ~/.emacs.d/nov-places/ +rm -rf ~/.emacs.d/quelpa/ +rm -rf ~/.emacs.d/tramp-autosave/ +rm -rf ~/.emacs.d/transient/ +rm -rf ~/.emacs.d/tree-sitter/ +rm -rf ~/.emacs.d/url/ +rm ~/.emacs.d/.lsp-session* +rm ~/.emacs.d/.org-id-locations +rm ~/.emacs.d/.pdf-view-restore +rm ~/.emacs.d/org-roam.db +rm ~/.emacs.d/projectile-bookmarks.eld +rm ~/.emacs.d/.scratch +rm ~/.emacs.d/forge-database.sqlite +rm ~/.emacs.d/recentf +rm ~/.emacs.d/tramp-connection-history +rm ~/sync/org/emacs-theme.persist +find ~/.emacs.d -name "*.eln" -type f -delete +find ~/.emacs.d -name "*.elc" -type f -delete diff --git a/scripts/reset.sh b/scripts/reset.sh deleted file mode 100755 index efa15d76..00000000 --- a/scripts/reset.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# script for Emacs config testing -# - clears out all but necessary init/config files -# - removes native ad bytecode files. -rm -rf ~/.emacs.d/.cache/ -rm -rf ~/.emacs.d/auto-save-list/ -rm -rf ~/.emacs.d/backups/ -rm -rf ~/.emacs.d/crossword/ -rm -rf ~/.emacs.d/dirvish/ -rm -rf ~/.emacs.d/eln-cache/ -rm -rf ~/.emacs.d/elpa/ -rm -rf ~/.emacs.d/emojis/ -rm -rf ~/.emacs.d/erc/ -rm -rf ~/.emacs.d/eshell/ -rm -rf ~/.emacs.d/localrepo/ -rm -rf ~/.emacs.d/nov-places -rm -rf ~/.emacs.d/nov-places/ -rm -rf ~/.emacs.d/quelpa/ -rm -rf ~/.emacs.d/transient/ -rm -rf ~/.emacs.d/tree-sitter/ -rm -rf ~/.emacs.d/url/ -rm ~/.emacs.d/.lsp-session* -rm ~/.emacs.d/.org-id-locations -rm ~/.emacs.d/.pdf-view-restore -rm ~/.emacs.d/org-roam.db -rm ~/.emacs.d/projectile-bookmarks.eld -rm ~/.emacs.d/projects -rm ~/.emacs.d/recentf -rm ~/.emacs.d/tramp-connection-history -rm ~/sync/org/emacs-theme.persist -find ~/.emacs.d -name "*.eln" -type f -delete -find ~/.emacs.d -name "*.elc" -type f -delete -- cgit v1.2.3