Hi,

I finally made it: gaphor works (more or less) on Win32 (xp).

There are some issues though: the stock icons do not want to be loaded since it expects C: (the drive name) to be a URL type. There are also some issues with forward and abckward slashes.

Furthermore, no threads should be lauched from gaphor/ui/mainactions.py (change the WorkerThread to not start a thread but call self.run() directly). I haven't figured it all out, but the tough work is done.


Here's what I did:

Download and install almost all .zip files from gimp.org/win32.

I used mingw32:
MinGW-3.1.0-1.exe
MSYS-1.0.10.exe
msysDTK-1.0.1.exe

Create a .profile:

PATH="/target/bin:/c/Python23:$PATH"

CFLAGS="-mno-cygwin -mms-bitfields -I/target/include -I/c/Python23/include"

LDFLAGS="-L/target/lib -L/c/Python23/libs"

PKG_CONFIG_PATH=/target/lib/pkgconfig

CVS_RSH=ssh

export PATH CFLAGS LDADD PKG_CONFIG_PATH

<EOF>

and restart the shell.


libxml2 from source (libxml2-2.6.9.tar.gz):

extract
$ cd xml2-2.6.9/win32
$ cscript configure.js ftp=no http=no compiler=mingw prefix="/target" lib=/target/lib
$ make -f Makefile.mingw


create the directories by hand. This is a bit clumsy, but once it's build we're set.


libglade from source (libglade-2.4.0.tar.gz):

$ ./configure --prefix=/target && make && make install

NOTE: edit /target/lib/pkgconfig/freetype2.pc -> prefix=/target
      also edit pangoft2.pc aan


libgnomecanvas from source (libgnomecanvas-2.7.1.tar.gz):

Basically libxml2 and libglade are not nessesary, but maybe Gaphor will use them in the future,
so it's better to be save than sorry.


$ ./configure --prefix=/target && make && make install

All should compile well. Try the demo app to be sure.


Finally! diacanvas2 0.13.0 (diacanvas2-0.13.0.tar.gz):

DiaCanvas was built with an older version of libtool. In order to make it work on windows a new libtool is required.

- install the msysdtk
- install libtool 1.5.4 from the gnuwin32 project (msysdtk features an older version of libtool)


$ libtoolize --force # use libtool version 1.5.4 from gnuwin32 project.
$ aclocal -I /target/share/aclocal
$ autoconf
$ automake
$ ./configure --prefix=/target
$ make; make install

Check if diacanvas works by running the demos/test_canvas application.

Now
Nu met Python:

Install pexports (pexports-0.42h.zip)

$ pexports /c/WINDOWS/system32/python23.dll >python23.def
$ dlltool.exe --def python23.def --output-lib libpython23.a
(this is not as descibed in the Python docs, but as described on the zope site).
$ cp libpython23.a /c/Python23/libs/


$ tar zxf pygtk-2.2.0.tar.gz
$ cd pygtk-2.2.0

open a DOS-hell (cmd):

> cd \msys\1.0\home\arjan\pygtk-2.2.0
> set PATH=%PATH%;c:\Python23;c:\msys\1.0\target\bin

> python setup.py build_ext -I c:\msys\1.0\target\include --compiler=mingw32
> python setup.py build --compiler=mingw32


> python setup.py install --skip-build

copy c:\python23\lib\pkgconfig\pygtk*.pc to the other pkgconfig dir (c:\msys\1.0\lib\pkgconfig)

Now PyGTK should work (open a Python interpreter and import pygtk, gtk and create a Window).

Gnome-Python bindings are easy to compile, once PyGTK is installed.

> python setup.py build_ext -I c:\msys\1.0\target\include --compiler=mingw32

Finally the DiaCanvas2 python bindings should be installed:

> cd \msys\1.0\home\arjan\diacanvas2-0.13.0\python
> python setup.py build --compiler=mingw32
> python setup.py install --skip-build

Now you should be able to do domething like this:

import diacanvas
c = diacanvas.Canvas()
import gtk
w = gtk.Window()
v = diacanvas.view.CanvasView(c)
w.add(v)
v.show()
w.show()
gtk.main()

If errors occur about functions like 'g_boxed_type_register_static' then there is a big chance that
the diacanvas2 DLL was not created (and everything was linked statically.


Try to build diacanvas2 again and check for messages that appear when the library is linked.

Started hacking on Gaphor since there are some issues with threading and file separators.


... but still I prefer unix...

Regards,

Arjan
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to