~ubuntu-branches/debian/sid/geany-plugins/sid

« back to all changes in this revision

Viewing changes to wscript

  • Committer: Bazaar Package Importer
  • Author(s): Evgeni Golov, Chow Loong Jin, Evgeni Golov
  • Date: 2010-09-04 23:05:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100904230500-4n99m507u6drouv5
Tags: 0.19-1
[ Chow Loong Jin ]
* New upstream release
  + Builds against geany 0.19 (Closes: #590346, #587141)
* debian/control, debian/rules:
  + Shift geany dependency to geany-plugins-common instead, since it's a
    common dependency for all plugins
* debian/control:
  + Add new packages for codenav, extrasel, gendoc, insertnum,
    prettyprinter and treebrowser plugins
  + Update build-deps:
    - Bump geany dependency to 0.19. (Closes: #573318)
    - Add libctpl-dev and python-docutils for geanygendoc
    - Add libxml2-dev for prettyprinter
  + No-change bump of Standards-Version from 3.8.3 to 3.9.0
  + Tighten dependency on geany-plugins-common (= instead of >=)
  + Add a Breaks on all geany-plugin-* packages prior to this version to
    ensure geany-plugins-common and geany-plugin-* versions match
* debian/geany-plugin-codenav.{docs,install},
  debian/geany-plugin-extrasel.{docs,install},
  geany-plugin-gendoc.{docs,install},
  geany-plugin-insertnum.{docs,install},
  geany-plugin-prettyprinter.install
  geany-plugin-treebrowser.{docs,install}:
  + Install plugin files into individual packages

[ Evgeni Golov ]
* debian/control:
  + Disable the new plugins for now.
    If you want to build them localy, just uncomment them.
  + Don't D-B on libctpl-dev (it's not in Debian yet).
  + Add myself to Uploaders.
  + Standards-Version: 3.9.1
* debian/copyright:
  + Update to include latest plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
# WAF build script for geany-plugins
5
5
#
6
 
# Copyright 2008-2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
 
6
# Copyright 2008-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
7
7
#
8
8
# This program is free software; you can redistribute it and/or modify
9
9
# it under the terms of the GNU General Public License as published by
48
48
import Options
49
49
import Utils
50
50
import preproc
 
51
from TaskGen import taskgen, feature
51
52
 
52
53
 
53
54
APPNAME = 'geany-plugins'
54
 
VERSION = '0.18'
 
55
VERSION = '0.19'
55
56
 
56
57
srcdir = '.'
57
58
blddir = '_build_'
58
59
 
59
60
 
60
61
class Plugin:
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
63
 
                self.name = n
 
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'
65
 
                self.sources = s
 
67
                self.sources = sources
66
68
                # do not include '.'
67
 
                self.includes = i
 
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
71
 
                self.libs = l
72
 
 
 
73
                self.libs = deps
73
74
 
74
75
# add a new element for your plugin
75
76
plugins = [
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 ] ]),
84
 
        Plugin('geanygdb',
 
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 ] ]),
 
89
        Plugin('GeanyGDB',
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 ] ]
92
97
                 ),
93
 
        Plugin('geanyprj', None, [ 'geanyprj/src']),
94
 
        Plugin('geanylua',
 
98
        Plugin('GeanyLUA',
95
99
                 [ 'geanylua/geanylua.c' ], # the other source files are listed in build_lua()
96
100
                 [ 'geanylua' ],
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 ] ])
99
106
]
100
107
 
