以下、うまくいかなかったけど、メモとして残します。
brew editで使うエディタをemasに変更(おこのみで)
export HOMEBREW_EDITOR="emacs"
mapnikのインストール設定を変更
brew edit mapnik
以下の部分を追加
args = [ "CC=\"#{ENV.cc}\"",
"CXX=\"#{ENV.cxx}\"",
"JOBS=#{jobs}",
"PREFIX=#{prefix}",
"ICU_INCLUDES=#{icu}/include",
"ICU_LIBS=#{icu}/lib",
"PYTHON_PREFIX=#{prefix}", # Install to Homebrew's site-packages
"FRAMEWORK_SEARCH_PATH=#{HOMEBREW_PREFIX}/Frameworks", #この行を追加
"JPEG_INCLUDES=#{jpeg}/include",
"JPEG_LIBS=#{jpeg}/lib",
"PNG_INCLUDES=#{libpng}/include",
"PNG_LIBS=#{libpng}/lib",
"TIFF_INCLUDES=#{libtiff}/include",
"TIFF_LIBS=#{libtiff}/lib",
"BOOST_INCLUDES=#{boost}/include",
"BOOST_LIBS=#{boost}/lib",
"PROJ_INCLUDES=#{proj}/include",
"PROJ_LIBS=#{proj}/lib",
"FREETYPE_CONFIG=#{freetype}/bin/freetype-config",
"INPUT_PLUGINS=shape,gdal,ogr,sqlite,python" #この行を追加
]
ソースからインストール
brew install --build-from-source mapnik
mapnikのプラグインを確認
python -c "from mapnik import DatasourceCache as c; print ','.join(c.plugin_names())"
さらに
python pluginのデモを実行するとsegfault 11 になるので
リンクを参考に
boostのソースを取ってきて、patchを適用して、圧縮して、brew edit でソースの取得先をfile://にして、brew install boost 、brew install boost-python してから mapnik インストールしても だめ
備考
- ソースからコンパイルしようとしたけど、途中で進まなくなる。brew install mapnik のログを見ると、何やらパッチを当ててるようなので、それが関係してるのかも。 python scons/scons.py configure INPUT_PLUGINS=all
参考リンク
https://github.com/mapnik/mapnik/wiki/PluginArchitecture
https://github.com/mapnik/mapnik/issues/1838
https://github.com/mapnik/mapnik/wiki/UsingScons
https://github.com/mapnik/mapnik/blob/master/INSTALL.md
https://github.com/mapnik/mapnik/wiki/Python-Plugin