Unified Demos

Moo module tips

The download page will always contain the recommended instructions for getting the moo module installed as quickly as possible. Fans of the Medit text editor may want to have the module and the editor installed concurrently. They might also wish to do so without a large duplication of code. For each version of Medit, this page will contain the recommended steps for achieving such a configuration. I am grateful to Yevgen Muntyan, the author of Medit, for the help he has given me in this area.

0.9 series

The older versions of Medit are the most flexible in this regard. The autoconf-based configure script accepts flags for getting the executable and the module to share code. Simply run:

tar -xf medit-0.9.4.tar.bz2
cd medit-0.9.4
./configure --enable-moo-module --enable-medit --enable-libmoo
make
sudo make install

0.10 series

Starting with version 0.10.0, Muntyan dropped autotools in favour of CMake. While CMake has its advantages, it does not support convenience libraries which essentially means that static archives have to be used as libraries, not sources. The build system that compiled the Python bindings in Medit 0.9 relied heavily on convenience libraries so I had to write a patch in order to still allow them to be built. The steps required to use this patch are:

tar -xf medit-0.10.5.tar.bz2
cd medit-0.10.5
patch -Np1 -i ../bindings2.diff
touch plugins/moopython/pygtk/mooapp-pygtk.c
touch plugins/moopython/pygtk/mooedit-pygtk.c
touch plugins/moopython/pygtk/mooutils-pygtk.c
cmake . -DMOO_ENABLE_PTHON=ON
make
sudo make install
sudo mv /usr/lib/python2.7/site-packages/libmoomod.so /usr/lib/python2.7/site-packages/moo.so

Incidentally, I wrote another patch for Medit shortly after. This was because my distribution ported its PyGTK package to the PyCapsule API and Medit had not yet been updated to reflect that.

1.0 series

In Medit 1.0, the build system was redesigned to use autotools again but the Python bindings were removed. Not only was an option to compile the relevant sources not provided but the sources were not even there. Yevgen Muntyan cited a difficulty in maintaining this aspect of the code but promised to give Medit a revised set of Python bindings in a future version. Since he kept this promise, I see no reason to hack together a patch for the 1.0 series.

1.1 series

Medit 1.0.92 became the first version since 0.9.4 to have an officially supported method for building the moo module (albeit with a new API). The configure script makes it possible to build Medit or the moo module but it will not do both. To get the best of both worlds, I suggest building the moo module and then linking the editor to it by inserting extra gcc commands. This is what the following does:

tar -xf medit-1.1.0.tar.bz2
cd medit-1.1.0
./configure --with-python --enable-moo-module --enable-shared
make
sudo make install
cd moo/medit-app
gcc -I. -I.. -I../.. `pkg-config --cflags gtk+-2.0` -c main.c
mv ../.libs/_moo.so ../.libs/libmoo.so
gcc -L../.libs -lmoo `pkg-config --libs gtk+-2.0` -o medit main.o
sudo install -Dm755 medit /usr/bin/medit
sudo install -Dm644 medit.desktop.in /usr/share/applications/medit.desktop
cd ../mooutils/pixmaps
sudo install -Dm644 medit.png /usr/share/icons/hicolor/48x48/apps/medit.png
cd /usr/lib
sudo ln -s python2.7/site-packages/_moo.so _moo.so
sudo rm python2.7/site-packages/_moo.a

Get Unified Demos at SourceForge.net. Fast, secure and Free Open Source software downloads


Last updated: 2010-05-30 | Design by: Hry online, Croatia accommodation