From c479f3f73099f6bcd00bff3d6f0cab3efc31cfd2 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Thu, 16 Sep 2021 19:14:34 -0600 Subject: [PATCH] updated arch build requirements --- setup/os-dependencies/arch.txt | 2 ++ setup/os-dependencies/arch.zsh | 15 +++++++++++++++ setup/os-dependencies/debian.txt | 2 ++ setup/os-dependencies/setup.zsh | 12 +++++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 setup/os-dependencies/arch.zsh diff --git a/setup/os-dependencies/arch.txt b/setup/os-dependencies/arch.txt index 8175f09..afc0a36 100644 --- a/setup/os-dependencies/arch.txt +++ b/setup/os-dependencies/arch.txt @@ -1,3 +1,4 @@ +base-devel cmake cowsay figlet @@ -5,3 +6,4 @@ fzf lolcat python ripgrep +ncurses diff --git a/setup/os-dependencies/arch.zsh b/setup/os-dependencies/arch.zsh new file mode 100644 index 0000000..766a300 --- /dev/null +++ b/setup/os-dependencies/arch.zsh @@ -0,0 +1,15 @@ +YAY__SOURCE_TARGET='https://aur.archlinux.org/yay.git' +YAY__LOCAL_PATH="$HOME/.packages/yay" + +YAY__INSTALL_FROM_SOURCE() { + [ -d $YAY__LOCAL_PATH ] && return 0 + + CHECK 'downloading yay' + git clone $ARCH__YAY_TARGET $YAY__LOCAL_PATH >>$LOG 2>&1\ + && OK || { WARN; return 1; } + + cd $YAY__LOCAL_PATH + CHECK 'installing yay' + yes | makepkg -si >>$LOG 2>&1 \ + && OK || { WARN; return 1; } +} diff --git a/setup/os-dependencies/debian.txt b/setup/os-dependencies/debian.txt index 1c5d151..980204e 100644 --- a/setup/os-dependencies/debian.txt +++ b/setup/os-dependencies/debian.txt @@ -5,3 +5,5 @@ fzf lolcat python3-dev ripgrep +build-essential +ncurses-dev diff --git a/setup/os-dependencies/setup.zsh b/setup/os-dependencies/setup.zsh index e727910..7dce6a5 100644 --- a/setup/os-dependencies/setup.zsh +++ b/setup/os-dependencies/setup.zsh @@ -1,3 +1,5 @@ +source "$DOTWRYN_PATH/setup/os-dependencies/arch.zsh" + ################################################################################ ### Automated System Dependency Install ######################################## ################################################################################ @@ -10,7 +12,10 @@ function OS_DEPENDENCY__SETUP() { local ERROR=0 STATUS 'checking os dependencies' - local OS_NAME=$(lsb_release -is | tr '[:upper:]' '[:lower:]') + local OS_NAME=$(lsb_release -is 2>/dev/null | tr '[:upper:]' '[:lower:]') + [ ! $OS_NAME ] && { + OS_NAME=$(cat /etc/os-release | grep ^ID= | sed 's/^ID=//') + } STATUS "detected os '$OS_NAME'" case $OS_NAME in @@ -54,6 +59,10 @@ function OS_DEPENDENCY__SETUP() { function OS_INSTALL__ARCH() { local TARGET="$1" + [[ $TARGET =~ ^base-devel$ ]] && { + WARNING 'base-devel is required; make sure it is installed' + return 0 + } CHECK "checking for $TARGET" pacman -Qq | grep -q "^$TARGET$" && OK || { WARN "$TARGET not found" @@ -61,6 +70,7 @@ function OS_INSTALL__ARCH() { sudo pacman -Syu --noconfirm $TARGET >>$LOG 2>&1 \ && OK || { WARN "failed to install $TARGET"; return 1; } } + YAY__INSTALL_FROM_SOURCE } function OS_INSTALL__DEBIAN() {