[geany/geany-plugins] 07a32b: Add docs on how to add a plugin to the Waf build system

Colomban Wendling git-noreply at xxxxx
Wed May 27 21:18:25 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 13 Apr 2015 15:04:08 UTC
Commit:      07a32b8dcf14980e31cb06fbe4f96fac6b787fdd
             https://github.com/geany/geany-plugins/commit/07a32b8dcf14980e31cb06fbe4f96fac6b787fdd

Log Message:
-----------
Add docs on how to add a plugin to the Waf build system


Modified Paths:
--------------
    HACKING

Modified: HACKING
49 lines changed, 49 insertions(+), 0 deletions(-)
===================================================================
@@ -284,6 +284,55 @@ Makefile.am to references them::
     yourfancypluginname_la_LIBADD = $(COMMONLIBS) $(FOO_LIBS)
 
 
+Adding a new plugin to Waf build system
+---------------------------------------
+
+Configuration checks
+^^^^^^^^^^^^^^^^^^^^
+
+Add a ``wscript_configure`` file in your plugin's root folder.
+This file contains checks for dependencies, like libraries your plugin
+requires.  If your plugin does not have any additional dependencies
+besides Geany, GLib and GTK, you can leave this file empty (but you need
+to create it nonetheless).
+
+Generally checks are performed with ``check_cfg_cached``.  An example
+to check for library ``foo`` at version 2.0 or newer might look like
+this::
+
+    from build.wafutils import check_cfg_cached
+
+    check_cfg_cached(conf,
+                     package='foo',
+                     atleast_version='2.0',
+                     uselib_store='FOO',
+                     mandatory=True,
+                     args='--cflags --libs')
+
+
+Build rules
+^^^^^^^^^^^
+
+Add a ``wscript_build`` file inside your plugin's root folder.
+This files defines how the plugin is built, and has to at least call
+``build_plugin()``.  An example could look like this::
+
+    from build.wafutils import build_plugin
+
+    name = 'YourFancyPluginName'
+    sources = ['src/yourfancypluginname.c']
+
+    build_plugin(bld, name, sources=sources)
+
+If you checked for additional dependencies in ``wscript_configure``
+in addition to the standard Geany, GLib or GTK, you might need to make
+use of some results of these checks.  Given the configuration example
+above, you would need to add the ``libraries=['FOO']`` argument to
+the ``build_plugin()`` call::
+
+    build_plugin(bld, name, sources=sources, libraries=['FOO'])
+
+
 Additional things to do for a new plugin
 ----------------------------------------
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list