Compiling and Installing Weechat on SmartOS

Sun 15 July 2012 by Mike Zeller

Weechat on SmartOS (Illumos)

irc handle: papertigers
server: freenode
channels: #illumos #smartos #dtrace #iphonedev #ritlug #plex

weechat running in a smartos zone


Weechat can be compiled on recent builds of smartos with recent versions of pkgsrc simply by following the instructions on github.

Recently I have been trying to convert all of my servers to illumos based OS's. I have been using an Ubuntu server up until now as a "jump" box that is publicly facing on the internet. The box provided a central place to ssh as well as hosting my irc client. My preferred irc client is weechat (sorry irssi users).

The first thing I tried was pkgin in weechat. Unfortunately at the time of writing this weechat is not found in the pkgin repo. The next step was to compile weechat from source myself. It took me a few tries to work out the right CFLAGS and LDFLAGS, so hopefully this blog post can save you some time. The compilation also required editing one of the source files in weechat. Thanks to the illumos community for helping me figure out which header file was missing.

I will start out by listing the required pkg's that need to be installed via pkgin.

pkgin in gcc-compiler gmake gnutls ncurses

Next we need to download the source and patch the source. You can also download my patch and apply it.

tar xf weechat-0.3.8.tar.gz  
cd weechat-0.3.8  
vim src/gui/curses/gui-curses-window.c

Inside gui-curses-window.c you need to add a include statement. Simply add #include <termios.h> Your other option is to apply this patch. To apply the patch, place weechat.patch in ./weechat-0.3.8/ and run patch -p1 < weechat.patch.

Now that you have weechat patched and the necessary packages insalled its time to compile and make weechat :). Just follow the steps below (NOTE you may need a -m64 depending on your environment):

CFLAGS="-I/opt/local/include/ncurses -I/opt/local/include/gnutls" LDFLAGS="-L/opt/local/lib -lncurses -lnsl -lsocket -lgnutls" ./configure --prefix=/opt/local --disable-shared     
make install

And thats it! You now have a working weechat. If you have never used weechat before you can follow this quickstart guide.


If you plan on using SSL to connect to your irc server such as freenode you are going to need this file that doesnt seem to be on SmartOS. I was able to pull it off of my ubuntu server. Place that file here /opt/local/etc/openssl/certs/ca-certificates.crt.