grim/purple-spasm

e429b51d0462
Parents 1571bb79381f
Children 1c9f0a7c7e84
Add a README.md and a few tweaks to libpurple.mk. Fixes #1
  • +55 -0
    README.md
  • +2 -1
    libpurple.mk
  • --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/README.md Thu Apr 27 20:20:46 2017 -0500
    @@ -0,0 +1,55 @@
    +# skeleton-libpurple
    +
    +This repository is a starting point for writing libpurple plugins.
    +
    +You can fork it and use it's build system to build your own custom plugin immediately. By forking this repo you can easily pull in updates to it too!
    +
    +## Getting Started
    +
    +To get started, copy `Makefile.example` to `Makefile` and edit it to fit your needs.
    +
    +For example, say your plugin is named `my-awesome-plugin` and has a source file of `awesome.c`. Your `Makefile` would look like the following.
    +
    + #!/usr/bin/make -f
    +
    + PIDGIN_TREE_TOP ?= ../pidgin-2.12.0
    + WIN32_DEV_TOP ?= $(PIDGIN_TREE_TOP)/../win32-dev
    +
    + PLUGIN_LIBRARIES :=
    + PLUGIN_CFLAGS :=
    + PLUGIN_NAME := awesome
    + PLUGIN_SOURCES := awesome.c
    + PLUGIN_HEADERS :=
    + include libpurple.mk
    +
    +`PIDGIN_TREE_TOP` and `WIN32_DEV_TOP` are relative paths to where your keep the Pidgin development files for Windows.
    +
    +`PLUGIN_LIBRARIES` are additional flags to pass to the linker.
    +
    +`PLUGIN_CFLAGS` are additional flags to pass to the C compiler.
    +
    +`PLUGIN_NAME` is the base filename that the plugin should have. In the example above, this would output `awesome.dll` on Windows and `awesome.so` on Linux.
    +
    +`PLUGIN_SOURCES` is a space separated list of source filenames that will be used to build the plugin.
    +
    +`PLUGIN_HEADERS` is a space separated list of header filename that will be used to build the plugin.
    +
    +`include libpurple.mk` imports `libpurple.mk` which abstracts out all the complexities of the build system.
    +
    +## Usage
    +
    +Once you've setup the `Makefile` you can build your plugin by simply typing `make`.
    +
    +If everything built fine, you can use `make install` to install the plugin so that your libpurple client can use it.
    +
    +If you ever want to uninstall the plugin, you can type `make uninstall`.
    +
    +While developing your build will become incremental automatically, so if you wnat for a build from scratch, you can use `make clean` to remove the intermediate files.
    +
    +## Support
    +
    +If you're having issues with this repository, please open an issue in the Bitbucket project.
    +
    +## Advanced Usage
    +
    +This is a normal `Makefile` which means you can add additional targets to fit your needs. To make building your plugin depend on these targets you can set the `PLUGIN_DEPENDENCIES` variable to a space separate list of targets that the plugin itself should depend on.
    --- a/libpurple.mk Thu Apr 27 20:18:07 2017 -0500
    +++ b/libpurple.mk Thu Apr 27 20:20:46 2017 -0500
    @@ -82,6 +82,7 @@
    -DPIXMAPSDIR=$(LIBPURPLE_DATA_DIR)/pixmaps/pidgin \
    -DPLUGIN_VERSION=\"$(PLUGIN_VERSION)\"
    +# Build targets
    .PHONY: all clean install uninstall
    all: $(PLUGIN_TARGET)
    @@ -98,5 +99,5 @@
    %.o: %.c
    $(CC) $(CFLAGS) $(ADDITIONAL_CFLAGS) $(PLATFORM_CFLAGS) $(LIBPURPLE_CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $<
    -$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(PLUGIN_HEADERS) $(MAKEFILE_LIST)
    +$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(PLUGIN_HEADERS) $(MAKEFILE_LIST) $(PLUGIN_DEPENDENCIES)
    $(CC) -shared $(LIBS) $(LIBPURPLE_LIBS) $(PLATFORM_LIBS) $(LDFLAGS) $(PLUGIN_LIBS) -o $@ $(PLUGIN_OBJECTS)