101
108
'''
148
155
preproc.standard_includes = []
149
156
 
150
157
def configure(conf):
 
158
        def in_git():
 
159
                cmd = 'git ls-files >/dev/null 2>&1'
 
160
                return (Utils.exec_command(cmd) == 0)
 
161
 
 
162
        def in_svn():
 
163
                return os.path.exists('.svn')
 
164
 
151
165
        def conf_get_svn_rev():
152
166
                # try GIT
153
 
                if os.path.exists('.git'):
 
167
                if in_git():
154
168
                        cmds = [ 'git svn find-rev HEAD 2>/dev/null',
155
169
                                         'git svn find-rev origin/trunk 2>/dev/null',
156
170
                                         'git svn find-rev trunk 2>/dev/null',
157
 
                                         'git svn find-rev master 2>/dev/null' ]
 
171
                                         'git svn find-rev master 2>/dev/null'
 
172
                                        ]
158
173
                        for c in cmds:
159
174
                                try:
160
175
                                        stdout = Utils.cmd_output(c)
163
178
                                except:
164
179
                                        pass
165
180
                # try SVN
166
 
                elif os.path.exists('.svn'):
 
181
                elif in_svn():
167
182
                        try:
168
183
                                _env = None if is_win32 else {'LANG' : 'C'}
169
184
                                stdout = Utils.cmd_output(cmd='svn info --non-interactive', silent=True, env=_env)
194
209
        # we don't require intltool on Windows (it would require Perl) though it works well
195
210
        try:
196
211
                conf.check_tool('intltool')
 
212
                if 'LINGUAS' in os.environ:
 
213
                        conf.env['LINGUAS'] = os.environ['LINGUAS']
197
214
        except:
198
215
                pass
199
216
 
210
227
 
211
228
        conf.check_cfg(package='gtk+-2.0', atleast_version='2.8.0', uselib_store='GTK',
212
229
                mandatory=True, args='--cflags --libs')
213
 
        conf.check_cfg(package='geany', atleast_version='0.18', mandatory=True, args='--cflags --libs')
 
230
        conf.check_cfg(package='geany', atleast_version='0.19', mandatory=True, args='--cflags --libs')
214
231
 
215
232
        gtk_version = conf.check_cfg(modversion='gtk+-2.0') or 'Unknown'
216
233
        geany_version = conf.check_cfg(modversion='geany') or 'Unknown'
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')
294
312
        else:
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)
309
330
        print_message(conf, 'Using Geany version', geany_version)
310
331
        if svn_rev != '-1':
311
332
                print_message(conf, 'Compiling Subversion revision', svn_rev)
312
 
                conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG'.split()) # -DGEANY_DISABLE_DEPRECATED
 
333
                conf.env.append_value('CCFLAGS', '-g -DDEBUG'.split()) # -DGEANY_DISABLE_DEPRECATED
313
334
 
314
335
        print_message(conf, 'Plugins to compile', ' '.join(enabled_plugins))
315
336
 
353
374
                { '1' : plugins[0].name, '2' : plugins[1].name }, dest='skip_plugins')
354
375
 
355
376
 
 
377
@taskgen
 
378
@feature('intltool_po')
 
379
def write_linguas_file(self):
 
380
        linguas = ''
 
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
 
386
        else:
 
387
                files = os.listdir('%s/po' % self.path.abspath())
 
388
                files.sort()
 
389
                for f in files:
 
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)
 
394
        f.close()
 
395
 
 
396
 
356
397
def build(bld):
357
398
        is_win32 = target_is_win32(bld.env)
 
399
        datadir = '${G_PREFIX}/${GEANYPLUGINS_DATADIR}' if is_win32 else '${GEANYPLUGINS_DATADIR}'
358
400
 
359
401
        def build_lua(bld, p, libs):
360
402
                lua_sources = [ 'geanylua/glspi_init.c', 'geanylua/glspi_app.c', 'geanylua/glspi_dlg.c',
365
407
                        features                = 'cc cshlib',
366
408
                        source                  = lua_sources,
367
409
                        includes                = '. %s' % p.includes,
 
410
                        defines                 = 'G_LOG_DOMAIN="%s"' % p.log_domain,
368
411
                        target                  = 'libgeanylua',
369
412
                        uselib                  = libs,
370
413
                        install_path    = '${G_PREFIX}/lib/geany-plugins/geanylua' if is_win32
375
418
                docdir = '${G_PREFIX}/doc/plugins/geanylua' if is_win32 else '${DOCDIR}/geanylua'
376
419
                bld.install_files(docdir, 'geanylua/docs/*.html')
377
420
                # install examples (Waf doesn't support installing files recursively, yet)
378
 
                datadir = '${G_PREFIX}/share/' if is_win32 else '${DATADIR}'
379
421
                bld.install_files('%s/geany-plugins/geanylua/dialogs' % datadir, 'geanylua/examples/dialogs/*.lua')
380
422
                bld.install_files('%s/geany-plugins/geanylua/edit' % datadir, 'geanylua/examples/edit/*.lua')
381
423
                bld.install_files('%s/geany-plugins/geanylua/info' % datadir, 'geanylua/examples/info/*.lua')
383
425
                bld.install_files('%s/geany-plugins/geanylua/work' % datadir, 'geanylua/examples/work/*.lua')
384
426
 
385
427
 
 
428
        def build_gendoc(bld):
 
429
                # install docs
 
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')
 
438
 
 
439
 
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',
392
447
                        uselib          = libs,
393
448
                        install_path = '${TTYHELPERDIR}'
418
473
                if p.name == 'geanylua':
419
474
                        build_lua(bld, p, libs) # build additional lib for the lua plugin
420
475
 
 
476
                if p.name == 'geanygendoc':
 
477
                        build_gendoc(bld) # install data files
 
478
 
421
479
                if p.name == 'geanygdb':
422
480
                        build_debug(bld, p, libs) # build additional binary for the debug plugin
423
481
 
425
483
                        features                = 'cc cshlib',
426
484
                        source                  = p.sources,
427
485
                        includes                = '. %s' % p.includes,
 
486
                        defines                 = 'G_LOG_DOMAIN="%s"' % p.log_domain,
428
487
                        target                  = p.name,
429
488
                        uselib                  = libs,
430
489
                        install_path    = '${G_PREFIX}/lib' if is_win32 else '${LIBDIR}/geany/'
498
557
# Simple function to execute a command and print its exit status
499
558
def launch(command, status, success_color='GREEN'):
500
559
        ret = 0
 
560
        error_message = ''
501
561
        Utils.pprint(success_color, status)
502
562
        try:
503
563
                ret = Utils.exec_command(command)
504
564
        except OSError, e:
505
565
                ret = 1
506
 
                print str(e), ":", command
507
 
        except:
508
 
                ret = 1
 
566
                error_message = ' (%s: %s)' % (str(e), command)
509
567
 
510
568
        if ret != 0:
511
 
                Utils.pprint('RED', status + ' failed')
 
569
                Utils.pprint('RED', '%s failed%s' % (status, error_message))
512
570
 
513
571
        return ret
514
572