51
from TaskGen import taskgen, feature
53
54
APPNAME = 'geany-plugins'
61
def __init__(self, n, s, i, l=[]):
62
def __init__(self, name, sources, includes, deps=[]):
62
63
# plugin name, must be the same as the corresponding subdirectory
64
self.log_domain = name
65
self.name = name.lower()
64
66
# may be None to auto-detect source files in all directories specified in 'includes'
67
self.sources = sources
66
68
# do not include '.'
69
self.includes = includes
68
70
# a list of lists of libs and their versions, e.g. [ [ 'enchant', '1.3' ],
69
71
# [ 'gtkspell-2.0', '2.0', False ] ], the third argument defines whether
70
72
# the dependency is mandatory
74
75
# add a new element for your plugin
76
Plugin('addons', None, [ 'addons/src' ]),
77
Plugin('geanydoc', None, [ 'geanydoc/src']),
78
Plugin('geanylatex', None, [ 'geanylatex/src']),
79
Plugin('geanylipsum', None, [ 'geanylipsum/src']),
80
Plugin('geanysendmail', None, [ 'geanysendmail/src' ]),
81
Plugin('geanyvc', None, [ 'geanyvc/src/'], [ [ 'gtkspell-2.0', '2.0', False ] ]),
82
Plugin('shiftcolumn', None, [ 'shiftcolumn/src']),
83
Plugin('spellcheck', None, [ 'spellcheck/src' ], [ [ 'enchant', '1.3', True ] ]),
77
Plugin('Addons', None, [ 'addons/src' ]),
78
Plugin('CodeNav', None, [ 'codenav/src' ]),
79
Plugin('GeanyDoc', None, [ 'geanydoc/src' ]),
80
Plugin('GeanyExtraSel', None, [ 'geanyextrasel/src' ]),
81
Plugin('GeanyGenDoc', None, [ 'geanygendoc/src' ], [ [ 'ctpl', '0.2', True ] ]),
82
Plugin('GeanyInsertNum', None, [ 'geanyinsertnum/src' ]),
83
Plugin('GeanyLaTeX', None, [ 'geanylatex/src']),
84
Plugin('GeanyLipsum', None, [ 'geanylipsum/src']),
85
Plugin('GeanySendMail', None, [ 'geanysendmail/src' ]),
86
Plugin('GeanyVC', None, [ 'geanyvc/src/'], [ [ 'gtkspell-2.0', '2.0', False ] ]),
87
Plugin('ShiftColumn', None, [ 'shiftcolumn/src']),
88
Plugin('SpellCheck', None, [ 'spellcheck/src' ], [ [ 'enchant', '1.3', True ] ]),
85
90
map(lambda x: "geanygdb/src/" + x, ['gdb-io-break.c',
86
91
'gdb-io-envir.c', 'gdb-io-frame.c', 'gdb-io-read.c', 'gdb-io-run.c',
87
92
'gdb-io-stack.c', 'gdb-lex.c', 'gdb-ui-break.c', 'gdb-ui-envir.c',
88
93
'gdb-ui-frame.c', 'gdb-ui-locn.c', 'gdb-ui-main.c',
89
'geanydebug.c']), # source files
94
'geanygdb.c']), # source files
90
95
[ 'geanygdb', 'geanygdb/src' ], # include dirs
91
96
[ [ 'elf.h', '', False ], [ 'elf_abi.h', '', False ] ]
93
Plugin('geanyprj', None, [ 'geanyprj/src']),
95
99
[ 'geanylua/geanylua.c' ], # the other source files are listed in build_lua()
97
101
# maybe you need to modify the package name of Lua, try one of these: lua5.1 lua51 lua-5.1
98
[ [ 'lua', '5.1', True ] ])
102
[ [ 'lua', '5.1', True ] ]),
103
Plugin('GeanyPrj', None, [ 'geanyprj/src' ]),
104
Plugin('Pretty-Printer', None, [ 'pretty-printer/src' ], [ [ 'libxml-2.0', '2.6.27', True ] ]),
105
Plugin('TreeBrowser', None, [ 'treebrowser/src' ], [ [ 'gio-2.0', '2.16', False ] ])
291
308
conf.define('LOCALEDIR', 'share/locale', 1)
292
309
# DATADIR is defined in objidl.h, so we remove it from config.h
293
310
conf.undefine('DATADIR')
311
conf.define('GEANYPLUGINS_DATADIR', 'share')
295
313
conf.define('PREFIX', conf.env['PREFIX'], 1)
296
314
conf.define('DOCDIR', '%s/doc/geany-plugins/' % conf.env['DATADIR'], 1)
315
conf.define('GEANYPLUGINS_DATADIR', conf.env['DATADIR'])
316
conf.define('PKGDATADIR', os.path.join(conf.env['GEANYPLUGINS_DATADIR'], 'geany-plugins'))
317
conf.define('PKGLIBDIR', os.path.join(conf.env['LIBDIR'], 'geany-plugins'))
297
318
conf.define('VERSION', VERSION, 1)
298
319
conf.define('PACKAGE', APPNAME, 1)
299
320
conf.define('GETTEXT_PACKAGE', APPNAME, 1)
353
374
{ '1' : plugins[0].name, '2' : plugins[1].name }, dest='skip_plugins')
378
@feature('intltool_po')
379
def write_linguas_file(self):
381
if 'LINGUAS' in Build.bld.env:
382
files = Build.bld.env['LINGUAS']
383
for po_filename in files.split(' '):
384
if os.path.exists ('po/%s.po' % po_filename):
385
linguas += '%s ' % po_filename
387
files = os.listdir('%s/po' % self.path.abspath())
390
if f.endswith('.po'):
391
linguas += '%s ' % f[:-3]
392
f = open("po/LINGUAS", "w")
393
f.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
357
398
is_win32 = target_is_win32(bld.env)
399
datadir = '${G_PREFIX}/${GEANYPLUGINS_DATADIR}' if is_win32 else '${GEANYPLUGINS_DATADIR}'
359
401
def build_lua(bld, p, libs):
360
402
lua_sources = [ 'geanylua/glspi_init.c', 'geanylua/glspi_app.c', 'geanylua/glspi_dlg.c',
383
425
bld.install_files('%s/geany-plugins/geanylua/work' % datadir, 'geanylua/examples/work/*.lua')
428
def build_gendoc(bld):
430
docdir = '${G_PREFIX}/doc/plugins/geanygendoc' \
431
if is_win32 else '${DOCDIR}/geanygendoc'
432
htmldocdir = '%s/html' % docdir
433
bld.install_files(docdir, 'geanygendoc/docs/manual.rst')
434
bld.install_files(htmldocdir, 'geanygendoc/docs/manual.html')
435
# install data files (Waf doesn't support installing files recursively, yet)
436
bld.install_files('%s/geany-plugins/geanygendoc/filetypes' % datadir, \
437
'geanygendoc/data/filetypes/*.conf')
386
440
def build_debug(bld, p, libs):
387
441
bld.new_task_gen(
388
442
features = 'cc cprogram',
389
443
source = [ 'geanygdb/src/ttyhelper.c' ],
390
444
includes = '. %s' % p.includes,
445
defines = 'G_LOG_DOMAIN="%s"' % p.log_domain,
391
446
target = 'ttyhelper',
393
448
install_path = '${TTYHELPERDIR}'