grim/purple-spasm

7112bce8e669
Parents 82c422dd2083
Children ec61bf51d99f
Update the docs and simplify meson.build
--- a/README.skeleton.md Mon Aug 07 21:12:51 2017 -0500
+++ b/README.skeleton.md Mon Aug 07 21:25:51 2017 -0500
@@ -6,60 +6,41 @@
## Getting Started
-To get started, copy `Makefile.example` to `Makefile` and edit it to fit your needs.
+This plugin uses the [meson](http://mesonbuild.com/) as it's build system. It is currently set up for simple plugins where all you need to do is make a few changes.
+
+Below is the top of the stock `meson.build`.
-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.
+ project(
+ 'skeleton-libpurple',
+ 'c',
+ version: '0.1.0',
+ )
- #!/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
+ SOURCES = [
+ 'hello-world.c',
+ ]
-`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.
+You should change `skeleton-libpurple` and `version` in the call to `project()` to match the name and version of your plugin respectively.
-`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.
+Next you'll need to set the `SOURCES` variable to the list of files in your 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.
+Once that's done you can move on to the usage section.
## Usage
-Once you've setup the `Makefile` you can build your plugin by simply typing `make`.
+Once your `meson.build` file is good to go, you can generate your build system with `meson build`. This will generate your build system in a directory named build in the current directory.
-If everything built fine, you can use `make install` to install the plugin so that your libpurple client can use it.
+To now run the build you can run `ninja -C build` or if you prefer:
-If you ever want to uninstall the plugin, you can type `make uninstall`.
+ cd build
+ ninja
-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.
+If everything built fine, you can use `ninja install` to install the plugin so that your libpurple client can use it.
+
+If you ever want to uninstall the plugin, you can type `ninja uninstall`.
+
+While developing your build will become incremental automatically, so if you wnat for a build from scratch, you can use `ninja 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.
-
-### Installing Pixmaps
-
-This build system also support installing pixmaps. To specify the pixmaps set the `PLUGIN_PIXMAPS` variable to a space separated list of pixmaps to install.
-
-The pixmaps will be installed into the normal Pidgin pixmaps directory.
-
-### Installing Protocol Pixmaps
-
-The protocol pixmaps are configured similar to `PLUGIN_PIXMAPS` but have a few extra requirements. First you need to use the variable `PROTOCOL_PIXMAPS`. This variable should be a space separate list of filenames that include the size of the pixmap. The sizes are 16, 22, 48, and scaled. For 16, 22, and 48 the images must be .png files and the scaled files must be .svgs. The filenames should specified like `foobar16.png`, `foobar22.png`, `foobar48.png`, and `foobarscaled.svg`. These will then be installed into the proper size directory in the Pidgin install.
--- a/meson.build Mon Aug 07 21:12:51 2017 -0500
+++ b/meson.build Mon Aug 07 21:25:51 2017 -0500
@@ -4,11 +4,11 @@
version: '0.1.0',
)
-plugin_name = 'hello-world'
-plugin_sources = [
+SOURCES = [
'hello-world.c',
]
+# The code below should not need to be modified for simple use cases.
add_project_arguments(
'-DPREFIX="@0@"'.format(get_option('prefix')),
'-DLIBDIR="@0@"'.format(get_option('libdir')),
@@ -18,8 +18,9 @@
PURPLE = dependency('purple', version: '>=2.0.0')
-shared_library(plugin_name,
- plugin_sources,
+shared_library(
+ meson.project_name(),
+ SOURCES,
name_prefix: '',
dependencies: [PURPLE],
install: true,