kensanata / bitlbee-mastodon

A Mastodon plugin for Bitlbee
https://alexschroeder.ch/software/Bitlbee_Mastodon
GNU General Public License v2.0
30 stars 7 forks source link

Building on Windows #13

Closed kensanata closed 6 years ago

kensanata commented 6 years ago

Installing Bitlbee on Windows with Cygwin... I had to install the development packages of libglib2, gnutls and libgcrpyt using Cygwin:

$ ./configure --msn=0 --jabber=0 --oscar=0 --twitter=0
BitlBee configure
Architecture: CYGWIN_NT-6.1

Configuration done:
  Debugging disabled.
  AddressSanitizer (ASAN) disabled.
  Building non-PIE executable
  Binary stripping disabled.
  Off-the-Record (OTR) Messaging disabled.
  systemd disabled.
  Using event handler: glib
  Using SSL library: gnutls
  Building without IM-protocol support. We wish you a lot of fun...

I like how there is an extra comment if you disable all the protocols. All I want is the Mastodon plugin!

make
make install
make install-dev

No problems, so far.

For the Mastodon plugin, some more stuff was required. I already had autoconf installed but libtool and automake was missing. Notice how I had to set the environment variable. PKG_CONFIG_PATH. When I made install-dev above, I saw the output install -p -m 0644 bitlbee.pc /usr/local/lib/pkgconfig so I assumed everything had been installed correctly. I don't know why this is considered to be a non-standard location but here we are.

./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure

Sadly, linking still fails.

libtool:   error: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified

The solution to that is to change a line in src/Makefile. If you omit -no-undefined it won't compile. If you omit -lbitlbee it won't link. But I'm not actually sure what the name of the library ought to be.

LDFLAGS = -no-undefined -lbitlbee

If you proceed anyway, everything appears to work:

make
make install
libtool --finish /usr/local/lib/bitlbee/

And you can start it:

mkdir /usr/local/etc/bitlbee
touch /usr/local/etc/bitlbee/bitlbee.conf
mkdir /var/lib/bitlbee
/usr/local/sbin/bitlbee -nD

And connect using your favorite IRC client!

Sadly, the plugin isn't loaded:

12:15 <root> Plugin                          Version
12:15 <root>  

And thus:

12:15 <kensanata> account add mastodon kensanata@octodon.social
12:15 <root> Unknown protocol

Plugin is in the right place:

$ ls /usr/local/lib/bitlbee/
mastodon.a  mastodon.la*
$ grep plugin src/Makefile
libdir = $(plugindir)
plugindir = /usr/local/lib/bitlbee/
kensanata commented 6 years ago

I managed to build it with a few tricks.