-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Porting code from liboauth - thanks to http://liboauth.sf.net/
First tests using real Twitter API Signed-off-by: Daniele Ricci <[email protected]>
- Loading branch information
1 parent
73d1a6a
commit 11a1880
Showing
16 changed files
with
1,675 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
AC_INIT([MicroTwitter], [0.1], [[email protected]], [microtwitter]) | ||
AC_INIT([Micromoko], [0.1], [[email protected]], [micromoko]) | ||
AC_CONFIG_SRCDIR(Makefile.am) | ||
AC_CONFIG_HEADERS(config.h) | ||
AC_CONFIG_MACRO_DIR([m4]) | ||
|
@@ -16,7 +16,8 @@ AM_GNU_GETTEXT_VERSION([0.12.1]) | |
dnl Dependencies | ||
ELEMENTARY_REQUIRED=0.0.0 | ||
GLIB_REQUIRED=2.18.0 | ||
MOKOSUITE_REQUIRED=$PACKAGE_VERSION | ||
MOKOSUITE_REQUIRED=1.0.99 | ||
LIBSOUP_REQUIRED=2.30 | ||
|
||
PKG_CHECK_MODULES(GLIB, | ||
glib-2.0 >= $GLIB_REQUIRED | ||
|
@@ -32,6 +33,10 @@ PKG_CHECK_MODULES(MOKOSUITE, | |
mokosuite-ui >= $MOKOSUITE_REQUIRED | ||
) | ||
|
||
PKG_CHECK_MODULES(SOUP, | ||
libsoup-2.4 >= $LIBSOUP_REQUIRED | ||
) | ||
|
||
AC_ARG_ENABLE(debug, | ||
AC_HELP_STRING([--enable-debug], [Enable debug build (default: disabled)]), | ||
enable_debug=$enableval, | ||
|
@@ -43,12 +48,55 @@ fi | |
|
||
AC_SUBST(VERSION) | ||
|
||
AH_TEMPLATE([USE_NSS], [Define to use NSS instead of OpenSSL]) | ||
|
||
AC_ARG_ENABLE(nss, AC_HELP_STRING([--enable-nss],[use NSS instead of OpenSSL])) | ||
|
||
dnl ** crypto/hash lib (OpenSSL or NSS) | ||
AS_IF([test "${enable_nss}" == "yes"], [ | ||
PKG_CHECK_MODULES(NSS, nss, [ AC_DEFINE(USE_NSS, 1) USE_NSS=1 PC_REQ="$PC_REQ nss" ]) | ||
HASH_LIBS=${NSS_LIBS} | ||
HASH_CFLAGS=${NSS_CFLAGS} | ||
report_hash="NSS" | ||
], [ | ||
AC_CHECK_HEADERS(openssl/hmac.h) | ||
if test -z "${HASH_LIBS}"; then | ||
HASH_LIBS="-lcrypto" | ||
fi | ||
if test -z "${HASH_CFLAGS}"; then | ||
HASH_CFLAGS="" | ||
fi | ||
report_hash="OpenSSL" | ||
PC_LIB="$PC_LIB -lcrypto" | ||
PC_REQ="$PC_REQ libcrypto" | ||
AC_MSG_NOTICE([ | ||
NOTE: OpenSSL is not compatible with GPL applications. | ||
Even if only linked with GPL code you are not allowed to distibute your app. | ||
However liboauth provides an exeption (to the GPL) to circumvent this issue | ||
(see README, src/hash.c). Nevertheless, double-check your licensing. | ||
liboauth itself is licensed under MIT license and comatible with the GPL. | ||
Either way, you are probably better off using NSS (configure --enable-nss); | ||
future versions of liboauth will default to the Mozilla NSS. | ||
see http://people.gnome.org/~markmc/openssl-and-the-gpl.html | ||
]) | ||
]) | ||
|
||
AC_SUBST(HASH_LIBS) | ||
AC_SUBST(HASH_CFLAGS) | ||
|
||
|
||
EFL_WITH_BIN([edje], [edje-cc], [edje_cc]) | ||
|
||
|
||
AC_OUTPUT([ | ||
Makefile | ||
src/Makefile | ||
src/twitter/Makefile | ||
src/twitter/oauth/Makefile | ||
data/Makefile | ||
data/themes/Makefile | ||
data/themes/gry/Makefile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* MicroTwitter | ||
* Micromoko | ||
* Globals definitions | ||
* Copyright (C) 2009-2010 Daniele Ricci <[email protected]> | ||
* | ||
|
@@ -42,7 +42,7 @@ extern int _log_dom; | |
#define LOG_LEVEL EINA_LOG_LEVEL_INFO | ||
#endif | ||
|
||
#define MICROTWITTER_DATADIR DATADIR "/microtwitter" | ||
#define MICROMOKO_DATADIR DATADIR "/micromoko" | ||
|
||
extern RemoteConfigService* home_config; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* MicroTwitter | ||
* Micromoko | ||
* Entry point | ||
* Copyright (C) 2009-2010 Daniele Ricci <[email protected]> | ||
* | ||
|
@@ -26,9 +26,10 @@ | |
#include <dbus/dbus-glib-bindings.h> | ||
|
||
#include "globals.h" | ||
#include "twitter/twitter.h" | ||
|
||
#define MICROTWITTER_NAME "org.mokosuite.twitter" | ||
#define MICROTWITTER_CONFIG_PATH MOKOSUITE_DBUS_PATH "/Twitter/Config" | ||
#define MICROMOKO_NAME "org.mokosuite.micromoko" | ||
#define MICROMOKO_CONFIG_PATH MOKOSUITE_DBUS_PATH "/Micromoko/Config" | ||
|
||
|
||
// default log domain | ||
|
@@ -51,27 +52,28 @@ int main(int argc, char* argv[]) | |
|
||
EINA_LOG_INFO("%s version %s", PACKAGE_NAME, VERSION); | ||
|
||
/* other things */ | ||
// glib integration | ||
mokosuite_utils_init(); | ||
mokosuite_utils_glib_init(TRUE); | ||
mokosuite_ui_init(argc, argv); | ||
|
||
EINA_LOG_DBG("Loading data from %s", MICROTWITTER_DATADIR); | ||
EINA_LOG_DBG("Loading data from %s", MICROMOKO_DATADIR); | ||
|
||
// dbus name | ||
DBusGConnection* session_bus = dbus_session_bus(); | ||
if (!session_bus || !dbus_request_name(session_bus, MICROTWITTER_NAME)) | ||
if (!session_bus || !dbus_request_name(session_bus, MICROMOKO_NAME)) | ||
return EXIT_FAILURE; | ||
|
||
// config database | ||
char* cfg_file = g_strdup_printf("%s/.config/%s/settings.conf", g_get_home_dir(), PACKAGE); | ||
home_config = remote_config_service_new(session_bus, | ||
MICROTWITTER_CONFIG_PATH, | ||
MICROMOKO_CONFIG_PATH, | ||
cfg_file); | ||
g_free(cfg_file); | ||
|
||
// twitter init | ||
twitter_init(home_config); | ||
|
||
elm_theme_extension_add(NULL, MICROTWITTER_DATADIR "/theme.edj"); | ||
elm_theme_extension_add(NULL, MICROMOKO_DATADIR "/theme.edj"); | ||
// TODO additional themes | ||
|
||
// TODO public timeline or last open window? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
SUBDIRS = oauth | ||
|
||
MAINTAINERCLEANFILES = Makefile.in | ||
|
||
AM_CPPFLAGS = \ | ||
@MOKOSUITE_CFLAGS@ \ | ||
@GLIB_CFLAGS@ \ | ||
@SOUP_CFLAGS@ \ | ||
-Wall | ||
|
||
AM_LDFLAGS = \ | ||
@GLIB_LIBS@ \ | ||
@MOKOSUITE_LIBS@ \ | ||
@SOUP_LIBS@ \ | ||
-lreadline | ||
# !!!TEST TEST TEST!!! | ||
|
||
noinst_LTLIBRARIES = libtwitter.la | ||
|
||
libtwitter_la_SOURCES = \ | ||
private.h \ | ||
twitter.h \ | ||
twitter.c | ||
|
||
libtwitter_la_LIBADD = -Loauth -loauth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MAINTAINERCLEANFILES = Makefile.in | ||
|
||
AM_CPPFLAGS = \ | ||
@HASH_CFLAGS@ \ | ||
@SOUP_CFLAGS@ \ | ||
-DDATADIR=\""$(datadir)"\" \ | ||
-DLOCALEDIR=\"$(localedir)\" \ | ||
-Wall | ||
|
||
AM_LDFLAGS = \ | ||
@HASH_LIBS@ \ | ||
@SOUP_LIBS@ | ||
|
||
noinst_LTLIBRARIES = liboauth.la | ||
|
||
liboauth_la_SOURCES = \ | ||
oauth.c \ | ||
oauth.h \ | ||
encode.c \ | ||
encode.h \ | ||
hash.c |
Oops, something went wrong.