ENH make script to list runtime packages

This commit is contained in:
Nathan Dwarshuis 2022-08-01 00:30:02 -04:00
parent cadf7dbe5a
commit 2e9166fec8
4 changed files with 17 additions and 21 deletions

2
.gitignore vendored
View File

@ -3,7 +3,7 @@
!README.org
!init.el
!straight-boot.el
!install_deps
!runtime_pkgs
# track versions of installed packages
!straight

View File

@ -221,7 +221,7 @@ dependencies to return."
(let ((helpers (list "yay")))
(-first #'executable-find helpers)))
(defun nd/pacman-dependencies (uninstalled?)
(defun nd/pacman-dependencies (&optional uninstalled?)
"Return pacman and aur dependencies.
If UNINSTALLED? is non-nil, return only the packages that are not
installed but required by this config."
@ -287,6 +287,10 @@ installed but required by this config."
(try-install "unofficial" nd/aur-helper aur-args aur))
(message "No aur helper found")))
nil))
(defun nd/dump-arch-dependencies ()
(-let (((pacman aur) (nd/pacman-dependencies nil)))
(print (s-join "\n" (append pacman aur)))))
#+end_src
*** Setup
#+begin_src emacs-lisp

View File

@ -1,19 +0,0 @@
#!/bin/bash
## Install all dependencies for emacs to run at full capacity
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
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

11
runtime_pkgs Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Print a list of all pacman packages required to run this emacs configuration
this_dir=$(dirname "$0")
emacs -batch \
-l "$this_dir/init.el" \
-f nd/dump-arch-dependencies \
2> /dev/null | \
sed 's/"//'