Wiresharkのビルド mac

network
この記事は約3分で読めます。

Wiresharkのmacでのビルドの覚書き。

私の環境ではパッケージでQtを入れていたのでCMAKE_PREFIX_PATHでポイントしている。他にもライブラリが必要なものがあるかもしれない。その場合は、依存を見て解決していく。cmakeを使ってビルドを行なうという流れだけ理解しておけばよい。

brew install --cask sparkle
brew install libpcap
brew install ninja
brew install libssh
brew install cmake

wget https://www.wireshark.org/download/src/wireshark-3.6.0.tar.xz
unxz wireshark-3.6.0.tar.xz
tar xf wireshark-3.6.0.tar
cd wireshark-3.6.0
mkdir build && cd build
export CMAKE_PREFIX_PATH=/Users/guest/Qt/5.14.2/clang_64
cmake -GNinja ..
cmake --build .

Qtが複数入っている場合、以下のようにエラーになった。brewで入れていたライブラリを削除するとうまくいった。

 file included from ../ui/qt/service_response_time_dialog.cpp:10:
In file included from ../ui/qt/service_response_time_dialog.h:13:
In file included from ../ui/qt/tap_parameter_dialog.h:26:
In file included from /Users/t-moriyasu/Qt/5.14.2/clang_64/lib/QtWidgets.framework/Headers/QMenu:1:
In file included from /Users/t-moriyasu/Qt/5.14.2/clang_64/lib/QtWidgets.framework/Headers/qmenu.h:43:
In file included from /usr/local/include/QtWidgets/qtwidgetsglobal.h:43:
In file included from /usr/local/include/QtGui/qtguiglobal.h:43:
/usr/local/include/QtCore/qglobal.h:675:26: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
         typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
                    ~~~~~^
/Users/t-moriyasu/.electron_build_tools/third_party/Xcode/Xcode-12.4.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:538:63: note: 'enable_if' declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};

ビルドに成功するとrunディレクトリにアプリケーションであるWireshark.appディレクトリがあることがわかる。

ビルド環境

  • mac OS Catalina 10.15.7
  • Intel Core i5

参考

 

コメント

タイトルとURLをコピーしました