t.marcusの外部記憶装置

忘備録とかちょっとした考えとかをつらつらと...

Mac + Eclipse + Subclipseの環境構築 その2

Eclipse4.3に乗り換えてSVNレポジトリが参照できなくなったので、またJavaHL周りの問題かと思いbrew unlinkして再インストールしたところ以下の様なエラーが出たので、忘備録として書いておく

    Incompatible library version
svn: ra_serf was compiled for serf 1.3.3 but loaded an incompatible 1.1.1 library

JavaHL周りの問題かと思って、まずsubversionを再インストールした

# 古いsubversionをunlink
$ brew unlink subversion
Unlinking /usr/local/Cellar/subversion/1.7.8... 67 links removed

# 新しいsubversionをインストール
$ brew install --universal --java subversion
==> Installing dependencies for subversion: sqlite, autoconf, automake, scons
==> Installing subversion dependency: sqlite
==> Downloading http://www.sqlite.org/2013/sqlite-autoconf-3080200.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.8.2 --enable-dynamic-extensions
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

OS X provides an older sqlite3.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
OK  /usr/local/Cellar/sqlite/3.8.2: 9 files, 3.4M, built in 2.3 minutes
==> Installing subversion dependency: autoconf
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69
==> make install
OK  /usr/local/Cellar/autoconf/2.69: 69 files, 2.0M, built in 10 seconds
==> Installing subversion dependency: automake
==> Downloading http://ftpmirror.gnu.org/automake/automake-1.14.1.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/automake/1.14.1
==> make install
OK  /usr/local/Cellar/automake/1.14.1: 127 files, 2.5M, built in 11 seconds
==> Installing subversion dependency: scons
==> Downloading http://downloads.sourceforge.net/scons/scons-2.3.0.tar.gz
######################################################################## 100.0%
==> /usr/bin/python setup.py install --prefix=/usr/local/Cellar/scons/2.3.0 --standalone-lib --install-lib=/usr/local/Cellar/scons/2.3
OK  /usr/local/Cellar/scons/2.3.0: 395 files, 4.2M, built in 82 seconds
==> Installing subversion
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.8.5.tar.bz2
==> Best Mirror http://ftp.tsukuba.wide.ad.jp/software/apache/subversion/subversion-1.8.5.tar.bz2

curl: (22) The requested URL returned error: 404
Trying a mirror...
==> Downloading http://archive.apache.org/dist/subversion/subversion-1.8.5.tar.bz2
######################################################################## 100.0%
==> Patching
patching file subversion/bindings/swig/perl/native/Makefile.PL.in
==> Downloading http://serf.googlecode.com/files/serf-1.3.3.tar.bz2
######################################################################## 100.0%
==> scons PREFIX=/usr/local/Cellar/subversion/1.8.5/libexec/serf GSSAPI=/usr CC=/usr/bin/clang CFLAGS=-Os -w -pipe -march=native -mmac
==> scons install
Warning: JAVA_HOME is set. Try unsetting it if JNI headers cannot be found.
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/subversion/1.8.5 --with-apr=/usr/local/Library/ENV/4.3 --with-zlib=/usr --with-sqlite=/usr/
==> make
==> make install
==> make tools
==> make install-tools
==> make javahl
==> make install-javahl
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
OK  /usr/local/Cellar/subversion/1.8.5: 119 files, 18M, built in 9.8 minutes

Eclipseを起動して、レポジトリを参照してみると冒頭のエラーが出た。

1.3.3向けにコンパイルされているはずなのに、1.1.1のライブラリがロードされた云々と言われているので確認する

$ brew list serf
/usr/local/Cellar/serf/1.1.1/include/serf-1/ (4 files)
/usr/local/Cellar/serf/1.1.1/lib/libserf-1.0.dylib
/usr/local/Cellar/serf/1.1.1/lib/pkgconfig/serf-1.pc
/usr/local/Cellar/serf/1.1.1/lib/ (2 other files)

確かに。

ということで、1.1.1をremove

