[macOS] Use Brewfiles

This commit is contained in:
Ivan Malison 2016-10-08 22:18:26 -07:00
parent 14b484b2ab
commit b392fd30a3
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
9 changed files with 251 additions and 43 deletions

1
Brewfile Symbolic link
View File

@ -0,0 +1 @@
tasks/brewfiles/essential

View File

@ -21,7 +21,6 @@ pylint
pyspotify
pythonpy
readline
ropemacs
simplejson
sphinx
sqlalchemy

15
start.sh Normal file → Executable file
View File

@ -1,15 +1,5 @@
#!/bin/bash
function fedora() {
yum install make automake gcc gcc-c++ kernel-devel
yum install
yum install python-pip
}
#!/usr/bin/env bash
function debian() {
local INSTALL_COMMAND='sudo apt-get -y install'
hash apt-get &>/dev/null || (echo 'apt-get is missing.' && exit)
$INSTALL_COMMAND build-essential git python python-dev python-pip
}
function brew_for_multiple_users() {
sudo chgrp -R admin /usr/local
@ -27,13 +17,12 @@ function osx() {
brew install git
brew install python
sudo easy_install pip
sudo pip install cider
}
function go() {
git clone https://github.com/IvanMalison/dotfiles.git --recursive
cd dotfiles
sudo pip install invoke dotfiles
sudo pip install invoke
invoke setup
}

View File

@ -19,14 +19,13 @@ ns.add_collection(arch)
def setup(ctx):
ctx.config['run']['pty'] = False
ctx.config['run']['warn'] = True
dotfiles(ctx, 'f')
if 'darwin' in sys.platform:
osx.setup(ctx)
else:
linux.setup(ctx)
fix_pip(ctx)
dotfiles(ctx)
python(ctx)
powerline(ctx)
fix_pip(ctx)
install_npm_libraries(ctx)
change_shell(ctx)
@ -56,16 +55,12 @@ def link_emacs(ctx, flags='f'):
force=True)
@ctask
def powerline(ctx):
ctx.run('sudo pip install psutil')
ctx.run('sudo pip install git+git://github.com/Lokaltog/powerline')
@ctask
def python(ctx):
ctx.run('sudo pip install setuptools --upgrade')
ctx.run('sudo pip install -r {0}'.format(
ctx.run('pyenv install 2.7.11')
ctx.run('pyenv global 2.7.11')
ctx.run('pip install setuptools --upgrade')
ctx.run('pip install -r {0}'.format(
os.path.join(RESOURCES_DIRECTORY, 'requirements.txt')
))
@ -77,10 +72,6 @@ def install_npm_libraries(ctx):
))
@ctask
def vimstall(ctx):
ctx.run('vim +BundleInstall! +q +q')
@ctask
def change_shell(ctx):
@ -139,8 +130,6 @@ ns.add_task(dropbox_dotfiles)
ns.add_task(install_npm_libraries)
ns.add_task(python)
ns.add_task(link_dropbox_other)
ns.add_task(powerline)
ns.add_task(setup)
ns.add_task(vimstall)
ns.add_task(fix_dropbox_permissions)
ns.add_task(link_emacs)

114
tasks/brewfiles/additional Normal file
View File

@ -0,0 +1,114 @@
brew 'android-sdk'
brew 'ant'
brew 'autoconf'
brew 'autojump'
brew 'automake'
brew 'binutils'
brew 'brew-cask'
brew 'cmake'
brew 'coreutils'
brew 'ctags'
brew 'daemonize'
brew 'docker'
brew 'fontconfig'
brew 'fontforge'
brew 'freetype'
brew 'gawk'
brew 'gcc'
brew 'gdbm'
brew 'gettext'
brew 'git-flow'
brew 'git-subrepo'
brew 'giter8'
brew 'glib'
brew 'gobject-introspection'
brew 'gradle'
brew 'grsync'
brew 'gtk+3'
brew 'gupnp'
brew 'html2text'
brew 'icu4c'
brew 'intltool'
brew 'isync'
brew 'jpeg'
brew 'leiningen'
brew 'libevent'
brew 'libffi'
brew 'libidn'
brew 'libpng'
brew 'libsoup'
brew 'libspotify'
brew 'libtasn1'
brew 'libtiff'
brew 'libtool'
brew 'lzip'
brew 'mackup'
brew 'mercurial'
brew 'mopidy'
brew 'mu --with-emacs'
brew 'mysql'
brew 'ncmpcpp'
brew 'netcat'
brew 'nettle'
brew 'ngrep'
brew 'nmap'
brew 'offline-imap'
brew 'openssl'
brew 'ossp-uuid'
brew 'pandoc'
brew 'pango'
brew 'pcre'
brew 'pixman'
brew 'pkg-config'
brew 'plantuml'
brew 'pstree'
brew 'psutils'
brew 'pv'
brew 'pyenv'
brew 'pypy'
brew 'python'
brew 'python3'
brew 'rabbitmq'
brew 'racket'
brew 'rsync'
brew 'rtorrent'
brew 'ruby-build'
brew 'sdl'
brew 'sdl_image'
brew 'sdl_mixer'
brew 'sdl_ttf'
brew 'sleuthkit'
brew 'subversion'
brew 'tccutil'
brew 'terminal-notifier'
brew 'the_silver_searcher'
brew 'thrift'
brew 'tig'
brew 'tig'
brew 'tmate'
brew 'tmux'
brew 'unoconv'
brew 'vim'
brew 'w3m'
brew 'wakeonlan'
brew 'wdiff'
brew 'webp'
brew 'weechat'
brew 'wget'
brew 'whereami'
brew 'xz'
brew 'yab'
cask 'adobe-reader'
cask 'android-studio'
cask 'atom'
cask 'bittorrent-sync'
cask 'calibre'
cask 'chicken'
cask 'cscreen'
cask 'firefox'
cask 'flux'
cask 'hipchat'
cask 'libreoffice'
cask 'owncloud'
cask 'sublime-text'
cask 'virtualbox'

