Skip to content

Commit bac01f3

Browse files
authored
Merge pull request #6 from mbland/updates-20170905
Enable successful install on macOS 10.12.6
2 parents ca89c1c + 15c2e24 commit bac01f3

File tree

7 files changed

+73
-37
lines changed

7 files changed

+73
-37
lines changed

dotfiles/.bash_dev

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ if [[ "$OSTYPE" == 'darwin' && -f "$HOME/.ssh/id_rsa" ]]; then
2727
ssh-add -A &>/dev/null
2828
fi
2929

30+
if command -v gpg >/dev/null && [[ -z "$GPG_TTY" ]]; then
31+
export GPG_TTY="$(tty)"
32+
fi
33+
3034
# Creates a branch-specific git working directory in the same parent directory
3135
# as the original repository.
3236
git-new-workdir() {

packages/macos

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export PLATFORM_PACKAGES=(
1111
'xz'
1212
)
1313

14+
__BREW_INSTALL_URL="https://raw.githubusercontent.com/Homebrew/install/master/install"
15+
1416
platform_pre_install() {
1517
if [[ ! -d '/Applications/Xcode.app' ]]; then
1618
echo "Please install Xcode and run this script again."

scripts/install.d/languages.d/go

+47-18
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,70 @@
1111
#
1212
# Will install gvm in `<app-sys-root>/gvm` and add `/etc/profile.d/gvm.sh`.
1313

14+
declare -r _GVM_ROOT="$APPS_HOME/gvm"
15+
declare -r _GVM_VERSION='34b56311e1e3add4b8f7ce3eeadd23f19c627328'
1416
declare -r _GVM_PROFILE="$APPS_HOME/etc/profile.d/gvm.sh"
1517
declare -r _GVM_INSTALLER_URL='https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer'
18+
declare -r _GVM_BOOTSTRAP_VERSION='release-branch.go1.4'
1619

1720
_install_gvm() {
18-
local app_sys_root="$1"
19-
local gvm_dir="$app_sys_root/gvm"
20-
local gvm_version="$2"
21-
2221
if [[ -f "$_GVM_PROFILE" ]]; then
2322
return
2423
fi
2524

2625
curl -L -O "$_GVM_INSTALLER_URL"
27-
GVM_NO_UPDATE_PROFILE=true bash ./gvm-installer "$gvm_version" "$app_sys_root"
26+
GVM_NO_UPDATE_PROFILE=true bash ./gvm-installer "$_GVM_VERSION" "$APPS_HOME"
2827
rm ./gvm-installer
29-
echo ". '$gvm_dir/scripts/gvm'" >>"$_GVM_PROFILE"
28+
echo ". '$_GVM_ROOT/scripts/gvm'" >>"$_GVM_PROFILE"
3029
chmod +x "$_GVM_PROFILE"
3130
}
3231

33-
_install_go() {
34-
local app_sys_root="$1"
35-
local go_version="$2"
36-
local gvm_version="$3"
32+
_prepare_go_repo_for_bootstrap() {
33+
local repo_url='https://go.googlesource.com/go'
34+
local repo_path="$_GVM_ROOT/archive/go"
35+
local version="$_GVM_BOOTSTRAP_VERSION"
36+
local orig_pwd="$PWD"
3737

38-
if [[ -z "$go_version" ]]; then
39-
return
38+
printf 'Preparing %s to build %s\n' "$repo_path" "$version"
39+
40+
if [[ ! -d "$repo_path" ]] && ! git clone "$repo_url" "$repo_path"; then
41+
printf 'Failed to clone %s into %s\n' "$repo_url" "$repo_path" >&2
42+
exit 1
43+
elif ! cd "$repo_path" >/dev/null; then
44+
printf 'Failed to change into repo directory %s\n' "$repo_path" >&2
45+
exit 1
46+
elif ! git fetch origin "$version"; then
47+
printf 'Failed to fetch bootstrap branch %s\n' "$version" >&2
48+
exit 1
49+
elif ! git checkout "$version"; then
50+
printf 'Failed to checkout bootstrap branch %s\n' "$version" >&2
51+
exit 1
52+
elif ! cd "$orig_pwd" >/dev/null; then
53+
printf 'Failed to change directory back to %s\n' "$orig_pwd" >&2
54+
exit 1
4055
fi
56+
}
4157

42-
_install_gvm "$app_sys_root" "$gvm_version"
58+
_install_go() {
59+
_install_gvm
4360
. "$_GVM_PROFILE"
44-
gvm install go1.4.3
45-
gvm use go1.4.3
46-
gvm install $go_version
47-
gvm use $go_version --default
48-
gvm uninstall go1.4.3
61+
62+
if [[ -f "$_GVM_ROOT/gos/$GO_VERSION/bin/go" ]]; then
63+
printf 'Go version %s already installed\n' "$GO_VERSION"
64+
return
65+
elif ! _prepare_go_repo_for_bootstrap; then
66+
return 1
67+
elif ! gvm install "$_GVM_BOOTSTRAP_VERSION"; then
68+
return 1
69+
elif ! gvm use "$_GVM_BOOTSTRAP_VERSION"; then
70+
return 1
71+
elif ! GOROOT_BOOTSTRAP="$_GVM_ROOT/gos/$_GVM_BOOTSTRAP_VERSION" \
72+
gvm install "$GO_VERSION"; then
73+
return 1
74+
elif ! gvm use "$GO_VERSION" --default; then
75+
return 1
76+
fi
77+
gvm uninstall "$_GVM_BOOTSTRAP_VERSION"
4978
}
5079

5180
_install_go "$@"

scripts/install.d/languages.d/node

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# Install nvm and the latest Node.js version
44

5-
declare -r _NVM_ROOT="$APP_SYS_ROOT/nvm"
5+
declare -r _NVM_ROOT="$APPS_HOME/nvm"
66
declare -r _NVM_VERSION='v0.31.0'
7-
declare -r _NVM_PROFILE='/etc/profile.d/nvm.sh'
7+
declare -r _NVM_PROFILE="$APPS_HOME/etc/profile.d/nvm.sh"
88

99
_install_nvm() {
1010
local orig_pwd="$PWD"

scripts/install.d/languages.d/python

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# Install pyenv and the latest Python version
44

5-
declare -r _PYENV_ROOT="$APP_SYS_ROOT/pyenv"
6-
declare -r _PYENV_VERSION='v20160202'
7-
declare -r _PYENV_PROFILE='/etc/profile.d/pyenv.sh'
5+
declare -r _PYENV_ROOT="$APPS_HOME/pyenv"
6+
declare -r _PYENV_VERSION='v1.1.3'
7+
declare -r _PYENV_PROFILE="$APPS_HOME/etc/profile.d/pyenv.sh"
88

99
_install_pyenv() {
1010
local orig_pwd="$PWD"
@@ -26,8 +26,8 @@ _install_pyenv() {
2626
_install_python() {
2727
_install_pyenv
2828
. "$_PYENV_PROFILE"
29-
pyenv install $_PYTHON_VERSION
30-
pyenv global $_PYTHON_VERSION
29+
pyenv install $PYTHON_VERSION
30+
pyenv global $PYTHON_VERSION
3131
pip install --upgrade pip
3232
}
3333

scripts/install.d/languages.d/ruby

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# Install rbenv and the latest Ruby version
44

5-
declare -r _RBENV_ROOT="$APP_SYS_ROOT/rbenv"
6-
declare -r _RBENV_VERSION='v1.0.0'
7-
declare -r _RUBY_BUILD_VERSION='v20160228'
8-
declare -r _RBENV_PROFILE='/etc/profile.d/rbenv.sh'
5+
declare -r _RBENV_ROOT="$APPS_HOME/rbenv"
6+
declare -r _RBENV_VERSION='v1.1.1'
7+
declare -r _RUBY_BUILD_VERSION='v20170726'
8+
declare -r _RBENV_PROFILE="$APPS_HOME/etc/profile.d/rbenv.sh"
99

1010
_install_rbenv() {
1111
local orig_pwd="$PWD"
@@ -32,8 +32,8 @@ _install_rbenv() {
3232
_install_ruby() {
3333
_install_rbenv
3434
. "$_RBENV_PROFILE"
35-
rbenv install "$_RUBY_VERSION"
36-
rbenv global "$_RUBY_VERSION"
35+
rbenv install "$RUBY_VERSION"
36+
rbenv global "$RUBY_VERSION"
3737
gem install bundler colorator
3838
}
3939

settings.bash

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ declare -r PACKAGES_ADD_IF_MISSING=(
2323
'curl'
2424
'file'
2525
'gcc'
26+
'gpg'
2627
'less'
2728
'make'
2829
'man'
@@ -46,19 +47,19 @@ declare -r VIM_PATHOGEN_BUNDLE_REPOS=(
4647

4748
NPMS=(
4849
'livedown'
49-
'node-inspector'
5050
'yo'
5151
)
52+
# 'node-inspector'
5253

5354
# Since these may collide with variables from the language managers, they're not
5455
# readonly.
5556
# TODO(mbland): Restore GVM_VERSION if/when patch support is merged into
5657
# moovweb/gvm.
57-
declare GO_VERSION='go1.7.4'
58-
declare GVM_VERSION='patches' # 'f38923cc7b3108747b67ff8d0d633569b36cf99b'
58+
declare GO_VERSION='go1.9'
59+
#declare GVM_VERSION='patches' # 'f38923cc7b3108747b67ff8d0d633569b36cf99b'
5960

60-
declare -r NODE_VERSION='5.7.1'
61+
declare -r NODE_VERSION='8.4.0'
6162

62-
declare -r PYTHON_VERSION='3.5.1'
63+
declare -r PYTHON_VERSION='3.6.2'
6364

64-
declare -r RUBY_VERSION='2.3.0'
65+
declare -r RUBY_VERSION='2.4.1'

0 commit comments

Comments
 (0)