-
Notifications
You must be signed in to change notification settings - Fork 0
/
brew.sh
executable file
·441 lines (366 loc) · 14.6 KB
/
brew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
#!/usr/bin/env bash
#
# brew.sh
#
# Setup expected Homebrew packages.
#
# To determine what packages are installed:
# brew list
#
# After modifying this script you must also update the global `~/.Brewfile` by
# scheduling `brewfile-update` to run on a periodic basis, or manually running:
#
# brew bundle dump --force --describe --global
#
# shellcheck disable=SC2155
# (see https://github.com/koalaman/shellcheck/wiki)
#
scriptName="$(basename "$0")";
notice() {
# COLUMNS is a shell variable, not exported to child processes, so use tput instead.
# ref: http://stackoverflow.com/a/1782909/41321
local cols=$(tput cols);
local len=${#1};
local prefix="[${scriptName}]";
local prefixLen=${#prefix};
local rem=$((${cols:-79}-len-prefixLen-2)); # 2 => spaces.
local rhs="$(printf "%${rem}s" '' | tr ' ' '=')";
# 13 is bright yellow green.
echo "$(tput setaf 13)${prefix}$(tput sgr0) $1 $(tput setaf 13)${rhs}$(tput sgr0)";
}
main() {
# Apple command line tools can be installed with `xcode-select --install`
notice "You must agree to the XCode license."; # ------------------------------------------------------
sudo xcodebuild -license accept;
notice "Downloading and updating brew"; # -------------------------------------------------------------
if ! type -t brew; then
>&2 echo "Downloading and installing Homebrew";
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)";
fi;
brew update;
notice "Opening taps"; # ------------------------------------------------------------------------------
brew tap "homebrew/cask";
brew tap "homebrew/cask-fonts";
brew tap "homebrew/cask-versions";
brew tap "homebrew/core";
brew tap "homebrew/services";
notice "Latest bash shell"; # -------------------------------------------------------------------------
# Use Homebrew's version of bash as the login shell.
brew install bash;
if ! grep "$(brew --prefix bash)/bin/bash" "/etc/shells" > /dev/null; then
# ref: http://stackoverflow.com/a/550808
echo "$(brew --prefix bash)/bin/bash" | sudo tee -a "/etc/shells" > /dev/null;
chsh -s "$(brew --prefix bash)/bin/bash";
fi;
notice "Java JDKs"; # ---------------------------------------------------------------------------------
# The jce-unlimited-strength-policy package is no longer required as of JDK v1.8.0.161.
# Use the Adoptium (formerly AdoptOpenJDK) builds of the JDK instead of the Oracle ones.
brew install temurin; # Latest JDK from Eclipse/Adoptium
brew install temurin11; # v11 LTS JDK from Eclipse/Adoptium
brew install temurin8; # v1.8 LTS JDK from Eclipse/Adoptium
# brew install corretto; # Amazon JDK
if [[ ! -d "/usr/local/sbin" ]]; then
>&2 echo "Your sudo password is required to create /usr/local/sbin";
sudo mkdir -p "/usr/local/sbin";
# "id" is the replacement for whoami (via "man whoami").
sudo chown "$(id -un):$(id -gn)" "/usr/local/sbin";
# shellcheck disable=SC2010
ls -lah "/usr/local/" | grep --color=none -E 's?bin';
fi;
# Try to keep these lists alphabetical for easy visual search.
notice "Installing primary packages"; # ---------------------------------------------------------------
brew install adr-tools;
brew install ant; # for ivycp
brew install ammonite-repl;
brew install asciidoc;
# brew install asdf;
brew install awscli;
brew install badkeys;
brew install bats-core; # Shell script testing framework.
brew install berkeley-db; # Needed for installing perl 5.26+ via perlbrew; ref: https://stackoverflow.com/a/46660972/41321
brew install blueutil;
brew install colordiff;
brew install cosign;
brew install coreutils;
brew install csshx;
brew install ctop;
brew install curl;
brew install dependency-check;
brew install devspace; # for Scooter
brew install dhall;
brew install dhall-json;
brew install diceware;
brew install ditaa;
brew install dive;
# brew install docker; # CLI; use Docker Desktop instead.
# brew install docker-credential-helper; # for docker-credential-osxkeychain; supplied by Docker Desktop
# brew install docker-credential-helper-ecr; # for docker-credential-helper-ecr-login; supplied by Docker Desktop
brew install dockutil;
brew install dog;
brew install duf;
brew install dust;
brew install enchant;
brew install esphome;
brew install findutils;
brew install fortune;
brew install fswatch;
brew install gawk;
brew install gcviewer;
brew install geoipupdate;
brew install gettext;
brew install gist;
brew install git;
brew install git-cal;
brew install git-delta;
brew install git-gui; # gitk, etc.
brew install git-secrets;
brew install git-sizer;
brew install gnu-gar; # For avoiding MacOS/BSD tar extended info that GNU doesn't handle. On the GNU side these cause
# warnings like: "tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.dropbox.attrs'"
brew install gnu-units;
brew install gnupg;
brew install gnupg2;
brew install go;
brew install go-jira;
brew install gping;
brew install graphviz;
brew install grc;
brew install grep;
brew install grpc;
brew install hadolint;
brew install hr;
brew install htop;
brew install httpie;
brew install hub;
brew install hugo;
brew install hunspell;
brew install inkscape;
brew install ipcalc;
brew install ivy; # for ivycp
brew install jenv; # rbenv for Java
brew install jfrog-cli-go;
brew install jless;
brew install jmeter;
brew install jq; # requires Java to be installed first.
brew install k9s;
brew install kubernetes-cli;
brew install lastpass-cli;
brew install less; # includes lesskey (MacOS doesn't for some weird reason)
brew install lesspipe;
brew install mas;
brew install maven;
brew install mercurial; # aka "hg".
brew install micro; # console editor.
brew install midnight-commander;
brew install mill;
# brew install minikube;
brew install most;
brew install mosquitto; # MQTT client
brew install multitail;
brew install mysql; # && brew services start mysql;
brew install mysql@5.7; # && brew services start mysql@5.7;
brew install nano;
brew install node; # AKA nodejs, npm
brew install opa;
brew install openapi-generator;
brew install openssl@1.1;
brew install p7zip;
brew install packer;
brew install pandoc;
brew install pinentry-mac && brew linkapps pinentry-mac;
brew install platformio;
# brew install proguard;
brew install pstree;
brew install python;
brew install pwgen;
brew install pyenv;
brew install pyenv-virtualenv;
brew install rbenv;
brew install rbenv-default-gems;
brew install reattach-to-user-namespace;
brew install redis;
brew install rfcdiff; # required for github.com/lvc/installer-4j
brew install rlwrap;
brew install ruby-build;
brew install rust;
brew install safe-rm;
brew install sbt; # requires Java to be installed first.
brew install scala;
brew install scalariform;
brew install scalastyle;
brew install sendemail;
brew install shellcheck;
brew install sleepwatcher; # expects /usr/local/sbin to exist, otherwise "brew link sleepwatcher" will fail.
# brew install source-highlight; # Dependency of asciidoc.
brew install sonar-scanner;
brew install sqlite;
brew install sqlite-utils;
# brew install sshrc"; # https://github.com/Russell91/sshrc (now in .dotfiles, + local mods)
brew install ssh-audit;
brew install sshuttle; # SSH auto-VPN
brew install starship;
brew install terminal-notifier && brew linkapps terminal-notifier;
brew install terraform;
brew install tree;
brew install unzip;
brew install vault; # Hashicorp Vault
brew install wdiff; # required for github.com/lvc/installer-4j
brew install wget;
# brew install wrk;
brew install xmlstarlet;
brew install xq;
brew install xz;
brew install yamale; # Schema validator for yaml
brew install yamlfmt;
brew install yamllint;
brew install yarn;
brew install yq;
brew install zip;
brew install coursier/formulas/coursier;
brew install discoteq/discoteq/flock;
brew install github/gh/gh;
brew install homeport/tap/dyff;
brew install johanhaleby/kubetail/kubetail;
brew install mike-engel/jwt-cli/jwt-cli;
brew install mongodb/brew/mongodb-community; # Needed by zd-remote-auth
brew install moul/moul/docker-diff;
brew install snyk/tap/snyk; # https://snyk.io
brew install versent/taps/saml2aws;
brew install vmware-tanzu/carvel/vendir;
brew install zendesk/devops/cicd-cli;
brew install zendesk/devops/scooter;
brew install zendesk/zendesk/ric;
brew install zendesk/zendesk/secret-service-cli;
notice "Command line completions"; # ------------------------------------------------------------------
brew install bash-completion@2; # for Bash v4.1+
brew install bundler-completion;
# brew install docker-completion; # Installed as part of docker.
# brew install docker-compose-completion;
# brew install docker-machine-completion;
brew install gem-completion;
brew install launchctl-completion;
brew install open-completion;
brew install pip-completion;
brew install rails-completion;
brew install rake-completion;
brew install ruby-completion;
# brew install vagrant-completion;
brew install yarn-completion;
brew install zsh-completions;
notice "Fonts"; # -------------------------------------------------------------------------------------
# Hack info: https://github.com/chrissimpkins/Hack
brew install homebrew/cask-fonts/font-hack;
brew install homebrew/cask-fonts/font-hack-nerd-font;
brew install homebrew/cask-fonts/font-fira-code;
brew install homebrew/cask-fonts/font-fira-code-nerd-font;
brew install homebrew/cask-fonts/font-go;
brew install homebrew/cask-fonts/font-go-mono-nerd-font;
brew install homebrew/cask-fonts/font-inter; # https://rsms.me/inter/
brew install homebrew/cask-fonts/font-source-code-pro;
brew install homebrew/cask-fonts/font-sauce-code-pro-nerd-font;
# # Alternate JVMs
# brew install graalvm/tap/graalvm-ce-java11;
# brew install graalvm/tap/graalvm-ce-lts-java11;
notice "Other tool casks"; # --------------------------------------------------------------------------
brew install 1password;
brew install 1password-cli;
brew install aerial; # Screensaver
brew install araxis-merge; # Was broken, may need to download and install manually.
brew install authy;
brew install ccmenu;
brew install charles;
brew install datadog-agent;
brew install diffmerge;
brew install homebrew/cask/docker; # Docker Desktop UI (originally I needed --force to avoid issues with existing completions).
brew install dropbox;
brew install --cask git-credential-manager;
brew install google-cloud-sdk;
# brew install gpg-suite;
brew install insomnia; # REST API tester.
brew install jetbrains-toolbox; # Manage IntelliJ, etc.
brew install key-codes;
brew install lastpass;
brew install mysqlworkbench;
brew install osxfuse;
brew install paintbrush;
brew install pdfkey-pro;
brew install postman;
brew install sqlitestudio;
brew install sublime-text;
brew install sublime-merge;
# brew install vagrant;
brew install veracrypt;
# brew install virtualbox;
brew install vlc;
brew install xbar; # The reboot of bitbar.
brew install xquartz; # Legacy X11 support.
brew install yubico-authenticator;
notice "Python packages"; # ---------------------------------------------------------------------------
# Python packages (no need for sudo when using brewed python)
# easy_install "pip"; # pip is preinstalled with python 2.7.9+ or 3.4+
local pythonPath="$(brew --prefix python)";
"${pythonPath}/bin/pip3" install Pygments;
"${pythonPath}/bin/pip3" install json-spec;
"${pythonPath}/bin/pip3" install mintotp;
"${pythonPath}/bin/pip3" install truffleHog;
"${pythonPath}/bin/pip3" install xml2rfc; # via https://xml2rfc.tools.ietf.org/
# pip install yamllint; # using brew instead.
# Mac App Store packages are installed using the mas cli; must be logged
# into your iCloud account for this to work.
#
# The list can be updated using:
#
# mas list | sed -E -e "s/^([0-9][0-9]*) (.*)/mas install \1; # \2/g" | sort -t '#' -b -k2,2df | pbcopy;
#
notice "Mac App Store packages"; # --------------------------------------------------------------------
mas install 1028918091; # APG (2.2)
mas install 961632517; # Be Focused Pro (2.0)
mas install 1121192229; # Better (2020.2)
mas install 417375580; # BetterSnapTool (1.9.3)
mas install 411246225; # Caffeine (1.1.1)
mas install 574607554; # com.hummersoftware.ImageExifEditor (5.1.1)
mas install 1333277187; # Disconnect Premium (3.1.2)
mas install 462058435; # Microsoft Excel (16.40)
mas install 784801555; # Microsoft OneNote (16.40)
mas install 985367838; # Microsoft Outlook (16.40)
mas install 462062816; # Microsoft PowerPoint (16.40)
mas install 462054704; # Microsoft Word (16.40)
mas install 504284434; # Multi Monitor Wallpaper (2.97)
mas install 409203825; # Numbers (10.1)
mas install 823766827; # OneDrive (20.084.0426)
mas install 409201541; # Pages (10.1)
mas install 1303222628; # Paprika Recipe Manager 3 (3.4.5)
mas install 984335872; # PDF Image Xtractor (1.3.3)
mas install 545164971; # PDF Toolkit+ (2.3)
mas install 520993579; # pwSafe (4.17)
mas install 871368974; # QR Crafter (1.0)
mas install 466385995; # SciTE (4.4.4)
mas install 496437906; # Shush (1.2.1)
mas install 803453959; # Slack (4.8.0)
mas install 552792489; # StatusClock (1.2)
mas install 435410196; # Stay (1.3)
mas install 1191449274; # ToothFairy (2.6.2)
mas install 533696630; # Webcam Settings (3.0)
mas install 497799835; # Xcode (11.3.1)
# For HTTPie (https://github.com/jkbrzt/httpie), SNI (Server Name Indication)
# support needs updated stuff for Python versions < 2.7.9
# sudo pip install --upgrade pyopenssl pyasn1 ndg-httpsclient;
notice "Configuring jenv"; # --------------------------------------------------------------------------
# The current version of the jenv formula (as at 2018-06-01) doesn't create
# the ~/.jenv/versions folder, which is required when using "jenv add".
mkdir -p "${HOME}/.jenv/versions";
# If the ~/.jenv/versions folder is empty, add all of the current JDK installations into jenv.
if [ -z "$(find "${HOME}/.jenv/versions" -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null)" ]; then
while IFS= read -r -d $'\n' jdk; do
if [ -d "${jdk}/Contents/Home/bin" ]; then
jenv add "${jdk}/Contents/Home";
fi;
done < <(find /Library/Java/JavaVirtualMachines -type d -maxdepth 1 -mindepth 1 -print);
fi;
# Default to Java 17 for SBT.
if [ ! -r "${HOME}/.jenv/version" ]; then
jenv global 17;
jenv rehash;
fi;
}
main "$@";