69
tasks/brewfiles/default Normal file
View File

@ -0,0 +1,69 @@
cask_args appdir: '/Applications'
brew 'ack'
brew 'bash'
brew 'boot-clj'
brew 'cabal-install'
brew 'coreutils'
brew 'emacs', args: ['with-cocoa', 'with-librsvg', 'with-gnutls', 'with-imagemagick']
brew 'findutils'
brew 'ghc'
brew 'gist'
brew 'git'
brew 'git-flow'
brew 'glide'
brew 'gnupg'
brew 'gnupg2'
brew 'gnutls'
brew 'go'
brew 'htop-osx'
brew 'hub'
brew 'icdiff'
brew 'ispell'
brew 'leiningen'
brew 'netcat'
brew 'nettle'
brew 'ngrep'
brew 'nmap'
brew 'node'
brew 'openssl'
brew 'pyenv'
brew 'pyenv'
brew 'pypy'
brew 'python'
brew 'python3'
brew 'rbenv'
brew 'readline'
brew 'reattach-to-user-namespace'
brew 'rust'
brew 'sbt'
brew 'scala'
brew 'sqlite'
brew 'the_silver_searcher'
brew 'thrift'
brew 'tmate'
brew 'tmux'
brew 'watch'
brew 'zsh'
cask 'alfred'
cask 'caffeine'
cask 'dropbox'
cask 'flash'
cask 'flycut'
cask 'google-chrome'
cask 'google-hangouts'
cask 'gpgtools'
cask 'iterm2'
cask 'java'
cask 'karabiner'
cask 'macpass'
cask 'mirrordisplays'
cask 'osxfuse'
cask 'slate'
cask 'sparkleshare'
cask 'spotify'
cask 'synergy'
cask 'transmission'
cask 'vlc'
cask 'xquartz'

36
tasks/brewfiles/essential Normal file
View File

@ -0,0 +1,36 @@
tap 'thoughtbot/formulae'
brew 'coreutils'
brew 'emacs', args: ['with-cocoa', 'with-librsvg', 'with-gnutls', 'with-imagemagick']
brew 'findutils'
brew 'git'
brew 'gnupg'
brew 'gnupg2'
brew 'gnutls'
brew 'go'
brew 'htop-osx'
brew 'leiningen'
brew 'pyenv'
brew 'rcm'
brew 'rbenv'
brew 'readline'
brew 'reattach-to-user-namespace'
brew 'the_silver_searcher'
brew 'tmux'
brew 'zsh'
cask 'alfred'
cask 'flash'
cask 'flycut'
cask 'google-chrome'
cask 'google-hangouts'
cask 'iterm2'
cask 'java'
cask 'karabiner'
cask 'slate'
cask 'sparkleshare'
cask 'spotify'
cask 'synergy'
cask 'transmission'
cask 'vlc'
cask 'xquartz'

View File

@ -8,7 +8,7 @@ from . import util
@ctask(default=True)
def setup(ctx):
brew(ctx)
cider(ctx)
brew_essential(ctx)
access_for_assistive_devices(ctx)
tccutil(ctx)
karabiner(ctx)
@ -20,18 +20,10 @@ def setup(ctx):
iTerm(ctx)
keyboard_settings(ctx)
custom_keyboard_shortcuts(ctx)
brew_additional(ctx)
brew_default(ctx)
@ctask
def macvim(ctx):
macvim_install = (
"macvim --override-system-vim --custom-system-icons "
"--with-features=huge --enable-rubyinterp --enable-pythoninterp "
"--enable-perlinterp --enable-cscope"
)
ctx.run("brew install {0}".format(macvim_install))
ctx.run("vim +BundleInstall! +q +q")
@ctask
def setup_dbus(ctx):
@ -45,6 +37,23 @@ def system_settings(ctx):
), pty=True)
BREWFILE_DIRECTORY = os.path.join(util.TASKS_DIRECTORY, "brewfiles")
def make_brewfile_task(filename):
task_name = "brew_{}".format(filename)
@ctask(name=task_name)
def temp(ctx):
ctx.run('brew bundle --file="{}"'.format(
os.path.join(BREWFILE_DIRECTORY, filename)
))
globals()[task_name] = temp
for filename in os.listdir(BREWFILE_DIRECTORY):
make_brewfile_task(filename)
@ctask
def cider(ctx):
ctx.run('brew install caskroom/cask/brew-cask')
@ -58,6 +67,7 @@ def brew(ctx):
path = 'https://raw.githubusercontent.com/Homebrew/install/master/install)'
if not util.command_exists('brew'):
ctx.run('ruby -e "$(curl -fsSL {0}'.format(path))
ctx.run('brew tap Homebrew/bundle')
@ctask

View File

@ -4,7 +4,8 @@ import os
from invoke import run
REPO_DIRECTORY = os.path.dirname(os.path.dirname(__file__))
TASKS_DIRECTORY = os.path.dirname(__file__)
REPO_DIRECTORY = os.path.dirname(TASKS_DIRECTORY)
DOTFILES_DIRECTORY = os.path.join(REPO_DIRECTORY, 'dotfiles')
RESOURCES_DIRECTORY = os.path.join(REPO_DIRECTORY, 'resources')