start macos compatibility

This commit is contained in:
Wryn (yage) Wagner 2025-02-04 15:09:26 -07:00
parent 19ff28d77c
commit d6578c5d4a
Signed by: wrynegade
SSH Key Fingerprint: SHA256:zBGO05Uz1oT7pnehoPelgUmYX632oFjt3MBH0MlEvrs
2 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,43 @@
autoconf
automake
bat
binutils
bison
cmake
cowsay
feh
figlet
coreutils
flex
fzf
gcc
g++
gettext
go
htop
openjdk
jq
libtool
lolcat
mono
ncurses
neofetch
node
npm
openssh
patch
pkg-config
python
pip3
pylint
virtualenv
ripgrep
rust
sed
sudo
tmux
vim
yamllint
yq
zip
zsh

View File

@ -18,6 +18,9 @@ OS__GET_OS() {
[ ! ${OS_NAME} ] \
&& OS_NAME=$(cat /etc/os-release 2>/dev/null | sed -n 's/^ID=//p')
uname -s | grep -q Darwin \
&& OS_NAME=macos
[ ! ${OS_NAME} ] \
&& WARNING 'failed to detect operating system' \
&& OS_NAME=$(echo -e "arch\ndebian\nother" | FZF 'select an operating system') \
@ -43,6 +46,12 @@ OS__INSTALL_SOURCE_DEPENDENCIES() {
( fedora ) ;;
( debian ) ;;
( macos )
command -v brew &>/dev/null \
|| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
;;
( * ) ;;
esac
@ -59,8 +68,9 @@ OS__INSTALL_MANAGED_DEPENDENCIES() {
STATUS 'checking os dependencies'
case ${OS_NAME} in
( arch | debian | fedora )
( arch | fedora | debian | macos )
;;
( * )
OS_NAME='generic'
WARNING "no automated installer available for '${OS_NAME}'"
@ -128,6 +138,15 @@ INSTALL_MANAGED__fedora() {
;
}
UPDATE_REPOSITORIES__macos() { brew update && brew upgrade; }
INSTALL_MANAGED__macos() {
STATUS "checking / installing '$1'"
yes | brew install $1 \
&& SUCCESS "'$1' installed" \
|| ERROR "failed to install ${TARGET}" \
;
}
UPDATE_REPOSITORIES__generic() { return 0; }
INSTALL_MANAGED__generic() {
command -v $1 >/dev/null 2>&1 \