From b62fbb5ae872fc486fcb58b6a183019ab9ce801c Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sat, 16 Apr 2011 12:31:54 -0700 Subject: [PATCH] Resurrected standalone python module --- Makefile.am | 2 - autogen.sh | 17 ++-- configure.ac | 42 +++++++-- doc/Makefile.am | 2 + m4/moo-python.m4 | 17 ++-- moo/Makefile.am | 1 + moo/medit-app/Makefile.incl | 22 ++--- moo/medit-module/Makefile.incl | 36 ++++++++ moo/medit-module/medit-module.cpp | 7 ++ moo/medit-module/moo.rc.in | 30 +++++++ moo/moopython/moopython-builtin.c | 37 ++++++-- moo/moopython/plugins/terminal.py | 2 +- moo/moopython/pygtk/moo-pygtk.c | 20 +---- moo/moopython/pygtk/moo-pygtk.h | 2 +- moo/moopython/pygtk/moo.py | 13 +-- moo/moopython/pygtk/old/mooedit-mod.py | 120 ------------------------- plat/win32/gtk-win/config.sh | 4 +- plat/win32/mingw-configure | 6 ++ tools/release.sh | 23 ++++- 19 files changed, 219 insertions(+), 184 deletions(-) create mode 100644 moo/medit-module/Makefile.incl create mode 100644 moo/medit-module/medit-module.cpp create mode 100644 moo/medit-module/moo.rc.in delete mode 100644 moo/moopython/pygtk/old/mooedit-mod.py diff --git a/Makefile.am b/Makefile.am index 4adff88f..37c20a85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,8 +42,6 @@ test: $(MAKE) $(AM_MAKEFLAGS) installcheck fullcheck: $(MAKE) $(AM_MAKEFLAGS) test - DISTCHECK_CONFIGURE_FLAGS='MAKEFLAGS=-j3 --without-python --enable-silent-rules CFLAGS="-Werror -Wall -O2" CXXFLAGS="-Werror -Wall -O2"' \ - $(MAKE) $(AM_MAKEFLAGS) distcheck $(MAKE) $(AM_MAKEFLAGS) distcheck @MOO_PO_SUBDIRS_RULE@ diff --git a/autogen.sh b/autogen.sh index 3942198b..1f695a26 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,22 +9,29 @@ srcdir=`cd "$rel_srcdir" && pwd` cd "$srcdir" -# autoreconf --verbose --install --force || exit $! - run_cmd() { echo "$@" "$@" || exit $! } -# run_cmd libtoolize --copy --force +run_cmd libtoolize --copy --force run_cmd $ACLOCAL --force -I m4 $ACLOCAL_FLAGS run_cmd $AUTOCONF --force run_cmd $AUTOHEADER --force run_cmd $AUTOMAKE --add-missing --copy --force-missing +cd $workingdir + +run_configure=true +configure_args="--enable-dev-mode --enable-silent-rules" if [ "$1" ]; then - cd $workingdir && run_cmd $rel_srcdir/configure --enable-dev-mode "$@" + : else - echo "Done. Run '$rel_srcdir/configure --enable-dev-mode' to configure" + echo "Done. Run '$rel_srcdir/configure --enable-dev-mode' to configure and then 'make' to build" + run_configure=false +fi + +if $run_configure; then + run_cmd $rel_srcdir/configure $configure_args "$@" fi diff --git a/configure.ac b/configure.ac index 88772ec5..c301acf7 100644 --- a/configure.ac +++ b/configure.ac @@ -21,8 +21,10 @@ AC_GNU_SOURCE AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(ACLOCAL_FLAGS) -AM_INIT_AUTOMAKE([1.11 silent-rules foreign dist-bzip2 no-dist-gzip]) -# LT_INIT([disable-shared]) +AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2 no-dist-gzip]) +AM_SILENT_RULES([yes]) +LT_INIT([disable-shared]) +# AC_PROG_RANLIB AC_SUBST(MOO_MAJOR_VERSION,_moo_major_version_) AC_SUBST(MOO_MINOR_VERSION,_moo_minor_version_) @@ -54,12 +56,11 @@ AC_PROG_CXX AC_PROG_INSTALL AC_PROG_MKDIR_P AM_PROG_CC_C_O -AC_PROG_RANLIB AC_ARG_VAR([WINDRES], [windres]) AC_CHECK_TOOL(WINDRES, windres, :) -AC_ARG_VAR([PYTHON], [Python executable, used to run build scripts]) +AC_ARG_VAR([PYTHON], [Python executable, required to run build scripts]) AC_CHECK_PROGS(PYTHON, python, [AC_MSG_ERROR([Python not found])]) MOO_AC_FLAGS @@ -89,6 +90,33 @@ AC_DEFINE_UNQUOTED(MOO_WEB_CONTACT,["$MOO_WEB_CONTACT"],MOO_WEB_CONTACT) MOO_AC_CHECK_OS MOO_AC_PYTHON +MOO_BUILD_APP=true +MOO_BUILD_MODULE=false +AC_ARG_ENABLE(moo-module, + AC_HELP_STRING([--enable-moo-module],[build standalone python module instead of medit, default NO (you must also use --enable-shared with this option)]),[ + if test "$enable_moo_module" = "yes"; then + MOO_BUILD_APP=false + MOO_BUILD_MODULE=true + fi +]) +if $MOO_BUILD_MODULE; then + if ! $MOO_ENABLE_PYTHON; then + AC_MSG_ERROR([Python bindings are not enabled, can't build python module]) + elif test "$enable_shared" != "yes"; then + AC_MSG_ERROR([Python module can't be built without --enable-shared option]) + fi +fi + +if $MOO_BUILD_APP; then + AC_DEFINE(MOO_BUILD_APP, 1, [build medit application]) +fi +if $MOO_BUILD_MODULE; then + AC_DEFINE(MOO_BUILD_MODULE, 1, [build standalone python module]) +fi + +AM_CONDITIONAL(MOO_BUILD_APP, [$MOO_BUILD_APP]) +AM_CONDITIONAL(MOO_BUILD_MODULE, [$MOO_BUILD_MODULE]) + AC_SUBST(MOO_TOP_SRCDIR,`cd $srcdir && pwd`) if test x"$MOO_TOP_SRCDIR" = x"`pwd`"; then AC_SUBST(MOO_CP_TO_SRCDIR,true) @@ -130,7 +158,11 @@ AC_ARG_ENABLE(install-hooks, AC_HELP_STRING([--enable-install-hooks],[run gtk-update-icon-cache during 'make install']),[ MOO_ENABLE_INSTALL_HOOKS="$enable_install_hooks" ],[ - MOO_ENABLE_INSTALL_HOOKS="yes" + if $MOO_BUILD_APP; then + MOO_ENABLE_INSTALL_HOOKS="yes" + else + MOO_ENABLE_INSTALL_HOOKS="no" + fi ]) AM_CONDITIONAL(MOO_ENABLE_INSTALL_HOOKS, test "x$MOO_ENABLE_INSTALL_HOOKS" = "xyes") diff --git a/doc/Makefile.am b/doc/Makefile.am index 06077ae5..745b0670 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -146,5 +146,7 @@ uninstall-local: $(DESTDIR)$(MOO_HELP_DIR)/img/*.png if MOO_OS_UNIX +if MOO_BUILD_APP dist_man_MANS = built/medit.1 +endif MOO_BUILD_APP endif MOO_OS_UNIX diff --git a/m4/moo-python.m4 b/m4/moo-python.m4 index 21fd7d7b..97a2239a 100644 --- a/m4/moo-python.m4 +++ b/m4/moo-python.m4 @@ -107,20 +107,27 @@ AC_DEFUN([MOO_AC_CHECK_PYTHON_NATIVE],[ AC_DEFUN([MOO_AM_PYTHON_DEVEL_CROSS_MINGW],[ - if test x"$PYTHON_INCLUDES" = x; then - AC_MSG_ERROR([PYTHON_INCLUDES is not set]) - fi - if test x"$PYTHON_LIBS" = x; then - AC_MSG_ERROR([PYTHON_LIBS is not set]) + if test x"$PYTHON_INCLUDES" = x -o x"$PYTHON_LIBS" = x -o x"$PYTHON_VERSION" = x; then + AC_MSG_ERROR([The following variables must be set: PYTHON_INCLUDES, PYTHON_LIBS, PYTHON_VERSION]) fi AC_ARG_VAR([PYTHON_INCLUDES], [python preprocessor flags]) AC_ARG_VAR([PYTHON_LIBS], [python linker flags]) + AC_ARG_VAR([PYTHON_VERSION], [python version]) + AC_SUBST(PYTHON_INCLUDES) AC_SUBST(PYTHON_LIBS) AC_MSG_CHECKING([for Python include path]) AC_MSG_RESULT([$PYTHON_INCLUDES]) AC_MSG_CHECKING([for Python linker flags]) AC_MSG_RESULT([$PYTHON_LIBS]) + + AC_SUBST([PYTHON_VERSION],[$PYTHON_VERSION]) + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + AC_SUBST([PYTHON_PLATFORM], [nt]) + AC_SUBST([pythondir], [$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages]) + AC_SUBST([pyexecdir], [$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages]) + $1 ]) diff --git a/moo/Makefile.am b/moo/Makefile.am index cc5b033d..6daf31a9 100644 --- a/moo/Makefile.am +++ b/moo/Makefile.am @@ -37,6 +37,7 @@ include moolua/Makefile.incl include moopython/Makefile.incl include plugins/Makefile.incl include medit-app/Makefile.incl +include medit-module/Makefile.incl BUILT_SOURCES += $(built_moo_sources) $(built_plugin_sources) CLEANFILES += $(built_moo_sources) $(built_plugin_sources) diff --git a/moo/medit-app/Makefile.incl b/moo/medit-app/Makefile.incl index c865ec5b..e49c6e9d 100644 --- a/moo/medit-app/Makefile.incl +++ b/moo/medit-app/Makefile.incl @@ -1,5 +1,3 @@ -bin_PROGRAMS += medit - EXTRA_DIST += medit-app/data dist-hook: delete-junk-from-data delete-junk-from-data: @@ -11,6 +9,13 @@ EXTRA_DIST += \ medit-app/run-tests-installed.sh \ medit-app/run-tests-uninstalled.sh +EXTRA_DIST += medit-app/medit.rc.in +EXTRA_DIST += medit-app/medit.desktop.in + +if MOO_BUILD_APP + +bin_PROGRAMS += medit + TESTS = medit-app/run-tests-uninstalled.sh TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) top_srcdir=$(top_srcdir) bindir=$(bindir) PYTHON=$(PYTHON) print_functions=$(srcdir)/medit-app/print-functions.py @@ -47,20 +52,11 @@ nodist_medit_SOURCES = \ $(built_moo_sources) \ $(built_plugins_sources) -BUILT_SOURCES += \ - $(built_moo_sources) \ - $(built_plugins_sources) - -CLEANFILES += \ - $(built_moo_sources) \ - $(built_plugins_sources) - medit_LDFLAGS = if MOO_OS_WIN32 medit_LDFLAGS += -mwindows endif -EXTRA_DIST += medit-app/medit.rc.in if MOO_OS_WIN32 CLEANFILES += medit-app/medit.rc medit-app/medit.res medit-app/medit.rc: medit-app/medit.rc.in $(top_builddir)/config.status @@ -71,7 +67,6 @@ medit-app/medit.res: medit-app/medit.rc medit_LDADD += medit-app/medit.res endif -EXTRA_DIST += medit-app/medit.desktop.in if MOO_OS_UNIX desktopdir = $(datadir)/applications desktop_DATA = medit-app/medit.desktop @@ -81,7 +76,6 @@ medit-app/medit.desktop: medit-app/medit.desktop.in @MOO_INTLTOOL_INI_DEPS@ CLEANFILES += medit-app/medit.desktop endif MOO_OS_UNIX - iconthemedir = $(datadir)/icons/hicolor/48x48/apps icontheme_DATA = mooutils/pixmaps/medit.png if MOO_ENABLE_INSTALL_HOOKS @@ -98,3 +92,5 @@ uninstall-hook: uninstall-data-hook-gtk-icon-cache uninstall-data-hook-gtk-icon-cache: @if echo "Updating icon cache" && $(update_icon_cache); then echo "Done."; else echo "Failed."; fi endif + +endif MOO_BUILD_APP diff --git a/moo/medit-module/Makefile.incl b/moo/medit-module/Makefile.incl new file mode 100644 index 00000000..45ec4a08 --- /dev/null +++ b/moo/medit-module/Makefile.incl @@ -0,0 +1,36 @@ +if MOO_BUILD_MODULE + +pyexec_LTLIBRARIES = _moo.la +_moo_la_LDFLAGS = -avoid-version -module +_moo_la_CFLAGS = $(AM_CFLAGS) +_moo_la_CXXFLAGS = $(AM_CXXFLAGS) + +if MOO_OS_WIN32 +_moo_la_LDFLAGS += -no-undefined -shrext .pyd +endif + +python_DATA = moopython/pygtk/moo.py + +_moo_la_SOURCES = \ + medit-module/medit-module.cpp \ + $(moo_sources) \ + $(plugins_sources) + +_moo_la_LIBADD = $(MOO_LIBS) $(moo_libadd) + +nodist__moo_la_SOURCES = \ + $(built_moo_sources) \ + $(built_plugins_sources) + +EXTRA_DIST += medit-module/moo.rc.in +if MOO_OS_WIN32 +CLEANFILES += medit-module/moo.rc medit-module/moo.res +medit-module/moo.rc: medit-module/moo.rc.in $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) medit-module + $(AM_V_GEN)cd $(top_builddir) && ./config.status --silent --file=moo/medit-module/moo.rc +medit-module/moo.res: medit-module/moo.rc + $(AM_V_GEN)$(WINDRES) -i medit-module/moo.rc --input-format=rc -o medit-module/moo.res -O coff +_moo_la_LIBADD += medit-module/moo.res +endif + +endif MOO_BUILD_MODULE diff --git a/moo/medit-module/medit-module.cpp b/moo/medit-module/medit-module.cpp new file mode 100644 index 00000000..d5720374 --- /dev/null +++ b/moo/medit-module/medit-module.cpp @@ -0,0 +1,7 @@ +#include + +extern "C" +void init_moo (void) +{ + _moo_module_init (); +} diff --git a/moo/medit-module/moo.rc.in b/moo/medit-module/moo.rc.in new file mode 100644 index 00000000..0613e3ef --- /dev/null +++ b/moo/medit-module/moo.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @MOO_MAJOR_VERSION@,@MOO_MINOR_VERSION@,@MOO_MICRO_VERSION@,0 + PRODUCTVERSION @MOO_MAJOR_VERSION@,@MOO_MINOR_VERSION@,@MOO_MICRO_VERSION@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "@MOO_WEBSITE@" + VALUE "FileDescription", "moo" + VALUE "FileVersion", "@MOO_MAJOR_VERSION@.@MOO_MINOR_VERSION@.@MOO_MICRO_VERSION@.0" + VALUE "InternalName", "moo" + VALUE "LegalCopyright", "@MOO_COPYRIGHT@" + VALUE "OriginalFilename", "moo.pyd" + VALUE "ProductName", "moo" + VALUE "ProductVersion", "@MOO_DISPLAY_VERSION@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END diff --git a/moo/moopython/moopython-builtin.c b/moo/moopython/moopython-builtin.c index 88a7e1b7..2792fde0 100644 --- a/moo/moopython/moopython-builtin.c +++ b/moo/moopython/moopython-builtin.c @@ -28,6 +28,27 @@ #include "moopython/pygtk/moo-pygtk.h" #include "moopython/moopython-pygtkmod.h" #include "mooutils/mooutils-misc.h" +#include "moopython/pygtk/moo-mod.h" + +static gboolean create_moo_module (void) +{ + PyObject *moo_module; + PyObject *code; + + code = Py_CompileString (MOO_PY, "moo.py", Py_file_input); + + if (!code) + return FALSE; + + moo_module = PyImport_ExecCodeModule ((char*) "moo", code); + + if (!moo_module) + PyErr_Print (); + + Py_DECREF (code); + + return !PyErr_Occurred (); +} gboolean _moo_python_builtin_init (void) @@ -40,17 +61,23 @@ _moo_python_builtin_init (void) return FALSE; } - if (!_moo_pygtk_init ()) + if (!_moo_module_init ()) + { + g_warning ("could not initialize _moo module"); + PyErr_Print (); + moo_python_api_deinit (); + return FALSE; + } + + reset_log_func (); + + if (!create_moo_module ()) { g_warning ("could not initialize moo module"); PyErr_Print (); moo_python_api_deinit (); return FALSE; } - -#ifndef MOO_BUILD_MOO_MODULE - reset_log_func (); -#endif } if (!moo_plugin_loader_lookup (MOO_PYTHON_PLUGIN_LOADER_ID)) diff --git a/moo/moopython/plugins/terminal.py b/moo/moopython/plugins/terminal.py index 95bc1dcc..05c4734a 100644 --- a/moo/moopython/plugins/terminal.py +++ b/moo/moopython/plugins/terminal.py @@ -24,7 +24,7 @@ from moo import D_ try: import vte except ImportError: - moo.cancel_plugin_loading() + moo._cancel_plugin_loading() TERMINAL_PLUGIN_ID = "Terminal" COLOR_SCHEME_KEY = 'Plugins/Terminal/color_scheme' diff --git a/moo/moopython/pygtk/moo-pygtk.c b/moo/moopython/pygtk/moo-pygtk.c index 7abda9b5..aaba5636 100644 --- a/moo/moopython/pygtk/moo-pygtk.c +++ b/moo/moopython/pygtk/moo-pygtk.c @@ -19,7 +19,6 @@ #include "config.h" #endif -#include "moopython/pygtk/moo-mod.h" #include "moopython/pygtk/moo-pygtk.h" #include "moopython/moopython-utils.h" #include /* _PyGObjectAPI lives here */ @@ -75,11 +74,9 @@ py_object_to_moo_py_object (GValue *value, PyObject *obj) } gboolean -_moo_pygtk_init (void) +_moo_module_init (void) { PyObject *_moo_module = NULL; - PyObject *moo_module = NULL; - PyObject *code; init_pygtk_mod (); @@ -102,21 +99,6 @@ _moo_pygtk_init (void) _moo_add_constants (_moo_module, "MOO_"); _moo_register_classes (PyModule_GetDict (_moo_module)); - if (PyErr_Occurred ()) - return FALSE; - - code = Py_CompileString (MOO_PY, "moo.py", Py_file_input); - - if (!code) - return FALSE; - - moo_module = PyImport_ExecCodeModule ((char*) "moo", code); - - if (!moo_module) - PyErr_Print (); - - Py_DECREF (code); - return !PyErr_Occurred (); } diff --git a/moo/moopython/pygtk/moo-pygtk.h b/moo/moopython/pygtk/moo-pygtk.h index 430457b5..b82bbd5b 100644 --- a/moo/moopython/pygtk/moo-pygtk.h +++ b/moo/moopython/pygtk/moo-pygtk.h @@ -21,7 +21,7 @@ G_BEGIN_DECLS -gboolean _moo_pygtk_init (void); +gboolean _moo_module_init (void); extern const PyMethodDef _moo_functions[]; diff --git a/moo/moopython/pygtk/moo.py b/moo/moopython/pygtk/moo.py index 7a698d53..783be142 100644 --- a/moo/moopython/pygtk/moo.py +++ b/moo/moopython/pygtk/moo.py @@ -19,20 +19,21 @@ import gtk as _gtk import gobject as _gobject from _moo import * +# note, these aren't standard gettext functions _ = gettext D_ = dgettext +def N_(string): + return string + class _PluginWontLoad(Exception): def __repr__(self): return 'PluginWontLoad' -def cancel_plugin_loading(): +def _cancel_plugin_loading(): raise _PluginWontLoad() -def N_(string): - return string - -class ActionFactory(object): +class _ActionFactory(object): def __init__(self, action_id, **kwargs): object.__init__(self) self.id = action_id @@ -70,4 +71,4 @@ def window_class_add_action(klass, action_id, group=None, **kwargs): if kwargs.has_key("factory"): _moo._window_class_add_action(klass, action_id, group, kwargs["factory"]) else: - _moo._window_class_add_action(klass, action_id, group, ActionFactory(action_id, **kwargs)) + _moo._window_class_add_action(klass, action_id, group, _ActionFactory(action_id, **kwargs)) diff --git a/moo/moopython/pygtk/old/mooedit-mod.py b/moo/moopython/pygtk/old/mooedit-mod.py deleted file mode 100644 index 57a1f296..00000000 --- a/moo/moopython/pygtk/old/mooedit-mod.py +++ /dev/null @@ -1,120 +0,0 @@ -# -# mooedit-mod.py -# -# Copyright (C) 2004-2010 by Yevgen Muntyan -# -# This file is part of medit. medit is free software; you can -# redistribute it and/or modify it under the terms of the -# GNU Lesser General Public License as published by the -# Free Software Foundation; either version 2.1 of the License, -# or (at your option) any later version. -# -# You should have received a copy of the GNU Lesser General Public -# License along with medit. If not, see . -# - -"""moo.edit module - -Contains text editor and stuff. - -To get an instance of Editor, the object which manages document instances, -use Editor.instance(). -To create new or open existing document, use Editor.create_doc(). -To save or close document use Edit.save() and Edit.close(). -To find out status of document (unsaved, deleted from disk, etc.) use -Edit.get_status, it returns flags from EditStatus class. - -Note that by default Editor shows alerts in various places, like when -user tries to close document with unsaved changes. To disable this, -use 'silent' property: editor.set_property("silent", True). -""" -import _moo_edit as _edit -from _moo_edit import * -#from _moo_edit import Plugin as _Plugin -#import gobject - -def edit_class_add_action(cls, action_id, action_class): - _edit._edit_class_add_action(cls, action_id, action_class) - -class _PluginWontLoad(Exception): - def __repr__(self): - return 'PluginWontLoad' - -def cancel_plugin_loading(): - raise _PluginWontLoad() - -#class _UIInfo(object): - #def __init__(self, parent, action, name=None, index=-1): - #self.parent = parent - #self.action = action - #self.name = name or action - #self.index = index - -#class _WindowActionInfo(object): - #def __init__(self, window_type, id, **kwargs): - #self.window_type = window_type - #self.id = id - #self.props = kwargs - -#class _EditActionInfo(object): - #def __init__(self, id, action_type, edit_type = Edit): - #self.id = id - #self.action_type = action_type - #self.edit_type = edit_type - -#class Plugin(_Plugin): - #def __init__(self): - #_Plugin.__init__(self) - - #self._window_actions = [] - #self._edit_actions = [] - #self._ui_merge_id = 0 - #self._ui = [] - - #def do_init(self): - #import moo - - #for a in self._window_actions: - #moo.utils.window_class_add_action(a.window_type, a.id, **a.props) - - #for a in self._edit_actions: - #edit_class_add_action(a.edit_type, a.id, a.action_type) - - #if self._ui: - #editor = Editor.instance() - #xml = editor.get_ui_xml() - #self._ui_merge_id = xml.new_merge_id() - #for item in self._ui: - #xml.add_item(self._ui_merge_id, item.parent, - #item.name, item.action, item.index) - - #return True - - #def do_deinit(self): - #import moo - - #if self._ui_merge_id: - #editor = Editor.instance() - #xml = editor.get_ui_xml() - #xml.remove_ui(self._ui_merge_id) - #self._ui_merge_id = 0 - - #for a in self._window_actions: - #moo.utils.window_class_remove_action(a.window_type, a.id) - - #for a in self._edit_actions: - #edit_class_remove_action(a.edit_type, a.id) - - #""" add_ui(self, parent, action, name=None, index=-1) -> None""" - #def add_ui(self, *args, **kwargs): - #self._ui.append(_UIInfo(*args, **kwargs)) - - #""" add_edit_action(self, id, action_type, edit_type = Edit) -> None""" - #def add_edit_action(self, *args, **kwargs): - #self._edit_actions.append(_EditActionInfo(*args, **kwargs)) - - #""" add_window_action(self, window_type, id, **kwargs) -> None""" - #def add_window_action(self, *args, **kwargs): - #self._window_actions.append(_WindowActionInfo(*args, **kwargs)) - -#gobject.type_register(Plugin) diff --git a/plat/win32/gtk-win/config.sh b/plat/win32/gtk-win/config.sh index 841993d7..546f69aa 100644 --- a/plat/win32/gtk-win/config.sh +++ b/plat/win32/gtk-win/config.sh @@ -1,5 +1,7 @@ export mgwbuildroot=$HOME/projects/gtk-win-build -export mgwpythonver=27 +export mgwpythondotver=2.7 + +export mgwpythonver=`echo $mgwpythondotver | sed 's/[.]//'` export mgwdir_s=$mgwdir export mgwdir=`cd $mgwdir && pwd` diff --git a/plat/win32/mingw-configure b/plat/win32/mingw-configure index abfd7c22..ca83a4bb 100755 --- a/plat/win32/mingw-configure +++ b/plat/win32/mingw-configure @@ -72,6 +72,7 @@ export PKG_CONFIG_PATH="$mgwtargetdir/lib/pkgconfig" export PYTHON_INCLUDES="-I$mgwtargetdir/include/python" export PYTHON_LIBS="-lpython$mgwpythonver" +export PYTHON_VERSION=$mgwpythondotver configure_args="--build=i686-pc-linux-gnu --host=i586-pc-mingw32msvc --target=i586-pc-mingw32msvc \ AR=$AR RANLIB=$RANLIB STRIP=$STRIP AS=$AS DLLTOOL=$DLLTOOL OBJDUMP=$OBJDUMP NM=$NM WINDRES=$WINDRES RC=$RC \ @@ -90,5 +91,10 @@ else moo_configure_args='--enable-dev-mode' fi +if [ "$1" = "--python" ]; then + shift + moo_configure_args="$moo_configure_args --enable-moo-module --enable-shared --disable-static" +fi + echo $srcdir/configure $configure_args $moo_configure_args $moo_nls_flags "$@" exec $srcdir/configure $configure_args $moo_configure_args $moo_nls_flags "$@" diff --git a/tools/release.sh b/tools/release.sh index 23d41a5d..346dce4e 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -38,13 +38,32 @@ check_unix() { set_title "medit-release unix build" do_or_die mkdir $tmpdir/build-unix do_or_die cd $tmpdir/build-unix - do_or_die $tmpdir/medit/configure --enable-dev-mode --enable-silent-rules + do_or_die $tmpdir/medit/configure --enable-dev-mode do_or_die make set_title "medit-release unix fullcheck" do_or_die make fullcheck do_or_die mv medit-*.tar.bz2 $tmpdir/files/ } +check_no_python() { + set_title "medit-release unix-no-python build" + do_or_die mkdir $tmpdir/build-unix-no-python + do_or_die cd $tmpdir/build-unix-no-python + do_or_die $tmpdir/medit/configure --enable-dev-mode --without-python + do_or_die make + set_title "medit-release unix-no-python fullcheck" + do_or_die make fullcheck + do_or_die mv medit-*.tar.bz2 $tmpdir/files/ +} + +check_python() { + set_title "medit-release unix-python build" + do_or_die mkdir $tmpdir/build-unix-python + do_or_die cd $tmpdir/build-unix-python + do_or_die $tmpdir/medit/configure --enable-dev-mode --enable-moo-module --disable-static + do_or_die make +} + check_windows() { set_title "medit-release windows build" do_or_die mkdir $tmpdir/build-windows @@ -58,6 +77,8 @@ check_windows() { prepare check_unix +check_no_python +check_python check_windows echo "============================================================="