(IMAKECPP): Use "${brew_prefix}/bin/cpp-4.9" instead of
[chise/chise-base.git] / bootstrap.homebrew
index 46923ca..b4cbd13 100755 (executable)
@@ -3,19 +3,45 @@
 brew update
 brew upgrade
 
+brew_prefix=`brew --prefix`
+
+#brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gcc.rb \
+#      --use-llvm
+#brew install apple-gcc42
+#export IMAKECPP=/usr/local/bin/cpp-4.2
+brew install gcc
+#export IMAKECPP=${brew_prefix}/bin/cpp
+export IMAKECPP=${brew_prefix}/bin/cpp-4.9
+
 brew -v install libtiff
 brew -v install openjpeg
 brew -v install berkeley-db
 brew -v install xaw3d
 brew -v install gettext
 
-(cd `brew --prefix` ; git pull https://github.com/chise/homebrew/)
+if [ -f /Library/LaunchDaemons/homebrew.mxcl.canna.plist ]
+then
+    sudo launchctl unload -w /Library/LaunchDaemons/homebrew.mxcl.canna.plist
+fi
+if [ -x ${brew_prefix}/sbin/cannakill ]
+then
+    sudo ${brew_prefix}/sbin/cannakill
+fi
 
+brew tap chise/misc
 brew -v install canna
 
+
+sudo sh -c "sed 's/rc\.canna/rc.canna-root/' \
+    < ${brew_prefix}`ls -l ${brew_prefix}/sbin/cannaserver \
+                       | sed 's/^.*-> ..//' \
+                       | sed 's|/sbin/cannaserver||'`/homebrew.mxcl.canna.plist \
+    > /Library/LaunchDaemons/homebrew.mxcl.canna.plist"
+sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.canna.plist
+
 brew -v install wget
 
-./configure \
+CC=${brew_prefix}/bin/gcc-4.9 ./configure \
     --with-site-includes=/usr/X11/include \
     --with-site-libraries=/usr/X11/lib \
     --with-canna
@@ -26,5 +52,4 @@ make install-base
 
 cd chise-fonts-installer/TrueType && make build-arphic \
     && make install-arphic
-
-cd Hanazono/ && make install-mac
+make install-mac