綾小路龍之介の素人思考

[weechat] pythonスクリプトをサポートするようにコンパイル

weechatの作者であるFlashCode氏はpythonでスクリプトを書いている。彼の書いている有用なスクリプトweeget.py、cron.pyを使うにはpythonのサポートが必要。pythonをサポートした状態でweechatのコンパイルを行う。

最初にプラグインサポートの状態を確認する。weechatを起動すると以下のメッセージが流れる。ロードされたプラグインにpythonが含まれないことがわかる。

$ weechat-curses
01:57:17 |   ___       __         ______________        _____
01:57:17 |   __ |     / /___________  ____/__  /_______ __  /_
01:57:17 |   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
01:57:17 |   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_
01:57:17 |   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/
01:57:17 | WeeChat 0.3.6 [compiled on Nov 29 2011 01:50:13]
01:57:17 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
01:57:17 | Plugins loaded: alias, charset, fifo, irc, logger, perl, relay, rmodifier, xfer

起動中のweechatでは、以下のように/pluginコマンドでロードされたプラグインが確認できる。pythonプラグインはロードされていないことがわかる。

/plugin
01:55:44 |
01:55:44 | Plugins loaded:
01:55:44 |   irc: IRC (Internet Relay Chat) plugin for WeeChat
01:55:44 |   rmodifier: Regex modifier plugin for WeeChat
01:55:44 |   fifo: Fifo plugin for WeeChat
01:55:44 |   relay: Network communication between WeeChat and remote application
01:55:44 |   perl: Perl plugin for WeeChat
01:55:44 |   alias: Alias plugin for WeeChat
01:55:44 |   xfer: Xfer (file transfer and direct chat) plugin for WeeChat
01:55:44 |   charset: Charset plugin for WeeChat
01:55:44 |   logger: Logger plugin for WeeChat

本家サイトからweechatのソースコードをダウンロードし、展開、ディレクトリの移動。

$ wget 'http://www.weechat.org/files/src/weechat-0.3.6.tar.bz2'
--2011-12-31 01:43:20--  http://www.weechat.org/files/src/weechat-0.3.6.tar.bz2
Resolving www.weechat.org... 178.63.40.67
Connecting to www.weechat.org|178.63.40.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2179857 (2.1M) [application/x-bzip2]
Saving to: “weechat-0.3.6.tar.bz2”

100%[==============================================>] 2,179,857    622K/s   in 3.4s

2011-12-31 01:43:24 (622 KB/s) - “weechat-0.3.6.tar.bz2” saved [2179857/2179857]

$ tar jxf weechat-0.3.6.tar.bz2
$ cd weechat-0.3.6/

INSTALLファイルを参照して、コンパイル方法を確認。今回はcmakeでコンパイル。

$ cat INSTALL
WeeChat Installation instructions
=================================

You can build WeeChat with cmake (recommended way) or autotools.


With cmake
----------

------------------------------------------------------------------
mkdir build
cd build
cmake .. -DPREFIX=/where/you/want/install -DCMAKE_BUILD_TYPE=Debug
make
make install     (as root for installation in system directories)
------------------------------------------------------------------


With autotools
--------------

----------------------------------------------------------------------
./autogen.sh     (for cloned git repository only, not .tar.XX package)
./configure --prefix=/where/you/want/install
make
make install     (as root for installation in system directories)
----------------------------------------------------------------------


If you want to report bugs/crashes to developers, please:

- compile with debug info (type "Debug" for cmake build, default for autotools),
- enable core files (for bash shell, add "ulimit -c unlimited" to your ~/.bashrc).


See AUTHORS for support, feel free to contact us for any problem.

マニュアルにしたがってコンパイル作業を行う。まずはcmake。