$ brew remove serf
Uninstalling /usr/local/Cellar/serf/1.1.1...

肝心のserf1.3.3は、subversionのlibexecとして入れられてるので大丈夫?

$ ll /usr/local/Cellar/subversion/1.8.5/libexec/serf/lib/
total 1016
-rwxr-xr-x  1 tmarcus  admin  229684  5  2 17:08 libserf-1.1.3.0.dylib*
-rw-r--r--  1 tmarcus  admin  282360  5  2 17:08 libserf-1.a
lrwxr-xr-x  1 tmarcus  admin      21  5  2 17:08 libserf-1.dylib@ -> libserf-1.1.3.0.dylib
drwxr-xr-x  3 tmarcus  admin     102  5  2 17:08 pkgconfig/

かとおもったが、結局また、JavaHLのライブラリが見つからないと怒られたので、再度、subversionをインストール

$ brew install --universal --java subversion
Error: subversion-1.8.5 already installed
To install this version, first `brew unlink subversion'
[17:45:40 A12649@PC-5861 ~]$ brew unlink subversion
Unlinking /usr/local/Cellar/subversion/1.8.5... 66 symlinks removed
[17:45:52 A12649@PC-5861 ~]$ brew install --universal --java subversion
==> Installing dependencies for subversion: readline, sqlite, scons, openssl
==> Installing subversion dependency: readline
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.3.3.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.3.3.mountain_lion.bottle.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.

OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/readline/lib
    CPPFLAGS: -I/usr/local/opt/readline/include

==> Summary
OK  /usr/local/Cellar/readline/6.3.3: 40 files, 2.1M
==> Installing subversion dependency: sqlite
==> Downloading http://sqlite.org/2014/sqlite-autoconf-3080403.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.8.4.3 --enable-dynamic-extensions
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

OS X provides an older sqlite3.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
OK  /usr/local/Cellar/sqlite/3.8.4.3: 9 files, 3.4M, built in 2.2 minutes
==> Installing subversion dependency: scons
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/scons-2.3.1.mountain_lion.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring scons-2.3.1.mountain_lion.bottle.3.tar.gz
OK  /usr/local/Cellar/scons/2.3.1: 205 files, 2.4M
==> Installing subversion dependency: openssl
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0.1g.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.1g.mountain_lion.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

The OpenSSL provided by OS X is too old for some software.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
OK  /usr/local/Cellar/openssl/1.0.1g: 429 files, 15M
==> Installing subversion
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.8.8.tar.bz2
==> Best Mirror http://ftp.jaist.ac.jp/pub/apache/subversion/subversion-1.8.8.tar.bz2
######################################################################## 100.0%
==> Patching
patching file subversion/bindings/swig/perl/native/Makefile.PL.in
Hunk #1 succeeded at 76 (offset 7 lines).
patching file configure.ac
==> Downloading http://serf.googlecode.com/svn/src_releases/serf-1.3.4.tar.bz2
######################################################################## 100.0%
==> /usr/local/opt/scons/bin/scons PREFIX=/usr/local/Cellar/subversion/1.8.8/libexec/serf GSSAPI=/usr CC=/usr/bin/clang CFLAGS=-Os -w
==> /usr/local/opt/scons/bin/scons install
Warning: JAVA_HOME is set. Try unsetting it if JNI headers cannot be found.
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/subversion/1.8.8 --with-apr=/usr/local/Library/ENV/4.3 --with-zlib=/usr --with-sqlite=/usr/
==> make
==> make install
==> make tools
==> make install-tools
==> make javahl
==> make install-javahl
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
OK  /usr/local/Cellar/subversion/1.8.8: 119 files, 18M, built in 7.4 minutes

subversion1.8.8が入ったっぽいので、eclipse.iniのパスを1.8.8に書き換える

$ cat /Applications/eclipse43-sr2/Eclipse.app/Contents/MacOS/eclipse.ini | grep java.library.path
-Djava.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:/usr/local/Cellar/subversion/1.8.8/lib

上記の手順でちゃんと動きますた。

いい加減Gitに移行したい…