1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Check for libmesode, fall back to libstrophe

This commit is contained in:
James Booth 2015-09-21 21:40:04 +01:00
parent 14edbe1770
commit 2b88e2f1bf
17 changed files with 130 additions and 72 deletions

View File

@ -4,15 +4,15 @@ install:
- uname -a
- sudo apt-get update
- sudo apt-get -y install libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr2-dev libgpgme11-dev uuid-dev expect-dev tcl-dev
- git clone git://github.com/strophe/libstrophe.git
- cd libstrophe
- git clone git@github.com:boothj5/libmesode.git
- cd libmesode
- mkdir m4
- ./bootstrap.sh
- ./configure --prefix=/usr
- make
- sudo make install
- cd ..
- rm -rf libstrophe
- rm -rf libmesode
- wget https://cmocka.org/files/1.0/cmocka-1.0.0.tar.xz
- tar -xvf cmocka-1.0.0.tar.xz
- cd cmocka-1.0.0

View File

@ -47,62 +47,17 @@ AC_ARG_ENABLE([otr],
[AS_HELP_STRING([--enable-otr], [enable otr encryption])])
AC_ARG_ENABLE([pgp],
[AS_HELP_STRING([--enable-pgp], [enable pgp])])
AC_ARG_WITH([libxml2],
[AS_HELP_STRING([--with-libxml2], [link with libxml2 instead of expat])])
AC_ARG_WITH([xscreensaver],
[AS_HELP_STRING([--with-xscreensaver], [use libXScrnSaver to determine idle time])])
AC_ARG_WITH([themes],
[AS_HELP_STRING([--with-themes[[=PATH]]], [install themes (default yes)])])
# Use the CFLAGS and libs provided by libstrophe.pc if libstrophe has pkg-config support.
PKG_CHECK_MODULES([libstrophe], [libstrophe], [LIBS="$libstrophe_LIBS $LIBS"],
[
if test "x$PLATFORM" != xfreebsd; then
AC_CHECK_LIB([resolv], [res_query], [],
[AC_CHECK_LIB([resolv], [__res_query], [],
[AC_MSG_ERROR([libresolv not found; libresolv required for profanity])])])
else
AC_MSG_NOTICE([skipping libresolv checks for freebsd])
fi
### Check for libstrophe dependencies
### Select first existing xml library among expat and libxml2
PARSER=""
PARSER_LIBS=""
PARSER_CFLAGS=""
AS_IF([test "x$with_libxml2" != xyes],
[PKG_CHECK_MODULES([expat], [expat],
[PARSER_CFLAGS="$expat_CFLAGS"; PARSER_LIBS="$expat_LIBS"; PARSER="expat"],
[AC_CHECK_LIB([expat], [XML_ParserCreate],
[PARSER_LIBS="-lexpat"; PARSER="expat"],
AS_IF([test "x$with_libxml2" = xno],
[AC_MSG_ERROR([expat is required but does not exist])]))])
])
AS_IF([test "x$PARSER" = x -a "x$with_libxml2" != xno],
[PKG_CHECK_MODULES([libxml2], [libxml-2.0],
[PARSER_CFLAGS="$libxml2_CFLAGS"; PARSER_LIBS="$libxml2_LIBS"; PARSER="libxml2"],
AS_IF([test "x$with_libxml2" = xyes],
[AC_MSG_ERROR([libxml2 is required but does not exist])]))
])
AS_IF([test "x$PARSER" = x],
[AC_MSG_ERROR([either expat or libxml2 is required for profanity])])
AM_CPPFLAGS="$AM_CPPFLAGS $PARSER_CFLAGS"
LIBS="$PARSER_LIBS $LIBS"
PKG_CHECK_MODULES([openssl], [openssl], [],
[AC_CHECK_HEADER(openssl/ssl.h, [openssl_LIBS="-lssl -lcrypto"], [AC_MSG_ERROR([openssl not found; openssl required for profanity])])])
AM_CPPFLAGS="$AM_CPPFLAGS $openssl_CFLAGS"
LIBS="$openssl_LIBS $LIBS"
CFLAGS_RESTORE="$CFLAGS"
CFLAGS="$CFLAGS $AM_CPPFLAGS"
AC_CHECK_LIB([strophe], [xmpp_ctx_new], [LIBS="-lstrophe $LIBS"; listrophe_CFLAGS=""],
[AC_MSG_ERROR([libstrophe linked with $PARSER is required for profanity])])
CFLAGS="$CFLAGS_RESTORE"
])
CFLAGS="$CFLAGS $libstrophe_CFLAGS"
### Check for libmesode, fall back to libstrophe
PKG_CHECK_MODULES([libmesode], [libmesode],
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
[PKG_CHECK_MODULES([libstrophe], [libstrophe],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[AC_MSG_ERROR([Neither libmesode or libstrophe found, either is required for profanity])])])
### Check for ncurses library
PKG_CHECK_MODULES([ncursesw], [ncursesw],

View File

@ -77,13 +77,13 @@ cygwin_prepare()
fi
}
install_lib_strophe()
install_lib_mesode()
{
echo
echo Profanity installer... installing libstrophe
echo Profanity installer... installing libmesode
echo
git clone git://github.com/strophe/libstrophe.git
cd libstrophe
git clone git@github.com:boothj5/libmesode.git
cd libmesode
./bootstrap.sh
./configure --prefix=$1
make
@ -105,13 +105,13 @@ install_profanity()
sudo make install
}
cyg_install_lib_strophe()
cyg_install_lib_mesode()
{
echo
echo Profanity installer... installing libstrophe
echo Profanity installer... installing libmesode
echo
git clone git://github.com/strophe/libstrophe.git
cd libstrophe
git clone git@github.com:boothj5/libmesode.git
cd libmesode
./bootstrap.sh
./bootstrap.sh # second call seems to fix problem on cygwin
./configure --prefix=/usr
@ -140,8 +140,8 @@ cleanup()
echo Profanity installer... cleaning up
echo
echo Removing libstrophe repository...
rm -rf libstrophe
echo Removing libmesode repository...
rm -rf libmesode
echo
echo Profanity installer... complete!
@ -183,25 +183,25 @@ unknown) echo The install script will not work on this OS.
exit
;;
fedora) fedora_prepare
install_lib_strophe /usr
install_lib_mesode /usr
install_profanity
;;
debian) debian_prepare
install_lib_strophe /usr
install_lib_mesode /usr
install_profanity
;;
opensuse) opensuse_prepare
install_lib_strophe /usr/local
install_lib_mesode /usr/local
sudo /sbin/ldconfig
install_profanity
;;
centos) centos_prepare
install_lib_strophe /usr
install_lib_mesode /usr
sudo ldconfig
install_profanity
;;
cygwin) cygwin_prepare
cyg_install_lib_strophe
cyg_install_lib_mesode
cyg_install_profanity
;;
esac

