読者です 読者をやめる 読者になる 読者になる

Homebrew で Leopard に Subversion を入れる

Leopard 10.5.8 上の Homebrew で Subversion を入れようとしたら、 OpenSSL まわりで失敗した。

最終的に

--- /usr/local/Library/Formula/subversion.rb.orig       2011-05-01 12:39:47.000000000 +0900
+++ /usr/local/Library/Formula/subversion.rb    2011-05-01 12:39:58.000000000 +0900
@@ -69,6 +69,9 @@
   end

   def install
+    ENV.append "LDFLAGS", "-L/usr/local/Cellar/openssl/0.9.8o/lib"
+    ENV.append "CPPFLAGS", "-I/usr/local/Cellar/openssl/0.9.8o/include"
+
     if build_java?
       unless build_universal?
         opoo "A non-Universal Java build was requested."

これで通した。 CPPFLAGS いるのかな。やや適当。

上記が示す通り、先に Homebrew の OpenSSL を入れてある。


なお、以下では解決に至らなかった。

$ export LDFLAGS=-L/usr/local/Cellar/openssl/0.9.8o/lib CPPFLAGS=-I/usr/local/Cellar/openssl/0.9.8o/include
$ brew install subversion
$ brew link openssl
$ brew install subversion


失敗した際のエラーは以下の通り。

/private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libtool --silent --tag=CC --mode=link /usr/bin/cc  -rpath /usr/local/Cellar/subversion/1.6.16/lib -o libserf-0.la buckets/aggregate_buckets.lo buckets/request_buckets.lo context.lo buckets/buckets.lo buckets/simple_buckets.lo buckets/file_buckets.lo buckets/mmap_buckets.lo buckets/socket_buckets.lo buckets/response_buckets.lo buckets/headers_buckets.lo buckets/allocator.lo buckets/dechunk_buckets.lo buckets/deflate_buckets.lo buckets/limit_buckets.lo buckets/ssl_buckets.lo buckets/barrier_buckets.lo buckets/chunk_buckets.lo buckets/bwtp_buckets.lo incoming.lo outgoing.lo auth/auth.lo auth/auth_basic.lo auth/auth_digest.lo auth/auth_kerb.lo auth/auth_kerb_gss.lo /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr-util/libaprutil-1.la     -lexpat -liconv /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libapr-1.la -lpthread -lz -lssl -lcrypto
ranlib: file: .libs/libserf-0.a(auth_kerb.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb_gss.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb.o) has no symbols
ranlib: file: .libs/libserf-0.a(auth_kerb_gss.o) has no symbols
/private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libtool --silent --tag=CC --mode=link /usr/bin/cc  -static -o test/serf_get libserf-0.la test/serf_get.lo /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr-util/libaprutil-1.la     -lexpat -liconv /private/tmp/homebrew-subversion-1.6.16-YZWY/subversion-1.6.16/apr/libapr-1.la -lpthread -lz -lssl -lcrypto
Undefined symbols:
  "_BIO_set_flags", referenced from:
      _bio_bucket_read in libserf-0.a(ssl_buckets.o)
      _bio_file_read in libserf-0.a(ssl_buckets.o)
      _bio_file_gets in libserf-0.a(ssl_buckets.o)
  "_BIO_clear_flags", referenced from:
      _bio_bucket_read in libserf-0.a(ssl_buckets.o)
      _bio_bucket_write in libserf-0.a(ssl_buckets.o)
      _bio_file_read in libserf-0.a(ssl_buckets.o)
      _bio_file_write in libserf-0.a(ssl_buckets.o)
      _bio_file_gets in libserf-0.a(ssl_buckets.o)
  "_SSL_CTX_set_client_cert_cb", referenced from:
      _ssl_init_context in libserf-0.a(ssl_buckets.o)
  "_BIO_test_flags", referenced from:
      _ssl_encrypt in libserf-0.a(ssl_buckets.o)
      _ssl_encrypt in libserf-0.a(ssl_buckets.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [test/serf_get] Error 1
make: *** [external-all] Error 1
make: *** Waiting for unfinished jobs....
Error: #<BuildError: Failed executing: make >
/usr/local/Library/Homebrew/formula.rb:469:in `system'
/usr/local/Library/Formula/subversion.rb:112:in `install'
/usr/local/Library/Homebrew/install.rb:92:in `install'
/usr/local/Library/Homebrew/formula.rb:246:in `brew'
/usr/local/Library/Homebrew/formula.rb:530:in `stage'
/usr/local/Library/Homebrew/formula.rb:489:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:528:in `stage'
/usr/local/Library/Homebrew/formula.rb:241:in `brew'
/usr/local/Library/Homebrew/install.rb:70:in `install'
/usr/local/Library/Homebrew/install.rb:34
/usr/local/Library/Formula/subversion.rb:159
==> Rescuing build...
When you exit this shell Homebrew will attempt to finalise the installation.
If nothing is installed or the shell exits with a non-zero error code,
Homebrew will abort. The installation prefix is:
/usr/local/Cellar/subversion/1.6.16

Snow Leopard は 3.3k JPY しかしないのだし、 Snow Leopard でないと動かないものも多くなってきたので、Lion 入り Mac 待ちなんて嘯いてないで、Snow Leopard を買ってきた方が利口かもしれない。