Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Add pyenv settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ziwon committed Jan 20, 2019
1 parent 453324f commit 4dc220a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bash/.bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ fi;
complete -W "NSGlobalDomain" defaults;

# Add `killall` tab completion for common apps
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;

# Initialize pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
4 changes: 4 additions & 0 deletions pyenv/fix-mojave
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# Ref: https://github.com/pyenv/pyenv/issues/1219
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
19 changes: 19 additions & 0 deletions pyenv/fix-pyenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Ref: https://github.com/princeofdatamining/ops/blob/master/osx/pyenv-install-version.sh
VERSION=$1
CFLAGS=
LDFLAGS=
shift

for arg in $@; do
CFLAGS="$CFLAGS -I$(brew --prefix $arg)/include"
LDFLAGS="$LDFLAGS -L$(brew --prefix $arg)/lib"
done

[ -n "$VERSION" ] && echo "Installing $VERSION.."
[ -n "$CFLAGS" ] && echo $CFLAGS
[ -n "$LDFLAGS" ] && echo $LDFLAGS

CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \
pyenv install $VERSION
10 changes: 10 additions & 0 deletions pyenv/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

cd "$(dirname "${BASH_SOURCE}")";

PY2_VER=2.7.15
PY3_VER=3.7.1

sh ./fix-mojave
sh ./fix-pyenv $PY2_VER zlib
sh ./fix-pyenv $PY3_VER zlib sqlite

0 comments on commit 4dc220a

Please sign in to comment.