$ mkdir build
$ cd build
$ cmake .. -DPREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include files HAVE_ARPA_INET_H
-- Looking for include files HAVE_ARPA_INET_H - found
-- Looking for include files HAVE_LIMITS_H
-- Looking for include files HAVE_LIMITS_H - found
-- Looking for include files HAVE_LOCALE_H
-- Looking for include files HAVE_LOCALE_H - found
-- Looking for include files HAVE_NETDB_H
-- Looking for include files HAVE_NETDB_H - found
-- Looking for include files HAVE_NETINET_IN_H
-- Looking for include files HAVE_NETINET_IN_H - found
-- Looking for include files HAVE_STDLIB_H
-- Looking for include files HAVE_STDLIB_H - found
-- Looking for include files HAVE_STRING_H
-- Looking for include files HAVE_STRING_H - found
-- Looking for include files HAVE_SYS_SOCKET_H
-- Looking for include files HAVE_SYS_SOCKET_H - found
-- Looking for include files HAVE_SYS_TIME_H
-- Looking for include files HAVE_SYS_TIME_H - found
-- Looking for include files HAVE_SYS_TYPES_H
-- Looking for include files HAVE_SYS_TYPES_H - found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_PWD_H
-- Looking for include files HAVE_PWD_H - found
-- Looking for include files HAVE_ERRNO_H
-- Looking for include files HAVE_ERRNO_H - found
-- Looking for include files HAVE_WCHAR_H
-- Looking for include files HAVE_WCHAR_H - found
-- Looking for include files HAVE_LANGINFO_CODESET
-- Looking for include files HAVE_LANGINFO_CODESET - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for getsockname
-- Looking for getsockname - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for inet_ntoa
-- Looking for inet_ntoa - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mkdir
-- Looking for mkdir - found
-- Looking for select
-- Looking for select - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for socket
-- Looking for socket - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strpbrk
-- Looking for strpbrk - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for include files HAVE_REGEX_H
-- Looking for include files HAVE_REGEX_H - found
-- Looking for regexec
-- Looking for regexec - found
-- Looking for eat_newline_glitch
-- Looking for eat_newline_glitch - found
-- Looking for include files HAVE_LIBINTL_H
-- Looking for include files HAVE_LIBINTL_H - found
-- Looking for dgettext
-- Looking for dgettext - found
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Performing Test ICONV_2ARG_IS_CONST
-- Performing Test ICONV_2ARG_IS_CONST - Failed
-- Looking for include files HAVE_SYS_FILE_H
-- Looking for include files HAVE_SYS_FILE_H - found
-- Looking for flock
-- Looking for flock - found
-- Looking for backtrace
-- Looking for backtrace - found
-- Found Tclsh: /usr/bin/tclsh
-- Looking for include files NCURSESW_HEADERS
-- Looking for include files NCURSESW_HEADERS - found
-- Configuring done
-- Generating done
-- Build files have been written to: /***********/weechat-0.3.6/build

次にmakeする。以下のようなメッセージが流れる。この中でpythonプラグインがサポートされていないことがわかる。

