Failed to install Weechat on Uberspace 7

I prefer to use IRC over SSH. Always connected, detachable in a tmux session. It is way easier to use than setting up a dedicated bouncer such as ZNC and connect your client to. I’ve been a WeeChat user since 0.4.3 and still love it! FlashCode does a great job and built one of the feature richest clients out there. I wanted to use it on the new Uberspace 7 but see yourself…

Using linuxbrew

I tried to use the lazy way first. Linuxbrew1 is a package manager which is able to install packages in user space. Altough very slow, I gave it a try. Upon installation it already failed on me. :(

[koell@olbers ~]$ brew
Traceback (most recent call last):
        17: from /home/koell/.linuxbrew/Library/Homebrew/brew.rb:27:in `<main>'
        16: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        15: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        14: from /home/koell/.linuxbrew/Library/Homebrew/global.rb:106:in `<top (required)>'
        13: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        12: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        11: from /home/koell/.linuxbrew/Library/Homebrew/tap.rb:2:in `<top (required)>'
        10: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         9: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         8: from /home/koell/.linuxbrew/Library/Homebrew/readall.rb:1:in `<top (required)>'
         7: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         6: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         5: from /home/koell/.linuxbrew/Library/Homebrew/formula.rb:1:in `<top (required)>'
         4: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         3: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
         2: from /home/koell/.linuxbrew/Library/Homebrew/cache_store.rb:1:in `<top (required)>'
         1: from /opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- dbm (LoadError)

It seems to be written in ruby. So I searched the web for the error but it didn’t come up with anything useful. On a first attempt I did a gem install dbm and got it. But the initial success shouldn’t be here to stay. After nearly waiting half a decade ’till it came up with the next problem:

[koell@olbers ~]$ brew install weechat --with-perl --with-python@2

  ==> Downloading https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
  Already downloaded: /home/koell/.cache/Homebrew/python@2-2.7.15.tar.xz
  ==> ./configure --prefix=/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1 --enable-ipv6 --datarootdir=/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/s
  ==> make
  ==> make install PYTHONAPPSDIR=/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1
  Last 15 lines from /home/koell/.cache/Homebrew/Logs/python@2/03.make:
  /usr/bin/install -c -m 644 ./Modules/xxmodule.c \
                   /home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7/distutils/tests ; \
      fi
  PYTHONPATH=/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7  LD_LIBRARY_PATH=/tmp/python@2-20180705-782-1tpp5wx/Python-2.7.15 \
            ./python -E -Wi -tt /home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7/compileall.py \
            -d /home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7 -f \
            -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
            /home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7
  Traceback (most recent call last):
  File "/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7/compileall.py", line 16, in <module>
  import struct
  File "/home/koell/.linuxbrew/Cellar/python@2/2.7.15_1/lib/python2.7/struct.py", line 1, in <module>
  from _struct import *
  ImportError: No module named _struct
  make: *** [libinstall] Error 1

If I omit Python 2 support, brew still wants to install it. The same happens with Perl and the --ignore-dependencies flag. No matter what I did, it failed. I’ve no clue why, but I wish linuxbrew would be that smart to know about dependencies already satisfied by the system itself it is running on. I didn’t mess with manually symlinking them myself. As far as I read it is anti pattern to do so.

Damn it!

Compile from source.

I got it working but without Perl support, which is useless to me. Many weechat scripts depend on Perl. I did a yum list installed and grep’ed for the ExtUtils::Embed package, a required utility to embed Perl in C/C++ applications. Without success.

I got sick to run after the never ending dependency tree and gave up on it. Trying to install missing dependencies in user space sucks, they’re not meant to be installed by the user and get outdated very fast. It won’t make it better at all.

Irssi to the rescue

I ended up just using the preinstalled irssi.

/network add -autosendcmd "/msg NickServ identify password; wait 2000" freenode
/server add -network freenode -auto chat.freenode.net
/channel add -auto #emacs freenode
/channel add -auto #org-mode freenode
/connect freenode

/script load hilight.pl
/ignore * join parts quits
/set autolog on
/hilight nick

/window new split
/window name hilight
/window size 6
/layout save

/save

Footnotes:

1

a fork of homebrew for Mac OS X