Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 39 lines (32 sloc) 1.326 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Stock plugin configuration and build methods. These factor out the
# common tasks carried out by plugins in order to configure and build
# themselves.

from waflib.Errors import ConfigurationError
from copy import copy

def plugin(name, source=None, configure=False, build=False,
           build_replace=False, libs=[],
           tool='c', broken=False, output_prio=None):
    def stock_configure(conf):
        if broken:
            conf.msg('%s plugin' % name, 'disabled (broken)', color='RED')
            return

        if configure:
            configure(conf)

        conf.env.XMMS_PLUGINS_ENABLED.append(name)
        if output_prio:
            conf.env.XMMS_OUTPUT_PLUGINS.append((output_prio, name))

    def stock_build(bld):
        pat = tool=='c' and '*.c' or '*.cpp'
        obj = bld(
            features = '%(tool)s %(tool)sshlib' % dict(tool=tool),
            target = 'xmms_%s' % name,
            source = copy(source) or bld.path.ant_glob(pat),
            includes = '../../.. ../../include',
            uselib = ['glib2'] + libs,
            use = bld.env.xmms_shared_library and 'xmms2core' or '',
            install_path = '${PLUGINDIR}',
            mac_bundle = bld.env.mac_bundle_enabled,
        )

        if build:
            build(bld, obj)

    return stock_configure, stock_build
Something went wrong with that request. Please try again.