View File

@ -98,6 +98,13 @@ main(int argc, char **argv)
g_print("Build information:\n");
#ifdef HAVE_LIBMESODE
g_print("XMPP library: libmesode\n");
#endif
#ifdef HAVE_LIBSTROPHE
g_print("XMPP library: libstrophe\n");
#endif
gboolean notify_enabled = FALSE;
#ifdef HAVE_OSXNOTIFY

View File

@ -32,12 +32,20 @@
*
*/
#include "config.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"
@ -468,4 +476,4 @@ _send_bookmarks(void)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
}

View File

@ -43,7 +43,13 @@
#include <glib.h>
#include <glib/gstdio.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"
@ -683,4 +689,4 @@ _save_cache(void)
g_file_set_contents(cache_loc, g_cache_data, g_data_size, NULL);
g_chmod(cache_loc, S_IRUSR | S_IWUSR);
g_free(g_cache_data);
}
}

View File

@ -35,7 +35,14 @@
#ifndef XMPP_CAPABILITIES_H
#define XMPP_CAPABILITIES_H
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "xmpp/xmpp.h"

View File

@ -32,11 +32,18 @@
*
*/
#include "config.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "chat_session.h"
#include "common.h"

View File

@ -35,7 +35,14 @@
#ifndef XMPP_CONNECTION_H
#define XMPP_CONNECTION_H
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "resource.h"

View File

@ -32,10 +32,18 @@
*
*/
#include "config.h"
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include <glib.h>
#include "log.h"
@ -714,4 +722,4 @@ form_reset_autocompleters(DataForm *form)
autocomplete_reset(field->value_ac);
curr_field = g_slist_next(curr_field);
}
}
}

View File

@ -42,7 +42,13 @@
#include <string.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "log.h"
#include "muc.h"

View File

@ -32,10 +32,17 @@
*
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "chat_session.h"
#include "config/preferences.h"

View File

@ -32,6 +32,8 @@
*
*/
#include "config.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@ -39,6 +41,13 @@
#include <glib.h>
#include <glib/gprintf.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "config/preferences.h"
#include "log.h"

View File

@ -32,12 +32,20 @@
*
*/
#include "config.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "log.h"
#include "profanity.h"

View File

@ -32,11 +32,19 @@
*
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"

View File

@ -35,7 +35,15 @@
#ifndef XMPP_STANZA_H
#define XMPP_STANZA_H
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include <xmpp/xmpp.h>
#define STANZA_NAME_ACTIVE "active"

View File

@ -35,7 +35,14 @@
#ifndef XMPP_XMPP_H
#define XMPP_XMPP_H
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "config/accounts.h"
#include "contact.h"