Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Pidgin <2.11 #16

Closed
giordy opened this issue Oct 13, 2016 · 9 comments
Closed

Incompatible with Pidgin <2.11 #16

giordy opened this issue Oct 13, 2016 · 9 comments

Comments

@giordy
Copy link

giordy commented Oct 13, 2016

Hello,

I proceeded as follows:

  1. installed the packages: libpurple-dev libjson-glib-dev libglib2.0-dev libhttp-parser-dev gcc
  2. the compilation was failing and I removed -Werror from Makefile.common
  3. make && sudo make install
  4. started Pidgin but the Matrix protocol is not listed

I checked and libmatrix.so was created and correctly placed in /usr/lib/purple-2

@richvdh
Copy link
Member

richvdh commented Oct 13, 2016

@penguin42: presumably this is the problem with ubuntu's old libpurple as per https://bugs.launchpad.net/bugs/1620683?

@giordy
Copy link
Author

giordy commented Oct 14, 2016

Ubuntu 16.04 is using Pidgin 2.10.12.

This is the changelog of Pidgin 2.11: https://bitbucket.org/pidgin/www/src/tip/htdocs/ChangeLog?fileviewer=file-view-default

Unfortunately I have almost 0 experience with C/C++ and I don't know if the changes between 2.10.12 and 2.11 could be the reason of the malfunctioning plugin.

What I can tell you is this:

  • I compiled the plugin in Fedora 24 (the distro I'm using) that features pidgin 2.11 and I faced no compilation error and the plugin works correctly
  • When I helped a friend compiling the plugin in Ubuntu 16.04, compilation failed (I had to remove -Werror) and pidgin failed to load the plugin.

@richvdh
Copy link
Member

richvdh commented Oct 14, 2016

Can you confirm the error you saw when compiling on 16.04?

(also if you run pidgin with -d it will give you a debug log which may give hints as to why it won't load; but I suspect that removing -Werror has done little except let you build a broken plugin)

@giordy
Copy link
Author

giordy commented Oct 14, 2016

After cloning the repository and running make this is the error that I get:

$ make
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -Werror -DPURPLE_PLUGINS  -MMD  -c -o libmatrix.o libmatrix.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -Werror -DPURPLE_PLUGINS  -MMD  -c -o matrix-api.o matrix-api.c
matrix-api.c: In function ‘matrix_api_start_full’:
matrix-api.c:502:19: error: implicit declaration of function ‘purple_util_fetch_url_request_data_len_with_account’ [-Werror=implicit-function-declaration]
     purple_data = purple_util_fetch_url_request_data_len_with_account(
                   ^
matrix-api.c:502:17: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
     purple_data = purple_util_fetch_url_request_data_len_with_account(
                 ^
cc1: all warnings being treated as errors
Makefile.common:35: set di istruzioni per l'obiettivo "matrix-api.o" non riuscito
make: *** [matrix-api.o] Errore 1

The version of GCC is: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)

If I remove -Werror this is the output:

$ make
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-api.o matrix-api.c
matrix-api.c: In function ‘matrix_api_start_full’:
matrix-api.c:502:19: warning: implicit declaration of function ‘purple_util_fetch_url_request_data_len_with_account’ [-Wimplicit-function-declaration]
     purple_data = purple_util_fetch_url_request_data_len_with_account(
                   ^
matrix-api.c:502:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     purple_data = purple_util_fetch_url_request_data_len_with_account(
                 ^
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-connection.o matrix-connection.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-event.o matrix-event.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-json.o matrix-json.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-room.o matrix-room.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-roommembers.o matrix-roommembers.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-statetable.o matrix-statetable.c
gcc -pthread -I/usr/include/libpurple -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIC -DPIC -Wall -g -O0 -DPURPLE_PLUGINS  -MMD  -c -o matrix-sync.o matrix-sync.c
gcc   -shared libmatrix.o matrix-api.o matrix-connection.o matrix-event.o matrix-json.o matrix-room.o matrix-roommembers.o matrix-statetable.o matrix-sync.o  -lpurple -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lhttp_parser -o libmatrix.so

Then sudo make install:

$ sudo make install 
[sudo] password di novadart: 
mkdir -p /usr/lib/purple-2
install -m 664 libmatrix.so /usr/lib/purple-2
for i in 16 22 48; do \
    mkdir -p /usr/share/pixmaps/pidgin/protocols/$i; \
    install -m 664 matrix-${i}px.png /usr/share/pixmaps/pidgin/protocols/$i/matrix.png; \
done

The I ran pidgin with the -d option and found these lines in the output:

(12:01:58) plugins: probing /usr/lib/purple-2/libmatrix.so
(12:01:58) plugins: /usr/lib/purple-2/libmatrix.so is not loadable: undefined symbol: purple_util_fetch_
url_request_data_len_with_account
(12:01:58) matrixprpl: starting up
(12:01:58) plugins: probing /usr/lib/purple-2/newline.so
(12:01:58) plugins: probing /usr/lib/purple-2/buddynote.so
(12:01:58) plugins: probing /usr/lib/purple-2/ssl-nss.so
(12:01:58) util: Reading file xmpp-caps.xml from directory /home/novadart/.purple
(12:01:58) util: File /home/novadart/.purple/xmpp-caps.xml does not exist (this is not necessarily an er
ror)
(12:01:58) jabber: creating hash tables for data objects
(12:01:58) gg: Loading Gadu-Gadu protocol plugin with libgadu 1.12.1...
(12:01:58) matrixprpl: shutting down

Let me know if you needed further info.

@richvdh richvdh changed the title The plugin is not loaded in Ubuntu 16.04 Incompatible with Pidgin <2.11 Oct 14, 2016
@richvdh
Copy link
Member

richvdh commented Oct 14, 2016

Right; so it is indeed the incompatibility with pidgin 2.10. Removing -Werror won't help fix the problem.

We'll either need to persuade Ubuntu to update their version of Pidgin, or work around it.

Or you could install pidgin 2.11 from source.

@giordy
Copy link
Author

giordy commented Oct 14, 2016

Ok, makes sense.
Thanks for the feedback :)

@penguin42
Copy link
Contributor

Hi @giordy,
I've just created a pull request for a workaround, see
e32948f

that seems to work on my ubuntu 16.10 box and I think it should work on 16.04 as well. Sorry but it wont let you upload images though.

@giordy
Copy link
Author

giordy commented Oct 16, 2016

@penguin42 thanks a lot, I confirm that it works on Ubuntu 16.04 :)

@richvdh
Copy link
Member

richvdh commented Oct 16, 2016

resolved via #17

@richvdh richvdh closed this as completed Oct 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants