- Use `gcc' instead of `apple-gcc42'.
[chise/chise-base.git] / bootstrap.homebrew
index de74df8..041fc8e 100755 (executable)
@@ -3,28 +3,52 @@
 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
+
 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 ./configure \
     --with-site-includes=/usr/X11/include \
     --with-site-libraries=/usr/X11/lib \
     --with-canna
 
 ulimit -n 2048
 
-make -e SUDO=sudo install-base
+make install-base
 
 cd chise-fonts-installer/TrueType && make build-arphic \
-    && sudo make install-arphic
-
-cd Hanazono/ && sudo make install-mac
+    && make install-arphic
+make install-mac