grim/guifications3

Parents d2bdf5faf879
Children d4bbd9f88813
converted purple-guifications to cmake, it doesn't install to the right directory right now, but I need to figureout how to detect whether or not use the path in the pkg-config file from pidgin or to use our prefix
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/purple-guifications/CMakeLists.txt Mon Dec 13 23:16:27 2010 -0600
@@ -0,0 +1,68 @@
+cmake_minimum_required(VERSION 2.8)
+
+###############################################################################
+# Project Info
+###############################################################################
+project(purple-guifications C)
+
+set(PURPLE_GUIFICATIONS_MAJOR_VERSION 0)
+set(PURPLE_GUIFICATIONS_MINOR_VERSION 0)
+set(PURPLE_GUIFICATIONS_MICRO_VERSION 1)
+set(PURPLE_GUIFICATIONS_EXTRA_VERSION dev)
+
+set(VERSION ${PURPLE_GUIFICATIONS_MAJOR_VERSION}.${PURPLE_GUIFICATIONS_MINOR_VERSION}.${PURPLE_GUIFICATIONS_MICRO_VERSION}${PURPLE_GUIFICATIONS_EXTRA_VERSION})
+
+###############################################################################
+# Dependencies
+###############################################################################
+include(FindPkgConfig)
+
+pkg_check_modules(GLIB REQUIRED
+ glib-2.0>=2.16.0
+ gobject-2.0>=2.16.0
+ gthread-2.0>=2.16.0
+)
+
+pkg_check_modules(GFLIB REQUIRED gflib)
+
+pkg_check_modules(PURPLE REQUIRED purple)
+
+###############################################################################
+# Build Info
+###############################################################################
+include_directories(
+ ${CMAKE_SOURCE_DIR}
+ ${GLIB_INCLUDE_DIRS}
+ ${GFLIB_INCLUDE_DIRS}
+ ${PURPLE_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${GLIB_LIBRARY_DIRS}
+ ${GFLIB_LIBRARY_DIRS}
+ ${PURPLE_LIBRARY_DIRS}
+)
+
+add_definitions(
+ -DGETTEXT_PACKAGE="purple-guifications"
+ -DDATADIR="${CMAKE_INSTALL_PREFIX}/share"
+ -DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale"
+ -DVERSION="${VERSION}"
+ -g -g3 -Wall
+)
+
+###############################################################################
+# Subdirectories
+###############################################################################
+add_subdirectory(src)
+add_subdirectory(pixmaps)
+
+###############################################################################
+# Install Stuff
+###############################################################################
+# documentation
+install(
+ FILES AUTHORS ChangeLog COPYING NEWS README
+ DESTINATION share/doc/purple-guifications
+)
+
--- a/purple-guifications/Makefile.am Mon Dec 13 22:59:00 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-SUBDIRS = pixmaps po src
-
-DISTCLEANFILES=\
- gf_config.h \
- intltool-extract \
- intltool-merge \
- intltool-update
-
-EXTRA_DIST = \
- AUTHORS \
- NEWS \
- INSTALL \
- COPYING \
- README \
- ChangeLog \
- configure.ac \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
- po/AUTHORS \
- po/ChangeLog
-
-BUILT_SOURCES=gf_config.h
-
-$(OBJECTS): libtool $(BUILD_SOURCES)
-
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
-
-gf_config.h: pre_config.h
- cp -f po/Makefile po/.tmp-Makefile
- sed -e "s#localedir = .*#localedir = $(GAIM_DATADIR)/locale#g" < po/.tmp-Makefile > po/Makefile
- rm -f po/.tmp-Makefile
- $(sedpath) 's/\#define PACKAGE/\#define GF_PACKAGE/g' pre_config.h > $@
--- a/purple-guifications/autogen.sh Mon Dec 13 22:59:00 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Guifications - The end-all, be-all notification framework
-# Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PACKAGE="purple-guifications"
-
-which gflib-autogen.sh || {
- echo "You need to install gflib to run autogen"
- exit 1
-}
-
-. gflib-autogen.sh
-
-add_default_commands
-
-autogen
-
--- a/purple-guifications/configure.ac Mon Dec 13 22:59:00 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-dnl Process this file with autoconf to create configure.
-
-dnl ################################################################
-dnl # Initialize autoconf
-dnl ################################################################
-AC_INIT(purple-guifications, 3.0.0dev, guifications-devel@lists.guifications.org)
-AC_PREREQ(2.50)
-AC_CANONICAL_SYSTEM
-AC_COPYRIGHT([Copyright 2003-2009 Gary Kramlich])
-
-dnl ################################################################
-dnl # Initialize automake
-dnl ################################################################
-AM_INIT_AUTOMAKE([gnu dist-bzip2])
-
-AC_PATH_PROG(sedpath, sed)
-AC_DISABLE_STATIC
-
-dnl ################################################################
-dnl # Configuration file
-dnl ################################################################
-AM_CONFIG_HEADER(config.h)
-
-dnl # Stash configure args
-AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
-
-# set our language to C
-AC_LANG([C])
-
-dnl #######################################################################
-dnl # Make sure we have pkg-config
-dnl #######################################################################
-PKG_PROG_PKG_CONFIG
-
-dnl #######################################################################
-dnl # Setup libtool
-dnl #######################################################################
-LT_INIT
-LT_LANG([C])
-LIBTOOL="$LIBTOOL --silent"
-
-dnl #######################################################################
-dnl # I'm lazy and figured config.h is the best place for this ;)
-dnl #######################################################################
-AC_DEFINE_UNQUOTED(GUIFICATIONS_WEBSITE, "http://guifications.org/", [guifications website])
-
-dnl #######################################################################
-dnl # Our header
-dnl #######################################################################
-AH_TOP([ /* our header */
-#ifndef CONFIG_H
-#define CONFIG_H
-])
-AH_BOTTOM([
-#endif /* CONFIG_H */
-])
-
-dnl #######################################################################
-dnl # intltool
-dnl #######################################################################
-AC_PROG_INTLTOOL
-
-GETTEXT_PACKAGE=purple-guifications
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
-
-ALL_LINGUAS=""
-AM_GLIB_GNU_GETTEXT
-
-dnl #######################################################################
-dnl # Look for the C compiler
-dnl #######################################################################
-AC_MSG_CHECKING([WMD's])
-AC_MSG_RESULT(no)
-CFLAGS_save="$CFLAGS"
-AC_PROG_CC
-CFLAGS="$CFLAGS_save"
-
-AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug],[compile with debugging support])
- ,,enable_debug=no)
-
-if test x"$enable_debug" = x"yes" ; then
- AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
-fi
-
-if test x"$GCC" = x"yes"; then
- CFLAGS="$CFLAGS -Wall -g3"
-fi
-AC_SUBST(CFLAGS)
-
-dnl #######################################################################
-dnl # check for glib and other glib dependencies
-dnl #######################################################################
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14.0)
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-dnl #######################################################################
-dnl # check for libpurple
-dnl #######################################################################
-PKG_CHECK_MODULES(PURPLE, purple)
-
-AC_SUBST(PURPLE_CFLAGS)
-AC_SUBST(PURPLE_LIBS)
-
-PURPLE_LIBDIR="$libdir"
-if test x"$prefix" = x"NONE" ; then
- dnl # when no prefix is given, we grab the purple lib and data directories
- dnl # and use those instead. If a prefix was given, we just use that.
- PURPLE_LIBDIR=`pkg-config --variable=libdir purple`
-fi
-PURPLE_LIBDIR="$PURPLE_LIBDIR/purple-2/"
-AC_SUBST(PURPLE_LIBDIR)
-
-dnl #######################################################################
-dnl # check for gflib goodies
-dnl #######################################################################
-PKG_CHECK_MODULES(GFLIB, gflib)
-AC_SUBST(GFLIB_CFLAGS)
-AC_SUBST(GFLIB_LIBS)
-
-dnl #######################################################################
-dnl # Finish up
-dnl #######################################################################
-AC_OUTPUT([Makefile
- pixmaps/Makefile
- po/Makefile.in
- src/Makefile
- ])
-
-dnl #######################################################################
-dnl # Ouput!!
-dnl #######################################################################
-
-echo;
-echo AC_PACKAGE_NAME AC_PACKAGE_VERSION Configuration complete
-echo;
-echo Installing to....................: $PURPLE_LIBDIR
-echo;
-echo Debugging enabled................: $enable_debug
-echo;
-echo Type make to compile
-echo;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/purple-guifications/pixmaps/CMakeLists.txt Mon Dec 13 23:16:27 2010 -0600
@@ -0,0 +1,8 @@
+set(PIXMAPS
+ pidgin.png
+)
+
+foreach(PIXMAP ${PIXMAPS})
+ install(FILES ${PIXMAP} DESTINATION share/pixmaps/purple-guifications)
+endforeach(PIXMAP)
+
--- a/purple-guifications/pixmaps/Makefile.am Mon Dec 13 22:59:00 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-EXTRA_DIST=pidgin.png
-
-pixmapdir=$(datadir)/pixmaps/guifications/purple
-pixmap_DATA=pidgin.png
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/purple-guifications/src/CMakeLists.txt Mon Dec 13 23:16:27 2010 -0600
@@ -0,0 +1,33 @@
+###############################################################################
+# purple-guifications target
+###############################################################################
+set(PURPLE_GUIFICATIONS_HEADERS
+ events.h
+)
+
+set(PURPLE_GUIFICATIONS_SOURCES
+ events.c
+ purple-guifications.c
+)
+
+add_library(purple-guifications MODULE
+ ${PURPLE_GUIFICATIONS_HEADERS}
+ ${PURPLE_GUIFICATIONS_SOURCES}
+)
+
+target_link_libraries(purple-guifications
+ ${GLIB_LIBRARIES}
+ ${GFLIB_LIBRARIES}
+ ${PURPLE_LIBRARIES}
+)
+
+set_target_properties(purple-guifications PROPERTIES PREFIX "")
+
+###############################################################################
+# Install Stuff
+###############################################################################
+install(
+ TARGETS purple-guifications LIBRARY
+ DESTINATION lib/purple
+)
+
--- a/purple-guifications/src/Makefile.am Mon Dec 13 22:59:00 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-EXTRA_DIST=\
- events.h
-
-gfdir=$(PURPLE_LIBDIR)
-
-gf_LTLIBRARIES=guifications3.la
-
-guifications3_la_LDFLAGS=-module -avoid-version
-
-guifications3_la_SOURCES=\
- events.c \
- purple-guifications.c
-
-guifications3_la_LIBADD=\
- $(GFLIB_LIBS) \
- $(GLIB_LIBS) \
- $(PURPLE_LIBS)
-
-AM_CPPFLAGS=\
- -DGF_VERSION=\"$(VERSION)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLOCALEDIR=\"$(datadir)/locale\" \
- $(DEBUG_CFLAGS) \
- $(GFLIB_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(PURPLE_CFLAGS)
-
--- a/purple-guifications/src/events.c Mon Dec 13 22:59:00 2010 -0600
+++ b/purple-guifications/src/events.c Mon Dec 13 23:16:27 2010 -0600
@@ -19,8 +19,7 @@
# include <gf_config.h>
#endif
-#include <gflib/gf_lib.h>
-#include <gflib/gf_intl.h>
+#include <gf_lib.h>
#define add_event(feed, name, i18n, desc) { \
event = gf_event_new((name), (i18n), (desc)); \
--- a/purple-guifications/src/events.h Mon Dec 13 22:59:00 2010 -0600
+++ b/purple-guifications/src/events.h Mon Dec 13 23:16:27 2010 -0600
@@ -20,7 +20,7 @@
#include <glib.h>
-#include <gflib/gf_lib.h>
+#include <gf_lib.h>
G_BEGIN_DECLS
--- a/purple-guifications/src/purple-guifications.c Mon Dec 13 22:59:00 2010 -0600
+++ b/purple-guifications/src/purple-guifications.c Mon Dec 13 23:16:27 2010 -0600
@@ -21,7 +21,7 @@
#include <math.h>
-#include <gflib/gf_lib.h>
+#include <gf_lib.h>
/* purple includes */
#ifndef PURPLE_PLUGINS
@@ -35,6 +35,12 @@
#include "events.h"
+/* undefine _ and N_ from gf_intl.h. This needs to be fixed in gf_lib.h to not
+ * include gf_intl.h or something...
+ */
+#undef _
+#undef N_
+
#ifdef ENABLE_NLS
# include <locale.h>
# include <libintl.h>
@@ -180,12 +186,12 @@
"core-guifications",
NULL,
- GF_VERSION,
+ VERSION,
NULL,
NULL,
"Gary Kramlich <grim@reaperworld.com>",
- GUIFICATIONS_WEBSITE,
+ "https://www.guifications.org/projects/guifications3/",
gf_load,
gf_unload,