のんびりしているエンジニアの日記

ソフトウェアなどのエンジニア的な何かを書きます。

Homebrewの簡単な使い方

Sponsored Links

皆さんこんにちわ
いかがお過ごしですか?私は元気です。

さて、本日はHomebrew(http://brew.sh/)についてご紹介したいと思います。
Homebrewとはソフトウェアのインストールを簡単にするバージョン管理システムです。
boost、PythonApacheなどを簡単にインストールできます。

類似のソフトウェアにはapt-get,MacPortsがあります。
なんでこれ使ってるのかって?
友達に紹介されたからですとも…結局便利なのでこのまま使っておりますが…

インストール
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
ソフトウェアインストール
brew doctor
brew update
brew install python
インストールしたソフトウェアの情報(出力結果込み)
brew info python
python: stable 2.7.6, HEAD
http://www.python.org
/usr/local/Cellar/python/2.7.6 (5227 files, 81M) *
  Built from source
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/python.rb
==> Dependencies
Build: pkg-config ✔
Recommended: readline ✔, sqlite ✔, gdbm ✘
==> Options
--quicktest
	Run `make quicktest` after the build (for devs; may fail)
--universal
	Build a universal binary
--with-brewed-openssl
	Use Homebrew's openSSL instead of the one from OS X
--with-brewed-tk
	Use Homebrew's Tk (has optional Cocoa and threads support)
--with-dtrace
	Experimental DTrace support (http://bugs.python.org/issue13405)
--with-poll
	Enable select.poll, which is not fully implemented on OS X (http://bugs.python.org/issue5154)
--without-gdbm
	Build without gdbm support
--without-readline
	Build without readline support
--without-sqlite
	Build without sqlite support
--HEAD
	install HEAD version
==> Caveats
Python demo
  /usr/local/share/python/Extras

Setuptools and Pip have been installed. To update them
  pip install --upgrade setuptools
  pip install --upgrade pip

You can install Python packages with (the outdated easy_install or)
  `pip install <your_favorite_package>`

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python

.app bundles were installed to /usr/local/Cellar/python/2.7.6 (or libexec).
Run `brew linkapps` to symlink these to /Applications.
ダウンロードできるソフトウェアを探す(出力結果込み)
brew search python
gst-python010	python24	python26	python31	zpython
python		python25	python3		python32
homebrew/apache/mod_python
インストールできるソフトウェアのバージョンを出力(出力結果込み)

左から
バージョン コミットid?(0a82b3a) 存在するパス

brew versions python
2.7.6    git checkout 0a82b3a Library/Formula/python.rb
2.7.5    git checkout a04b443 Library/Formula/python.rb
2.7.3    git checkout 865f763 Library/Formula/python.rb
2.7.4    git checkout 280581d Library/Formula/python.rb
2.7.2    git checkout 97c6869 Library/Formula/python.rb
2.7.1    git checkout 83ed494 Library/Formula/python.rb
2.7      git checkout 1bf3552 Library/Formula/python.rb
2.6.5    git checkout acd49f7 Library/Formula/python.rb
2.6.4    git checkout 843bff9 Library/Formula/python.rb
2.6.3    git checkout 5c6cc64 Library/Formula/python.rb
インストールするソフトウェアのバージョンを変更
git checkout a04b443 /usr/local/Library/Formula/python.rb

その後 brew install pythonで可

アンインストール
brew uninstall python

これだけ知っていれば大丈夫です。多分
皆さんも素晴らしいbrew ライフを楽しみましょう。