$ make
Scanning dependencies of target weechat_core
[  1%] Building C object src/core/CMakeFiles/weechat_core.dir/weechat.o
[  2%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-backtrace.o
[  3%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-command.o
[  4%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-completion.o
[  5%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-config.o
[  5%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-config-file.o
[  6%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-debug.o
[  7%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hashtable.o
[  8%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hdata.o
[  9%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hook.o
[  9%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-infolist.o
[ 10%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-input.o
[ 11%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-list.o
[ 12%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-log.o
[ 13%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-network.o
[ 14%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-proxy.o
[ 14%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-string.o
[ 15%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-upgrade.o
[ 16%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-upgrade-file.o
[ 17%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-utf8.o
[ 18%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-util.o
Linking C static library libweechat_core.a
[ 18%] Built target weechat_core
Scanning dependencies of target weechat_plugins
[ 19%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin.o
[ 20%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin-api.o
[ 21%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin-config.o
Linking C static library libweechat_plugins.a
[ 21%] Built target weechat_plugins
Scanning dependencies of target alias
[ 21%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias.o
[ 22%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias-config.o
[ 23%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias-info.o
Linking C shared module alias.so
[ 23%] Built target alias
Scanning dependencies of target charset
[ 24%] Building C object src/plugins/charset/CMakeFiles/charset.dir/charset.o
Linking C shared module charset.so
[ 24%] Built target charset
Scanning dependencies of target fifo
[ 25%] Building C object src/plugins/fifo/CMakeFiles/fifo.dir/fifo.o
[ 25%] Building C object src/plugins/fifo/CMakeFiles/fifo.dir/fifo-info.o
Linking C shared module fifo.so
[ 25%] Built target fifo
Scanning dependencies of target irc
[ 26%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc.o
[ 27%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-bar-item.o
[ 28%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-buffer.o
[ 29%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-channel.o
[ 30%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-color.o
[ 30%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-command.o
[ 31%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-completion.o
[ 32%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-config.o
[ 33%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-ctcp.o
[ 34%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-debug.o
[ 35%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-display.o
[ 35%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-ignore.o
[ 36%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-info.o
[ 37%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-input.o
[ 38%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-message.o
[ 39%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-mode.o
[ 40%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-msgbuffer.o
[ 40%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-nick.o
[ 41%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-notify.o
[ 42%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-protocol.o
[ 43%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-raw.o
[ 44%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-redirect.o
[ 44%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-sasl.o
[ 45%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-server.o
[ 46%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-upgrade.o
Linking C shared module irc.so
[ 46%] Built target irc
Scanning dependencies of target logger
[ 47%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger.o
[ 48%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-buffer.o
[ 49%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-config.o
[ 49%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-info.o
[ 50%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-tail.o
Linking C shared module logger.so
[ 50%] Built target logger
Scanning dependencies of target relay
[ 51%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay.o
[ 52%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-buffer.o
[ 52%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client.o
[ 53%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client-irc.o
[ 54%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client-weechat.o
[ 55%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-command.o
[ 56%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-completion.o
[ 57%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-config.o
[ 57%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-info.o
[ 58%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-raw.o
[ 59%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-server.o
[ 60%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-upgrade.o
Linking C shared module relay.so
[ 60%] Built target relay
Scanning dependencies of target rmodifier
[ 61%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier.o
[ 61%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-command.o
[ 62%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-completion.o
[ 63%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-config.o
[ 64%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-debug.o
[ 65%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-info.o
Linking C shared module rmodifier.so
[ 65%] Built target rmodifier
Scanning dependencies of target weechat_scripts
[ 66%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script.o
[ 67%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script-callback.o
[ 67%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script-api.o
Linking C static library libweechat_scripts.a
[ 67%] Built target weechat_scripts
Scanning dependencies of target perl
[ 68%] Building C object src/plugins/scripts/perl/CMakeFiles/perl.dir/weechat-perl.o
[ 69%] Building C object src/plugins/scripts/perl/CMakeFiles/perl.dir/weechat-perl-api.o
Linking C shared module perl.so
[ 69%] Built target perl
Scanning dependencies of target xfer
[ 70%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer.o
[ 71%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-buffer.o
[ 72%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-chat.o
[ 73%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-command.o
[ 74%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-completion.o
[ 74%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-config.o
[ 75%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-dcc.o
[ 76%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-file.o
[ 77%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-info.o
[ 78%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-network.o
[ 79%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-upgrade.o
Linking C shared module xfer.so
[ 79%] Built target xfer
Scanning dependencies of target weechat_gui_common
[ 80%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar.o
[ 80%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar-item.o
[ 81%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar-window.o
[ 82%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-buffer.o
[ 83%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-chat.o
[ 84%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-color.o
[ 85%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-completion.o
[ 85%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-cursor.o
[ 86%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-filter.o
[ 87%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-focus.o
[ 88%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-history.o
[ 89%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-hotlist.o
[ 89%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-input.o
[ 90%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-key.o
[ 91%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-layout.o
[ 92%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-line.o
[ 93%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-mouse.o
[ 94%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-nicklist.o
[ 94%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-window.o
Linking C static library libweechat_gui_common.a
[ 94%] Built target weechat_gui_common
Scanning dependencies of target weechat-curses
[ 95%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-bar-window.o
[ 95%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-chat.o
[ 96%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-color.o
[ 97%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-key.o
[ 98%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-main.o
[ 99%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-mouse.o
[100%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-term.o
[100%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-window.o
Linking C executable weechat-curses
[100%] Built target weechat-curses

オンラインマニュアルによれば、pythonをサポートするにはpython-devパッケージが必要。これがインストールされているか確認。未インストールということがわかる。

$ su -
# aptitude search python-dev
p   libboost-mpi-python-dev - Python interface to the Message Passing Interface (MPI) (default version)
p   libboost-python-dev     - Boost.Python Library development files (default version)
p   python-dev              - header files and a static library for Python (default)

python-devパッケージをインストール。

# aptitude install python-dev
The following NEW packages will be installed:
  libpython2.6{a} python-dev python2.6-dev{a}
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,375 kB of archives. After unpacking 13.9 MB will be used.
Do you want to continue? [Y/n/?] Y
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main libpython2.6 i386 2.6.6-8+b1 [985 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main python2.6-dev i386 2.6.6-8+b1 [4,389 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main python-dev all 2.6.6-3+squeeze6 [918 B]
Fetched 5,375 kB in 1s (4,421 kB/s)
Selecting previously deselected package libpython2.6.
(Reading database ... 45130 files and directories currently installed.)
Unpacking libpython2.6 (from .../libpython2.6_2.6.6-8+b1_i386.deb) ...
Selecting previously deselected package python2.6-dev.
Unpacking python2.6-dev (from .../python2.6-dev_2.6.6-8+b1_i386.deb) ...
Selecting previously deselected package python-dev.
Unpacking python-dev (from .../python-dev_2.6.6-3+squeeze6_all.deb) ...
Setting up libpython2.6 (2.6.6-8+b1) ...
Setting up python2.6-dev (2.6.6-8+b1) ...
Setting up python-dev (2.6.6-3+squeeze6) ...

再度cmakeからやり直す。makeのメッセージでpython関連のメッセージが増えていることが確認できる。

$ cmake .. -DPREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include files HAVE_ARPA_INET_H
-- Looking for include files HAVE_ARPA_INET_H - found
-- Looking for include files HAVE_LIMITS_H
-- Looking for include files HAVE_LIMITS_H - found
-- Looking for include files HAVE_LOCALE_H
-- Looking for include files HAVE_LOCALE_H - found
-- Looking for include files HAVE_NETDB_H
-- Looking for include files HAVE_NETDB_H - found
-- Looking for include files HAVE_NETINET_IN_H
-- Looking for include files HAVE_NETINET_IN_H - found
-- Looking for include files HAVE_STDLIB_H
-- Looking for include files HAVE_STDLIB_H - found
-- Looking for include files HAVE_STRING_H
-- Looking for include files HAVE_STRING_H - found
-- Looking for include files HAVE_SYS_SOCKET_H
-- Looking for include files HAVE_SYS_SOCKET_H - found
-- Looking for include files HAVE_SYS_TIME_H
-- Looking for include files HAVE_SYS_TIME_H - found
-- Looking for include files HAVE_SYS_TYPES_H
-- Looking for include files HAVE_SYS_TYPES_H - found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_PWD_H
-- Looking for include files HAVE_PWD_H - found
-- Looking for include files HAVE_ERRNO_H
-- Looking for include files HAVE_ERRNO_H - found
-- Looking for include files HAVE_WCHAR_H
-- Looking for include files HAVE_WCHAR_H - found
-- Looking for include files HAVE_LANGINFO_CODESET
-- Looking for include files HAVE_LANGINFO_CODESET - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for getsockname
-- Looking for getsockname - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for inet_ntoa
-- Looking for inet_ntoa - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mkdir
-- Looking for mkdir - found
-- Looking for select
-- Looking for select - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for socket
-- Looking for socket - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strpbrk
-- Looking for strpbrk - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for include files HAVE_REGEX_H
-- Looking for include files HAVE_REGEX_H - found
-- Looking for regexec
-- Looking for regexec - found
-- Looking for eat_newline_glitch
-- Looking for eat_newline_glitch - found
-- Looking for include files HAVE_LIBINTL_H
-- Looking for include files HAVE_LIBINTL_H - found
-- Looking for dgettext
-- Looking for dgettext - found
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Performing Test ICONV_2ARG_IS_CONST
-- Performing Test ICONV_2ARG_IS_CONST - Failed
-- Looking for include files HAVE_SYS_FILE_H
-- Looking for include files HAVE_SYS_FILE_H - found
-- Looking for flock
-- Looking for flock - found
-- Looking for backtrace
-- Looking for backtrace - found
-- Found Tclsh: /usr/bin/tclsh
-- Looking for include files NCURSESW_HEADERS
-- Looking for include files NCURSESW_HEADERS - found
-- Configuring done
-- Generating done
-- Build files have been written to: /***********/weechat-0.3.6/build
$ make
Scanning dependencies of target weechat_core
[  1%] Building C object src/core/CMakeFiles/weechat_core.dir/weechat.o
[  2%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-backtrace.o
[  3%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-command.o
[  3%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-completion.o
[  4%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-config.o
[  5%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-config-file.o
[  6%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-debug.o
[  7%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hashtable.o
[  7%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hdata.o
[  8%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-hook.o
[  9%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-infolist.o
[ 10%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-input.o
[ 11%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-list.o
[ 12%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-log.o
[ 12%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-network.o
[ 13%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-proxy.o
[ 14%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-string.o
[ 15%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-upgrade.o
[ 16%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-upgrade-file.o
[ 16%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-utf8.o
[ 17%] Building C object src/core/CMakeFiles/weechat_core.dir/wee-util.o
Linking C static library libweechat_core.a
[ 17%] Built target weechat_core
Scanning dependencies of target weechat_plugins
[ 17%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin.o
[ 18%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin-api.o
[ 19%] Building C object src/plugins/CMakeFiles/weechat_plugins.dir/plugin-config.o
Linking C static library libweechat_plugins.a
[ 19%] Built target weechat_plugins
Scanning dependencies of target alias
[ 19%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias.o
[ 20%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias-config.o
[ 21%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias-info.o
Linking C shared module alias.so
[ 21%] Built target alias
Scanning dependencies of target charset
[ 22%] Building C object src/plugins/charset/CMakeFiles/charset.dir/charset.o
Linking C shared module charset.so
[ 22%] Built target charset
Scanning dependencies of target fifo
[ 23%] Building C object src/plugins/fifo/CMakeFiles/fifo.dir/fifo.o
[ 23%] Building C object src/plugins/fifo/CMakeFiles/fifo.dir/fifo-info.o
Linking C shared module fifo.so
[ 23%] Built target fifo
Scanning dependencies of target irc
[ 24%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc.o
[ 25%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-bar-item.o
[ 26%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-buffer.o
[ 27%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-channel.o
[ 27%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-color.o
[ 28%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-command.o
[ 29%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-completion.o
[ 30%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-config.o
[ 31%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-ctcp.o
[ 32%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-debug.o
[ 32%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-display.o
[ 33%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-ignore.o
[ 34%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-info.o
[ 35%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-input.o
[ 36%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-message.o
[ 36%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-mode.o
[ 37%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-msgbuffer.o
[ 38%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-nick.o
[ 39%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-notify.o
[ 40%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-protocol.o
[ 40%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-raw.o
[ 41%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-redirect.o
[ 42%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-sasl.o
[ 43%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-server.o
[ 44%] Building C object src/plugins/irc/CMakeFiles/irc.dir/irc-upgrade.o
Linking C shared module irc.so
[ 44%] Built target irc
Scanning dependencies of target logger
[ 45%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger.o
[ 45%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-buffer.o
[ 46%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-config.o
[ 47%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-info.o
[ 48%] Building C object src/plugins/logger/CMakeFiles/logger.dir/logger-tail.o
Linking C shared module logger.so
[ 48%] Built target logger
Scanning dependencies of target relay
[ 49%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay.o
[ 50%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-buffer.o
[ 50%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client.o
[ 51%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client-irc.o
[ 52%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-client-weechat.o
[ 53%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-command.o
[ 54%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-completion.o
[ 55%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-config.o
[ 55%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-info.o
[ 56%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-raw.o
[ 57%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-server.o
[ 58%] Building C object src/plugins/relay/CMakeFiles/relay.dir/relay-upgrade.o
Linking C shared module relay.so
[ 58%] Built target relay
Scanning dependencies of target rmodifier
[ 59%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier.o
[ 59%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-command.o
[ 60%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-completion.o
[ 61%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-config.o
[ 62%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-debug.o
[ 63%] Building C object src/plugins/rmodifier/CMakeFiles/rmodifier.dir/rmodifier-info.o
Linking C shared module rmodifier.so
[ 63%] Built target rmodifier
Scanning dependencies of target weechat_scripts
[ 64%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script.o
[ 65%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script-callback.o
[ 66%] Building C object src/plugins/scripts/CMakeFiles/weechat_scripts.dir/script-api.o
Linking C static library libweechat_scripts.a
[ 66%] Built target weechat_scripts
Scanning dependencies of target perl
[ 67%] Building C object src/plugins/scripts/perl/CMakeFiles/perl.dir/weechat-perl.o
[ 67%] Building C object src/plugins/scripts/perl/CMakeFiles/perl.dir/weechat-perl-api.o
Linking C shared module perl.so
[ 67%] Built target perl
Scanning dependencies of target python
[ 68%] Building C object src/plugins/scripts/python/CMakeFiles/python.dir/weechat-python.o
[ 69%] Building C object src/plugins/scripts/python/CMakeFiles/python.dir/weechat-python-api.o
Linking C shared module python.so
[ 69%] Built target python
Scanning dependencies of target xfer
[ 69%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer.o
[ 70%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-buffer.o
[ 71%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-chat.o
[ 72%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-command.o
[ 73%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-completion.o
[ 73%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-config.o
[ 74%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-dcc.o
[ 75%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-file.o
[ 76%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-info.o
[ 77%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-network.o
[ 78%] Building C object src/plugins/xfer/CMakeFiles/xfer.dir/xfer-upgrade.o
Linking C shared module xfer.so
[ 78%] Built target xfer
Scanning dependencies of target weechat_gui_common
[ 79%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar.o
[ 80%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar-item.o
[ 81%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-bar-window.o
[ 81%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-buffer.o
[ 82%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-chat.o
[ 83%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-color.o
[ 84%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-completion.o
[ 85%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-cursor.o
[ 86%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-filter.o
[ 86%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-focus.o
[ 87%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-history.o
[ 88%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-hotlist.o
[ 89%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-input.o
[ 90%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-key.o
[ 90%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-layout.o
[ 91%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-line.o
[ 92%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-mouse.o
[ 93%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-nicklist.o
[ 94%] Building C object src/gui/CMakeFiles/weechat_gui_common.dir/gui-window.o
Linking C static library libweechat_gui_common.a
[ 94%] Built target weechat_gui_common
Scanning dependencies of target weechat-curses
[ 94%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-bar-window.o
[ 95%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-chat.o
[ 96%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-color.o
[ 97%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-key.o
[ 98%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-main.o
[ 99%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-mouse.o
[ 99%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-term.o
[100%] Building C object src/gui/curses/CMakeFiles/weechat-curses.dir/gui-curses-window.o
Linking C executable weechat-curses
[100%] Built target weechat-curses

rootになって、インストール作業を行う。

$ su
Password:
# make install
[ 17%] Built target weechat_core
[ 19%] Built target weechat_plugins
[ 21%] Built target alias
[ 22%] Built target charset
[ 23%] Built target fifo
[ 44%] Built target irc
[ 48%] Built target logger
[ 58%] Built target relay
[ 63%] Built target rmodifier
[ 66%] Built target weechat_scripts
[ 67%] Built target perl
[ 69%] Built target python
[ 78%] Built target xfer
[ 94%] Built target weechat_gui_common
[100%] Built target weechat-curses
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/weechat/../pkgconfig/weechat.pc
-- Up-to-date: /usr/local/include/weechat/weechat-plugin.h
-- Installing: /usr/local/lib/weechat/plugins/alias.so
-- Installing: /usr/local/lib/weechat/plugins/charset.so
-- Installing: /usr/local/lib/weechat/plugins/fifo.so
-- Installing: /usr/local/lib/weechat/plugins/irc.so
-- Installing: /usr/local/lib/weechat/plugins/logger.so
-- Installing: /usr/local/lib/weechat/plugins/relay.so
-- Installing: /usr/local/lib/weechat/plugins/rmodifier.so
-- Installing: /usr/local/lib/weechat/plugins/perl.so
-- Installing: /usr/local/lib/weechat/plugins/python.so
-- Installing: /usr/local/lib/weechat/plugins/xfer.so
-- Installing: /usr/local/bin/weechat-curses
-- Up-to-date: /usr/local/share/man/man1/weechat-curses.1

最初と同様に、weechatを起動、/pluginコマンドでロードされたプラグインを確認。pythonプラグインがロードされていることがわかる。

02:19:58 |   ___       __         ______________        _____
02:19:58 |   __ |     / /___________  ____/__  /_______ __  /_
02:19:58 |   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
02:19:58 |   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_
02:19:58 |   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/
02:19:58 | WeeChat 0.3.6 [compiled on Dec 31 2011 02:14:01]
02:19:58 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
02:19:58 | Plugins loaded: alias, charset, fifo, irc, logger, perl, python, relay, rmodifier, xfer
02:20:04 |
02:20:04 | Plugins loaded:
02:20:04 |   irc: IRC (Internet Relay Chat) plugin for WeeChat
02:20:04 |   rmodifier: Regex modifier plugin for WeeChat
02:20:04 |   fifo: Fifo plugin for WeeChat
02:20:04 |   python: Python plugin for WeeChat
02:20:04 |   relay: Network communication between WeeChat and remote application
02:20:04 |   perl: Perl plugin for WeeChat
02:20:04 |   alias: Alias plugin for WeeChat
02:20:04 |   xfer: Xfer (file transfer and direct chat) plugin for WeeChat
02:20:04 |   charset: Charset plugin for WeeChat
02:20:04 |   logger: Logger plugin for WeeChat

起動中のweechatでupgradeを行う。上のようにしてインストールされたweechatバイナリのパスは/usr/local/bin/weechat-curses。まずは設定ファイルのセーブ。

/save
02:22:09 | Options saved to weechat.conf
02:22:09 | Options saved to plugins.conf
02:22:09 | Options saved to irc.conf
02:22:09 | Options saved to rmodifier.conf
02:22:09 | Options saved to relay.conf
02:22:09 | Options saved to alias.conf
02:22:09 | Options saved to xfer.conf
02:22:09 | Options saved to charset.conf
02:22:09 | Options saved to logger.conf

upgradeコマンドのヘルプを確認。

/help upgrade
02:22:20 |
02:22:20 | [core]  /upgrade  [<path_to_binary>]
02:22:20 |
02:22:20 | upgrade WeeChat without disconnecting from servers
02:22:20 |
02:22:20 | path_to_binary: path to WeeChat binary (default is current binary)
02:22:20 |
02:22:20 | This command upgrades and reloads a running WeeChat session. The new WeeChat binary must have been compiled or installed with a package manager before running this command.
02:22:20 |
02:22:20 | Note: SSL connections are lost during upgrade, because reload of SSL sessions is currently not possible with GnuTLS. There is automatic reconnection after upgrade.
02:22:20 |
02:22:20 | Upgrade process has 4 steps:
02:22:20 |   1. save session into files for core and plugins (buffers, history, ..)
02:22:20 |   2. unload all plugins (configuration files (*.conf) are written on disk)
02:22:20 |   3. save WeeChat configuration (weechat.conf)
02:22:20 |   4. execute new WeeChat binary and reload session.

実際にアップグレード。pythonプラグインがロードされていることがわかる。

/upgrade /usr/local/bin/weechat-curses
02:24:07 weechat | Upgrading WeeChat with binary file: "/usr/local/bin/weechat-curses"...
02:25:37 weechat |   ___       __         ______________        _____
02:25:37 weechat |   __ |     / /___________  ____/__  /_______ __  /_
02:25:37 weechat |   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
02:25:37 weechat |   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_
02:25:37 weechat |   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/
02:25:37 weechat | WeeChat 0.3.6 [compiled on Dec 31 2011 02:14:01]
02:25:37 weechat | Upgraded 1 time, first start: Mon, 12 Dec 2011 22:44:29
02:25:37 weechat | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
02:25:41 weechat | Plugins loaded: alias, charset, fifo, irc, logger, perl, python, relay, rmodifier, xfer
02:25:41 weechat | Upgrade done (45.67 seconds)

リファレンス

  1. WeeChat, the extensible chat client
  2. WeeChat :: download
  3. WeeChat User’s Guide
  4. WeeChat :: scripts
  5. WeeChat :: scripts
  6. WeeChat :: scripts

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2010-03-18T02:32:05+09:00
  2. Modified: 2010-03-18T02:32:05+09:00
  3. Generated: 2017-02-06T23:09:17+09:00