Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 06 Oct 2013 12:25:06 UTC Commit: a73d22a04d009e360ab5650f91291b7b632415d9 https://github.com/geany/geany-plugins/commit/a73d22a04d009e360ab5650f91291b...
Log Message: ----------- Add build support for GeanyPy using the Waf build system
Modified Paths: -------------- geanypy/wscript_build geanypy/wscript_configure geanypy/wscript_options
Modified: geanypy/wscript_build 47 files changed, 47 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# +# WAF build script for geany-plugins - GeanyPy +# +# Copyright 2013 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +from build.wafutils import build_plugin, target_is_win32 + + +# plugin config +name = 'GeanyPy' +includes = ['geanypy/src'] +libraries = ['PYGTK', 'PYEXT'] + +build_plugin(bld, name, includes=includes, libraries=libraries) + + +# install Python modules (they will be byte-compiled on install) +py_sources = ['geany/__init__.py', + 'geany/console.py', + 'geany/manager.py', + 'geany/loader.py', + 'geany/plugin.py', + 'geany/signalmanager.py'] +bld.new_task_gen( + features = 'py', + source = py_sources, + install_path = '%s/geany' % bld.env['GEANYPY_PYTHON_DIR']) + + +# install plugins +start_dir = bld.path.find_dir('plugins') +bld.install_files(bld.env['GEANYPY_PLUGIN_DIR'], start_dir.ant_glob('*.py'), cwd=start_dir)
Modified: geanypy/wscript_configure 75 files changed, 75 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# +# WAF build script for geany-plugins - GeanyPy +# +# Copyright 2013 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +from build.wafutils import add_to_env_and_define, check_cfg_cached, target_is_win32 +from waflib.Errors import ConfigurationError + +PYTHON_DETECT_DSO_CODE = """ +from distutils.sysconfig import get_config_vars +from os.path import join as path_join + +cvars = get_config_vars() +# support multiarch-enabled distributions like Ubuntu +if not 'MULTIARCH' in cvars.keys(): + cvars['MULTIARCH'] = '' +print(path_join(cvars['LIBDIR'], cvars['MULTIARCH'], cvars['LDLIBRARY'])) +""" + +# Python +conf.load('python') +conf.check_python_version((2, 6)) +conf.check_python_headers() + +if conf.env['PYTHON_VERSION'][0] == '3': + raise ConfigurationError('Python3 is not supported') + +# PyGTK +check_cfg_cached(conf, + package='pygtk-2.0', + uselib_store="PYGTK", + mandatory=True, + args='--cflags --libs') + +# try to find the Python DSO path, for details see geanypy/m4/ax_python_library.m4 +conf.start_msg('Checking for python DSO path') +try: + dso_path = conf.cmd_and_log(conf.env['PYTHON'] + ['-c', PYTHON_DETECT_DSO_CODE]) + if not dso_path: + conf.fatal('not found') +except: + conf.end_msg(False) + conf.fatal('Could not find the python DSO path') +else: + dso_path = dso_path.strip() + add_to_env_and_define(conf, 'GEANYPY_PYTHON_LIBRARY', dso_path, quote=True) + conf.end_msg(dso_path) + +# dirs +is_win32 = target_is_win32(conf) +if is_win32: + geanypy_lib_path = '%s/lib/geany-plugins/geanypy' % conf.env['G_PREFIX'] + geanypy_data_path = '%s/%s/geany-plugins/geanypy' % ( + conf.env['G_PREFIX'], conf.env['GEANYPLUGINS_DATADIR']) +else: + geanypy_lib_path = '%s/geany-plugins/geanypy' % conf.env['LIBDIR'] + geanypy_data_path = '%s/geany-plugins/geanypy' % conf.env['GEANYPLUGINS_DATADIR'] + +add_to_env_and_define(conf, 'GEANYPY_PYTHON_DIR', geanypy_lib_path, quote=True) +add_to_env_and_define(conf, 'GEANYPY_PLUGIN_DIR', '%s/plugins' % geanypy_data_path, quote=True)
Modified: geanypy/wscript_options 22 files changed, 22 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# +# WAF build script for geany-plugins - GeanyPy +# +# Copyright 2013 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# enable Python specific options +opt.tool_options('python')
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org