Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

multiterm: Preliminary Waf build and configure scripts

  • Loading branch information...
commit 3eed5f8676e71f44a9a7e8bb4b6528aa9e84f164 1 parent 74491b7
Matthew Brush authored December 18, 2011 pzoxiuv committed January 22, 2012
66  multiterm/wscript_build
... ...
@@ -0,0 +1,66 @@
  1
+# -*- coding: utf-8 -*-
  2
+#
  3
+# WAF build script for geany-plugins - MultiTerm
  4
+#
  5
+# Copyright 2011 Matthew Brush <matt(at)geany(dot)org>
  6
+#
  7
+# This program is free software; you can redistribute it and/or modify
  8
+# it under the terms of the GNU General Public License as published by
  9
+# the Free Software Foundation; either version 2 of the License, or
  10
+# (at your option) any later version.
  11
+#
  12
+# This program is distributed in the hope that it will be useful,
  13
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  14
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15
+# GNU General Public License for more details.
  16
+#
  17
+# You should have received a copy of the GNU General Public License
  18
+# along with this program; if not, write to the Free Software
  19
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20
+#
  21
+
  22
+from build.wafutils import target_is_win32, install_docs
  23
+
  24
+def build_vala_plugin(ctx, name, sources, vapi_dirs=None, packages=None,
  25
+    libraries=None, features=None):
  26
+    """
  27
+    Similar to build.wafutils.build_plugin() except it's for Vala.
  28
+    TODO: move this function to that module and make the
  29
+    geany.vapi/deps available for other plugins.
  30
+    """
  31
+    log_domain = name
  32
+    plugin_name = name.lower()
  33
+    vapi_dirs = vapi_dirs or []
  34
+    packages = packages or []
  35
+    libraries = libraries or []
  36
+    features = features or []
  37
+
  38
+    libraries.extend(['GTK', 'GEANY'])
  39
+    features.extend(['c', 'cshlib'])
  40
+
  41
+    install_path = '${G_PREFIX}/lib' if target_is_win32(ctx) else '${LIBDIR}/geany/'
  42
+
  43
+    task = ctx.shlib(packages = packages,
  44
+                     features = features,
  45
+                     target = plugin_name,
  46
+                     source = sources,
  47
+                     vapi_dirs = vapi_dirs,
  48
+                     use = libraries,
  49
+                     vala_defines = [ 'G_LOG_DOMAIN="%s"' % log_domain ],
  50
+                     install_path = install_path)
  51
+
  52
+    install_docs(ctx, plugin_name,
  53
+        'AUTHORS ChangeLog COPYING NEWS README THANKS TODO'.split())
  54
+
  55
+    return task
  56
+
  57
+
  58
+name = 'MultiTerm'
  59
+sources = [ 'src/config.vala', 'src/context-menu.vala', 'src/defconf.vala',
  60
+    'src/notebook.vala', 'src/plugin.vala', 'src/shell-config.vala',
  61
+    'src/tab-label.vala', 'src/terminal.vala']
  62
+packages = [ 'gtk+-2.0', 'glib-2.0', 'vte', 'geany' ]
  63
+libraries = [ 'GTK', 'GLIB', 'VTE', 'GEANY' ]
  64
+vapi_dirs = [ 'src/vapi' ]
  65
+
  66
+build_vala_plugin(bld, name, sources, vapi_dirs, packages, libraries)
33  multiterm/wscript_configure
... ...
@@ -0,0 +1,33 @@
  1
+# -*- coding: utf-8 -*-
  2
+#
  3
+# WAF configure script for geany-plugins - MultiTerm
  4
+#
  5
+# Copyright 2011 Matthew Brush <matt(at)geany(dot)org>
  6
+#
  7
+# This program is free software; you can redistribute it and/or modify
  8
+# it under the terms of the GNU General Public License as published by
  9
+# the Free Software Foundation; either version 2 of the License, or
  10
+# (at your option) any later version.
  11
+#
  12
+# This program is distributed in the hope that it will be useful,
  13
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  14
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15
+# GNU General Public License for more details.
  16
+#
  17
+# You should have received a copy of the GNU General Public License
  18
+# along with this program; if not, write to the Free Software
  19
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20
+#
  21
+
  22
+from build.wafutils import check_cfg_cached
  23
+
  24
+conf.load('vala', funs='')
  25
+conf.check_vala(min_version=(0,12,0))
  26
+
  27
+packages = [('gtk+-2.0', 'GTK'),
  28
+            ('glib-2.0', 'GLIB'),
  29
+            ('vte', 'VTE'),
  30
+            ('geany', 'GEANY')]
  31
+
  32
+for pkg, var in packages:
  33
+    check_cfg_cached(conf, package=pkg, uselib_store=var, args='--cflags --libs')

0 notes on commit 3eed5f8

Please sign in to comment.
Something went wrong with that request. Please try again.