Edited at

さくらサーバーにHomebrewを導入する

シリーズ:さくらサーバーで遊ぶ

設定等のメモ
http://qiita.com/cielavenir/items/67a7c631713b4c816b6d

SSL化
http://qiita.com/cielavenir/items/aad29b2348fc4d3f9155

(さくらサーバー導入の主目的)
メールをフックする
http://qiita.com/cielavenir/items/5ce4568fc405329d421a

Linuxbrewを導入する(旧)
http://qiita.com/cielavenir/items/741921fcecb281555f77

Homebrewを導入する
https://qiita.com/cielavenir/items/67ce0ec9cd8d43ed00f1

さくらサーバーでgccへの依存が発生しない理由
(HOMEBREW_BUILD_FROM_SOURCE=1は不要)
https://qiita.com/cielavenir/items/410ded536d9b520989c4

方法の概略は以前説明していますが、自動化が不完全なのと、ベースが古くなったのと。


  • add these in .profile

export LD_LIBRARY_PATH=$HOME/.linuxbrew/lib

export GIT_EXECUTABLE=/usr/local/bin/git
export HOMEBREW_MAKE=/usr/local/bin/gmake
export HOMEBREW_NO_ENV_FILTERING=1
export HOMEBREW_TEMP=$HOME/tmp


  • initial

mkdir -p $HOME/tmp

wget https://raw.githubusercontent.com/Linuxbrew/install/master/install
sed -i.bak '-es/\/bin\/chown/\/usr\/sbin\/chown/' '-es/\/bin\/chgrp/\/usr\/bin\/chgrp/' install
rm install.bak
yes | ruby install
rm install

git -C $HOME/.linuxbrew/Homebrew remote add ciel https://github.com/cielavenir/brew
git -C $HOME/.linuxbrew/Homebrew fetch ciel
git -C $HOME/.linuxbrew/Homebrew checkout ciel/sakura # sakura is 2.1.2+patch
brew update --force

ln -s /usr/lib/libc.so $HOME/.linuxbrew/lib/libdl.so
ln -s $HOME/.linuxbrew/bin/patch $HOME/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/patch
ln -s $HOME/.linuxbrew/bin/m4 $HOME/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/m4
ln -s $HOME/.linuxbrew/bin/bison $HOME/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/bison
brew install gpatch
brew install m4
brew install bison

brew tap cielavenir/ciel
brew install $HOME/.linuxbrew/Homebrew/Library/Taps/cielavenir/homebrew-ciel/sakura/libiconv.rb
brew install $HOME/.linuxbrew/Homebrew/Library/Taps/cielavenir/homebrew-ciel/sakura/autoconf.rb
brew install automake
brew install pkg-config
brew install libtool


190807追記

export HOMEBREW_BUILD_FROM_SOURCE=1 は2.0以降では不要でした