mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Merge branch 'master' into plugins
Conflicts: .gitignore Makefile.am src/main.c src/profanity.c src/ui/console.c src/ui/core.c src/xmpp/capabilities.c src/xmpp/iq.c
This commit is contained in:
commit
cd816b94c2
2
.gitignore
vendored
2
.gitignore
vendored
@ -43,3 +43,5 @@ libtool
|
||||
m4/
|
||||
*.so
|
||||
*.lo
|
||||
plugins/
|
||||
src/gitversion.c
|
||||
|
30
Makefile.am
30
Makefile.am
@ -1,3 +1,20 @@
|
||||
if INCLUDE_GIT_VERSION
|
||||
|
||||
FORCE:
|
||||
|
||||
src/gitversion.c: .git/HEAD .git/index FORCE
|
||||
rm -f src/gitversion.c src/gitversion.o
|
||||
echo "#ifndef PROF_GIT_BRANCH" >> $@
|
||||
echo "#define PROF_GIT_BRANCH \"$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)\"" >> $@
|
||||
echo "#endif" >> $@
|
||||
echo "#ifndef PROF_GIT_REVISION" >> $@
|
||||
echo "#define PROF_GIT_REVISION \"$(shell git log --pretty=format:'%h' -n 1)\"" >> $@
|
||||
echo "#endif" >> $@
|
||||
|
||||
clean-local:
|
||||
rm -f src/gitversion.c src/gitversion.o
|
||||
endif
|
||||
|
||||
core_sources = \
|
||||
src/contact.c src/contact.h src/log.c src/common.c \
|
||||
src/log.h src/profanity.c src/common.h \
|
||||
@ -48,6 +65,9 @@ test_sources = \
|
||||
tests/test_autocomplete.c tests/testsuite.c tests/test_parser.c \
|
||||
tests/test_jid.c
|
||||
|
||||
git_sources = \
|
||||
src/gitversion.c
|
||||
|
||||
if BUILD_PYTHON_API
|
||||
with_python_sources = $(core_sources) $(python_sources)
|
||||
else
|
||||
@ -66,8 +86,14 @@ else
|
||||
with_lua_sources = $(with_ruby_sources)
|
||||
endif
|
||||
|
||||
if INCLUDE_GIT_VERSION
|
||||
with_git_sources = $(git_sources) $(with_lua_sources)
|
||||
else
|
||||
with_git_sources = $(with_lua_sources)
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = profanity
|
||||
profanity_SOURCES = $(main_source) $(with_lua_sources)
|
||||
profanity_SOURCES = $(with_git_sources) $(main_source)
|
||||
|
||||
lib_LTLIBRARIES = libprofanity.la
|
||||
libprofanity_la_LDFLAGS=-module -avoid-version -shared
|
||||
@ -78,7 +104,7 @@ library_include_HEADERS = src/plugins/profapi.h
|
||||
|
||||
TESTS = tests/testsuite
|
||||
check_PROGRAMS = tests/testsuite
|
||||
tests_testsuite_SOURCES = $(with_lua_sources) $(test_sources)
|
||||
tests_testsuite_SOURCES = $(with_git_sources) $(test_sources)
|
||||
tests_testsuite_LDADD = -lheadunit -lstdc++
|
||||
|
||||
man_MANS = docs/profanity.1
|
||||
|
@ -6,6 +6,15 @@ AC_INIT([profanity], [0.4.0], [boothj5web@gmail.com])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
LT_INIT
|
||||
PACKAGE_STATUS="development"
|
||||
|
||||
## get git branch and revision if in development
|
||||
if test "x$PACKAGE_STATUS" = xdevelopment; then
|
||||
AM_CONDITIONAL([INCLUDE_GIT_VERSION], [true])
|
||||
AC_DEFINE_UNQUOTED([HAVE_GIT_VERSION], [1], [Include git info])
|
||||
else
|
||||
AM_CONDITIONAL([INCLUDE_GIT_VERSION], [false])
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_STATUS], ["$PACKAGE_STATUS"], [Status of this build])
|
||||
AC_CONFIG_SRCDIR([src/main.c])
|
||||
AC_CONFIG_HEADERS([src/config.h])
|
||||
|
16
src/main.c
16
src/main.c
@ -19,10 +19,13 @@
|
||||
* along with Profanity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "prof_config.h"
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
#include "profanity.h"
|
||||
|
||||
@ -55,7 +58,16 @@ main(int argc, char **argv)
|
||||
g_option_context_free(context);
|
||||
|
||||
if (version == TRUE) {
|
||||
g_print("Profanity, version %s\n", PROF_PACKAGE_VERSION);
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
g_print("Profanity, version %sdev.%s.%s\n", PROF_PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
|
||||
#else
|
||||
g_print("Profanity, version %sdev\n", PROF_PACKAGE_VERSION);
|
||||
#endif
|
||||
} else {
|
||||
g_print("Profanity, version %s\n", PROF_PACKAGE_VERSION);
|
||||
}
|
||||
|
||||
g_print("Copyright (C) 2012, 2013 James Booth <%s>.\n", PROF_PACKAGE_BUGREPORT);
|
||||
g_print("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
|
||||
g_print("\n");
|
||||
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include "prof_config.h"
|
||||
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
#include <locale.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
@ -657,7 +661,11 @@ _init(const int disable_tls, char *log_level)
|
||||
log_level_t prof_log_level = log_level_from_string(log_level);
|
||||
log_init(prof_log_level);
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
log_info("Starting Profanity (%sdev)...", PROF_PACKAGE_VERSION);
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
log_info("Starting Profanity (%sdev.%s.%s)...", PROF_PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
|
||||
#else
|
||||
log_info("Starting Profanity (%sdev)...", PROF_PACKAGE_VERSION);
|
||||
#endif
|
||||
} else {
|
||||
log_info("Starting Profanity (%s)...", PROF_PACKAGE_VERSION);
|
||||
}
|
||||
|
@ -40,6 +40,10 @@
|
||||
#include "xmpp/xmpp.h"
|
||||
#include "xmpp/bookmark.h"
|
||||
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
static void _cons_splash_logo(void);
|
||||
void _show_roster_contacts(GSList *list, gboolean show_groups);
|
||||
|
||||
@ -167,7 +171,11 @@ cons_about(void)
|
||||
win_print_time(console, '-');
|
||||
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
wprintw(console->win, "Welcome to Profanity, version %sdev.%s.%s\n", PROF_PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
|
||||
#else
|
||||
wprintw(console->win, "Welcome to Profanity, version %sdev\n", PROF_PACKAGE_VERSION);
|
||||
#endif
|
||||
} else {
|
||||
wprintw(console->win, "Welcome to Profanity, version %s\n", PROF_PACKAGE_VERSION);
|
||||
}
|
||||
@ -1395,7 +1403,11 @@ _cons_splash_logo(void)
|
||||
wprintw(console->win, "\n");
|
||||
win_print_time(console, '-');
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
wprintw(console->win, "Version %sdev.%s.%s\n", PROF_PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
|
||||
#else
|
||||
wprintw(console->win, "Version %sdev\n", PROF_PACKAGE_VERSION);
|
||||
#endif
|
||||
} else {
|
||||
wprintw(console->win, "Version %s\n", PROF_PACKAGE_VERSION);
|
||||
}
|
||||
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include "prof_config.h"
|
||||
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef PROF_HAVE_LIBXSS
|
||||
@ -1375,7 +1379,14 @@ _ui_draw_win_title(void)
|
||||
g_string_append(version_str, " ");
|
||||
g_string_append(version_str, PROF_PACKAGE_VERSION);
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
g_string_append(version_str, "dev.");
|
||||
g_string_append(version_str, PROF_GIT_BRANCH);
|
||||
g_string_append(version_str, ".");
|
||||
g_string_append(version_str, PROF_GIT_REVISION);
|
||||
#else
|
||||
g_string_append(version_str, "dev");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include "prof_config.h"
|
||||
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -238,7 +242,14 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
|
||||
GString *name_str = g_string_new("Profanity ");
|
||||
g_string_append(name_str, PROF_PACKAGE_VERSION);
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
g_string_append(name_str, "dev.");
|
||||
g_string_append(name_str, PROF_GIT_BRANCH);
|
||||
g_string_append(name_str, ".");
|
||||
g_string_append(name_str, PROF_GIT_REVISION);
|
||||
#else
|
||||
g_string_append(name_str, "dev");
|
||||
#endif
|
||||
}
|
||||
xmpp_stanza_set_attribute(identity, "name", name_str->str);
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include "prof_config.h"
|
||||
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
#include "gitversion.c"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -236,7 +240,14 @@ _iq_handle_version_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
xmpp_stanza_t *version_txt = xmpp_stanza_new(ctx);
|
||||
GString *version_str = g_string_new(PROF_PACKAGE_VERSION);
|
||||
if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef PROF_HAVE_GIT_VERSION
|
||||
g_string_append(version_str, "dev.");
|
||||
g_string_append(version_str, PROF_GIT_BRANCH);
|
||||
g_string_append(version_str, ".");
|
||||
g_string_append(version_str, PROF_GIT_REVISION);
|
||||
#else
|
||||
g_string_append(version_str, "dev");
|
||||
#endif
|
||||
}
|
||||
xmpp_stanza_set_text(version_txt, version_str->str);
|
||||
xmpp_stanza_add_child(version, version_txt);
|
||||
|
Loading…
Reference in New Issue
Block a user