grim/purple-spasm

cf36ee9fda60
Parents 5840931371c0
Children 82c422dd2083
Start transitioning everyting over to meson
--- a/Makefile.example Mon Aug 07 20:40:31 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/usr/bin/make -f
-
-PIDGIN_TREE_TOP ?= ../pidgin-2.12.0
-WIN32_DEV_TOP ?= $(PIDGIN_TREE_TOP)/../win32-dev
-
-PLUGIN_NAME := helloworld
-PLUGIN_SOURCES := helloworld.c
-PLUGIN_HEADERS :=
-PLUGIN_LIBS :=
-PLUGIN_CFLAGS :=
-
-include libpurple.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hello-world.c Mon Aug 07 21:11:37 2017 -0500
@@ -0,0 +1,66 @@
+/*
+ * HelloWorld - A hello world libpurple plugin
+ * Copyright (C) 2006 John Bailey <rekkanoryo@rekkanoryo.org>
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+
+#define PURPLE_PLUGINS
+
+#include "notify.h"
+#include "plugin.h"
+#include "version.h"
+
+static gboolean
+plugin_load(PurplePlugin *plugin) {
+ purple_notify_message(
+ plugin,
+ PURPLE_NOTIFY_MSG_INFO,
+ "Hello World!",
+ "This is the Hello World! plugin :)",
+ NULL,
+ NULL,
+ NULL
+ );
+
+ return TRUE;
+}
+
+static PurplePluginInfo info = {
+ .magic = PURPLE_PLUGIN_MAGIC,
+ .major_version = PURPLE_MAJOR_VERSION,
+ .minor_version = PURPLE_MINOR_VERSION,
+ .type = PURPLE_PLUGIN_STANDARD,
+ .priority = PURPLE_PRIORITY_DEFAULT,
+
+ .id = "core-hello_world",
+ .name = "Hello World!",
+ .version = PLUGIN_VERSION,
+
+ .summary = "Hello World Plugin",
+ .description = "Hello World Plugin",
+ .author = "My Name <email@helloworld.tld>",
+ .homepage = "http://helloworld.tld",
+
+ .load = plugin_load
+};
+
+static void
+init_plugin(PurplePlugin *plugin) {
+}
+
+PURPLE_INIT_PLUGIN(hello_world, init_plugin, info);
--- a/helloworld.c Mon Aug 07 20:40:31 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * HelloWorld - A hello world libpurple plugin
- * Copyright (C) 2006 John Bailey <rekkanoryo@rekkanoryo.org>
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <glib.h>
-
-#define PURPLE_PLUGINS
-
-#include "notify.h"
-#include "plugin.h"
-#include "version.h"
-
-static gboolean
-plugin_load(PurplePlugin *plugin) {
- purple_notify_message(
- plugin,
- PURPLE_NOTIFY_MSG_INFO,
- "Hello World!",
- "This is the Hello World! plugin :)",
- NULL,
- NULL,
- NULL
- );
-
- return TRUE;
-}
-
-static PurplePluginInfo info = {
- .magic = PURPLE_PLUGIN_MAGIC,
- .major_version = PURPLE_MAJOR_VERSION,
- .minor_version = PURPLE_MINOR_VERSION,
- .type = PURPLE_PLUGIN_STANDARD,
- .priority = PURPLE_PRIORITY_DEFAULT,
-
- .id = "core-hello_world",
- .name = "Hello World!",
- .version = PLUGIN_VERSION,
-
- .summary = "Hello World Plugin",
- .description = "Hello World Plugin",
- .author = "My Name <email@helloworld.tld>",
- .homepage = "http://helloworld.tld",
-
- .load = plugin_load
-};
-
-static void
-init_plugin(PurplePlugin *plugin) {
-}
-
-PURPLE_INIT_PLUGIN(hello_world, init_plugin, info);
--- a/libpurple.mk Mon Aug 07 20:40:31 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-#!/usr/bin/make -f
-# skeleton-libpurple - A skeleton for developing libpurple plugins
-# Copyright (C) 2017 Gary Kramlich <grim@reaperworld.com>
-# Copyright (C) 2016-2017 Eion Robb <eion@robbmob.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 2
-# 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# figure out the os and set the proper variables for it
-ifeq ($(OS),Windows_NT) # window
-# set the target's name
-PLUGIN_TARGET := $(PLUGIN_NAME).dll
-
-# set the platform cflags and libs
-PLATFORM_CFLAGS := $(PLUGIN_CFLAGS_WIN32)
-PLATFORM_LIBS := $(PLUGIN_LIBS_WIN32)
-
-# set the variables for windows that are usually populated by pkg-config
-CC ?= $(WIN32_DEV_TOP)/mingw-4.7.2/bin/gcc
-LIBPURPLE_PLUGIN_DIR := $(PROGRAMFILES)/Pidgin/plugins
-PLUGIN_PIXMAPSDIR := $(PROGRAMFILES)/Pidgin/pixmaps/pidgin
-PLATFORM_CFLAGS += \
- -I$(WIN32_DEV_TOP)/glib-2.28.8/include \
- -I$(WIN32_DEV_TOP)/glib-2.28.8/include/glib-2.0 \
- -I$(WIN32_DEV_TOP)/glib-2.28.8/lib/glib-2.0/include \
- -I$(PIDGIN_TREE_TOP)/libpurple \
- -I$(PIDGIN_TREE_TOP)
-PLATFORM_LIBS += \
- -L$(WIN32_DEV_TOP)/glib-2.28.8/lib \
- -L$(PIDGIN_TREE_TOP)/libpurple \
- -lpurple \
- -lintl \
- -lglib-2.0 \
- -lgobject-2.0 \
- -lz
-else # not windows
-PLUGIN_TARGET := $(PLUGIN_NAME).so
-
-UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Darwin)
-PLATFORM_CFLAGS := $(PLUGIN_CFLAGS_DARWIN)
-PLATFORM_LIBS := $(PLUGIN_LIBS_DARWIN)
-else
-PLATFORM_CFLAGS := $(PLUGIN_CFLAGS_LINUX)
-PLATFORM_LIBS := $(PLUGIN_LIBS_LINUX)
-endif
-
-endif
-
-# set a bunch of variables if there weren't set already
-CC ?= gcc
-CFLAGS ?= -O2 -g -g3 \
- -Wall -Wextra -Werror -Wformat \
- -Wno-deprecated-declarations -Wno-unused-parameter \
- -fno-strict-aliasing
-LDFLAGS ?=
-
-# pkg-config if necessary
-PKG_CONFIG ?= pkg-config
-LIBPURPLE_PC_MODULE ?= purple
-LIBPURPLE_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags $(LIBPURPLE_PC_MODULE))
-LIBPURPLE_LIBS ?= $(shell $(PKG_CONFIG) --libs $(LIBPURPLE_PC_MODULE))
-LIBPURPLE_PLUGIN_DIR ?= $(shell $(PKG_CONFIG) --variable=plugindir $(LIBPURPLE_PC_MODULE))
-LIBPURPLE_DATA_DIR ?= $(shell $(PKG_CONFIG) --variable=datadir $(LIBPURPLE_PC_MODULE))
-LIBPURPLE_LIB_DIR ?= $(shell $(PKG_CONFIG) --variable=libdir $(LIBPURPLE_PC_MODULE))
-PLUGIN_PIXMAPSDIR := $(LIBPURPLE_DATA_DIR)/pixmaps/pidgin
-
-# Variables that are platform independent
-PLUGIN_OBJECTS := $(PLUGIN_SOURCES:%.c=%.o)
-ADDITIONAL_CFLAGS := \
- -DDATADIR=$(LIBPURPLE_DATA_DIR) \
- -DLIBDIR=$(LIBPURPLE_LIB_DIR) \
- -DPIXMAPSDIR=$(PLUGIN_PIXMAPSDIR) \
- -DPLUGIN_VERSION=\"$(PLUGIN_VERSION)\"
-
-# Generate a list of destination of the pixmaps to install
-INSTALLED_PIXMAPS := $(PLUGIN_PIXMAPS:%=$(PLUGIN_PIXMAPSDIR)/%)
-
-# Generate a list of protocol icons based on their sizes. We need to stash
-# everything in a temp variable so that we can do the final substitution.
-INSTALLED_PROTOCOL_PIXMAPS :=
-_PIXMAP_TEMP := $(subst 16,,$(filter %16.png,$(PROTOCOL_PIXMAPS)))
-INSTALLED_PROTOCOL_PIXMAPS += $(_PIXMAP_TEMP:%=$(PLUGIN_PIXMAPSDIR)/protocols/16/%)
-
-_PIXMAP_TEMP := $(subst 22,,$(filter %22.png,$(PROTOCOL_PIXMAPS)))
-INSTALLED_PROTOCOL_PIXMAPS += $(_PIXMAP_TEMP:%=$(PLUGIN_PIXMAPSDIR)/protocols/22/%)
-
-_PIXMAP_TEMP := $(subst 48,,$(filter %48.png,$(PROTOCOL_PIXMAPS)))
-INSTALLED_PROTOCOL_PIXMAPS += $(_PIXMAP_TEMP:%=$(PLUGIN_PIXMAPSDIR)/protocols/48/%)
-
-_PIXMAP_TEMP := $(subst scaled,,$(filter %scaled.svg,$(PROTOCOL_PIXMAPS)))
-INSTALLED_PROTOCOL_PIXMAPS += $(_PIXMAP_TEMP:%=$(PLUGIN_PIXMAPSDIR)/protocols/scaled/%)
-
-# Build targets
-.PHONY: all clean install uninstall
-
-all: $(PLUGIN_TARGET)
-
-clean:
- rm -f $(PLUGIN_OBJECTS) $(PLUGIN_TARGET) $(CLEAN_FILES)
-
-install: $(PLUGIN_TARGET) $(INSTALLED_PIXMAPS) $(INSTALLED_PROTOCOL_PIXMAPS)
- install -D $(PLUGIN_TARGET) $(LIBPURPLE_PLUGIN_DIR)/$(PLUGIN_TARGET)
-
-# This target will fulfill the dependency of the INSTALLED_PIXMAPS variable above
-$(PLUGIN_PIXMAPSDIR)/%: %
- install -D -m 644 $< $@
-
-$(PLUGIN_PIXMAPSDIR)/protocols/16/%.png: %16.png
- install -D -m 644 $< $@
-
-$(PLUGIN_PIXMAPSDIR)/protocols/22/%.png: %22.png
- install -D -m 644 $< $@
-
-$(PLUGIN_PIXMAPSDIR)/protocols/48/%.png: %48.png
- install -D -m 644 $< $@
-
-$(PLUGIN_PIXMAPSDIR)/protocols/scaled/%.svg: %scaled.svg
- install -D -m 644 $< $@
-
-uninstall:
- rm -f $(LIBPURPLE_PLUGIN_DIR)/$(PLUGIN_TARGET)
- rm -f $(INSTALLED_PIXMAPS) $(INSTALLED_PROTOCOL_PIXMAPS)
-
-%.o: %.c $(MAKEFILE_LIST)
- $(CC) $(CFLAGS) $(ADDITIONAL_CFLAGS) $(PLATFORM_CFLAGS) $(LIBPURPLE_CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<
-
-$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(PLUGIN_HEADERS) $(MAKEFILE_LIST) $(PLUGIN_DEPENDENCIES)
- $(CC) -o $@ -shared $(PLUGIN_OBJECTS) $(LDFLAGS) $(PLUGIN_LIBS) $(LIBS) $(LIBPURPLE_LIBS) $(PLATFORM_LIBS)
-
-protocol_pixmaps:
- echo $(PROTOCOL_PIXMAPS_16)
- echo $(PROTOCOL_PIXMAPS_22)
- echo $(PROTOCOL_PIXMAPS_48)
- echo $(PROTOCOL_PIXMAPS_SCALED)
- echo $(INSTALLED_PROTOCOL_PIXMAPS)
- echo $(PLUGIN_PIXMAPSDIR)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/meson.build Mon Aug 07 21:11:37 2017 -0500
@@ -0,0 +1,27 @@
+project(
+ 'skeleton-libpurple',
+ 'c',
+ version: '0.1.0',
+)
+
+plugin_name = 'hello-world'
+plugin_sources = [
+ 'hello-world.c',
+]
+
+add_project_arguments(
+ '-DPREFIX="@0@"'.format(get_option('prefix')),
+ '-DLIBDIR="@0@"'.format(get_option('libdir')),
+ '-DPLUGIN_VERSION="@0@"'.format(meson.project_version()),
+ language : 'c'
+)
+
+PURPLE = dependency('purple', version: '>=2.0.0')
+
+shared_library(plugin_name,
+ plugin_sources,
+ name_prefix: '',
+ dependencies: [PURPLE],
+ install: true,
+ install_dir: PURPLE.get_pkgconfig_variable('plugindir'),
+)