Improve OSX setup

This commit is contained in:
Lynda Wang
2020-07-25 19:39:09 -04:00
committed by Michael Campagnaro
parent ee11695dee
commit e2f40a7be7
27 changed files with 1378 additions and 702 deletions

75
osx/install Executable file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
set -e
printf "Installing env...\n"
ln -sf $HOME/.dotfiles/osx/env.platform $HOME/.env.platform
printf "Installing Git customizations...\n"
ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform
#-----------------------------------
# Homebrew packages
#-----------------------------------
printf "Installing Homebrew...\n"
brew_packages=(
'openssl'
'wget'
'git'
'rlwrap'
'cmake'
'vim'
'sdl'
'tree'
)
brew tap homebrew/core
for package in "${brew_packages[@]}"
do
printf "Installing $package...\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${YELLOW}Already installed!${NORMAL}\n"
else
eval "brew install $package"
printf \n
fi
done
# We have issues downloading Rust on 10.11 with the patched Homebrew checkout
# so we'll install it using their script.
bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)"
# For Vim search
cargo install ripgrep
# The homebrew core ctags package is very old.
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
printf "\n${YELLOW}If you haven't already installed the Xcode dev tools then do so now by installing Xcode from the App Store:${NORMAL}\n"
printf "When that finishes open a terminal and run the following:\n"
printf " 1. ${YELLOW}sudo xcode-select --install${NORMAL}\n"
printf " 2. ${YELLOW}sudo xcodebuild -license${NORMAL}\n"
printf " 3. ${YELLOW}sudo xcode-select -s /Applications/Xcode.app/Contents/Developer${NORMAL}\n"
printf "\n${BOLD}Finished setting up OS X${NORMAL}\n"

View File

@@ -1,52 +0,0 @@
#!/bin/bash
source "../script_helpers/printing.sh"
set -e
printf "Installing env...\n"
ln -sf $HOME/.dotfiles/osx/env.platform $HOME/.env.platform
printf "Installing git customizations...\n"
ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform
brew tap homebrew/core
printf "Installing xquartz..."
#brew cask install xquartz
brew_packages=(
'tree'
'openssl'
'git'
# 'xclip'
'rlwrap'
'cmake'
'pkg-config'
'vim'
'the_silver_searcher'
'selecta'
# 'rust'
# 'go'
'sdl')
for package in "${brew_packages[@]}"
do
printf "Installing $package..."
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${YELLOW}already installed!${NORMAL}\n"
else
eval "brew install $package"
printf \n
fi
done
printf "\n${YELLOW}Now you must install Xcode.${NORMAL}\n"
printf "Open the App Store and install the software.\n"
printf "When that finishes open a terminal and run the following:\n"
printf " 1. ${YELLOW}sudo xcode-select --install${NORMAL}\n"
printf " 2. ${YELLOW}sudo xcodebuild -license${NORMAL}\n"
printf " 3. ${YELLOW}sudo xcode-select -s /Applications/Xcode.app/Contents/Developer${NORMAL}\n"
printf "\n${BOLD}Finished setting up OS X${NORMAL}\n"

54
osx/pre_install Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
set -e
printf "Installing Homebrew...\n"
# OSX 10.11 and earlier will issue certificate errors when Homebrew attempts to download packages
# with curl. Detect if we're running on 10.11 or earlier and if so use a fork that passes the
# --insecure option to curl.
kernel_major="$(uname -r | sed 's/\..*//')"
case $kernel_major in
15 | 14 | 13) download_patched_homebrew=1 ;;
*) download_patched_homebrew=0 ;;
esac
if [[ $download_patched_homebrew -eq 1 ]]; then
printf "${BOLD}Current MacOS kernel ${NORMAL}${YELLOW}$(uname -r)${NORMAL}${BOLD} requires a patched version of Homebrew...${NORMAL}\n"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/sir-pinecone/brew/master/install.sh)"
else
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
brew tap homebrew/core
printf "\nInstalling bash...\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${YELLOW}Already installed!${NORMAL}\n"
else
eval "brew install bash"
printf "\n${YELLOW}Finished installing updated version of bash.\nYou must now enable it. Run:${NORMAL}\n"
printf " ${BOLD}sudo vim /etc/shells${NORMAL}\n"
printf "${YELLOW}And add ${NORMAL}${BOLD}/usr/local/bin/bash${NORMAL}${YELLOW} to the end of the list. After that close your terminal and re-run the dotfiles install script.${NORMAL}\n"
fi

View File

@@ -1,14 +0,0 @@
# OSX
## Setting up Ruby
* Install rvm
* Install bundler
* Install Ruby Docs
gem install rdoc-data
rdoc-data --install
gem rdoc --all --overwrite
## Setup Keyboard
Map <CapsLock> to <Ctrl> in System Preferences -> Keyboard -> Modifier Keys. Now <caps-c> can leave insert mode.