LoginSignup
2
2

More than 5 years have passed since last update.

brew から bitcoind をインストールする

Posted at

公式だと、Bitcoin-QTのcask(bitcoin-core)しかないので、以下の非公式formulaeをインストールしてみる。
https://github.com/WyseNynja/homebrew-bitcoin

$ brew tap WyseNynja/homebrew-bitcoin
...
Tapped 9 formulae (44 files, 46.0K)
$ brew install wysenynja/bitcoin/bitcoind
...
checking for EVENT... no
configure: error: libevent not found.
...

libeventがないと怒られる。がlibeventはすでにbrewにてインストール済み。
/tmpに展開されていたconfigureファイルをそのまま実行してみると、特にエラーは出ないのでパス周りの問題っぽい。

調べると、brew install実行時に設定される環境変数PKG_CONFIG_LIBDIRの問題で、/usr/local/lib/pkgconfig/libevent.pcとして存在するlibeventのパッケージファイルが参照できていないのが原因っぽい。ちなみに、brewコマンド実行時に設定される環境変数はbrew --envで確認できる。

$ brew --env
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
MACOSX_DEPLOYMENT_TARGET: 10.11
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.11
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin

これは次の投稿にあるように、Homebrew 0.9.3 から導入された、superenvの影響と思われる。
http://qiita.com/koshigoe/items/f0ee5b65cd9a6ccf5e36

投稿によると、install時のオプションに --env=stdをつけることでsuperenvを回避できるらしい。
実際にsuperenvを回避して実行するとconfigureに通り、無事ビルドできた。

$ brew install --env=std wysenynja/bitcoin/bitcoind
==> Installing bitcoind from wysenynja/bitcoin
==> Downloading https://github.com/bitcoin/bitcoin/archive/v0.12.1.tar.gz
Already downloaded: /Users/go/Library/Caches/Homebrew/bitcoind-0.12.1.tar.gz
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/bitcoind/0.12.1/libexec
==> make
    ==> make install
🍺  /usr/local/Cellar/bitcoind/0.12.1: 19 files, 14.9M, built in 5 minutes 54 seconds
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2