Index: cairo/pycairo-path.c =================================================================== RCS file: /cvs/cairo/pycairo/cairo/pycairo-path.c,v retrieving revision 1.8 diff -u -r1.8 pycairo-path.c --- cairo/pycairo-path.c 19 Aug 2005 02:46:55 -0000 1.8 +++ cairo/pycairo-path.c 18 Sep 2006 10:00:06 -0000 @@ -230,8 +230,7 @@ PycairoPath *pypath; /* Set to NULL when iterator is exhausted */ } PycairoPathiter; -static PyTypeObject PycairoPathiter_Type; - +PyTypeObject PycairoPathiter_Type; static void pathiter_dealloc(PycairoPathiter *it) @@ -303,7 +302,7 @@ return NULL; } -static PyTypeObject PycairoPathiter_Type = { +PyTypeObject PycairoPathiter_Type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "cairo.Pathiter", /* tp_name */ @@ -330,7 +329,7 @@ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - PyObject_SelfIter, /* tp_iter */ + 0, /* tp_iter */ (iternextfunc)pathiter_next, /* tp_iternext */ 0, /* tp_methods */ }; Index: cairo/cairomodule.c =================================================================== RCS file: /cvs/cairo/pycairo/cairo/cairomodule.c,v retrieving revision 1.57 diff -u -r1.57 cairomodule.c --- cairo/cairomodule.c 21 Aug 2006 03:32:28 -0000 1.57 +++ cairo/cairomodule.c 18 Sep 2006 10:00:06 -0000 @@ -169,6 +169,9 @@ PycairoPath_Type.tp_base = &PyBaseObject_Type; if (PyType_Ready(&PycairoPath_Type) < 0) return; + PycairoPathiter_Type.tp_iter=&PyObject_SelfIter; + if (PyType_Ready(&PycairoPathiter_Type) < 0) + return; PycairoPattern_Type.tp_base = &PyBaseObject_Type; if (PyType_Ready(&PycairoPattern_Type) < 0) Index: cairo/pycairo-private.h =================================================================== RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v retrieving revision 1.39 diff -u -r1.39 pycairo-private.h --- cairo/pycairo-private.h 11 Jun 2006 07:17:26 -0000 1.39 +++ cairo/pycairo-private.h 18 Sep 2006 10:00:06 -0000 @@ -62,6 +62,8 @@ extern PyTypeObject PycairoPath_Type; PyObject *PycairoPath_FromPath (cairo_path_t *path); +extern PyTypeObject PycairoPathiter_Type; + extern PyTypeObject PycairoPattern_Type; extern PyTypeObject PycairoSolidPattern_Type; extern PyTypeObject PycairoSurfacePattern_Type; Index: ChangeLog =================================================================== RCS file: /cvs/cairo/pycairo/ChangeLog,v retrieving revision 1.239 diff -u -r1.239 ChangeLog --- ChangeLog 21 Aug 2006 03:32:28 -0000 1.239 +++ ChangeLog 18 Sep 2006 10:00:06 -0000 @@ -1,3 +1,15 @@ +2006-09-18 Cedric Gustin + + * setup.py: Fixes for win32. Install pycairo.pc and pycairo.h as + data_files. + * cairo/pycairo-path.c: Initialize PycairoPathiter_Type.tp_iter in + init_cairo (cairomodule.c) to avoid "non-const initializer" errors + on win32 (mingw32). Remove static declaration for + PycairoPathiter_Type as it has to be used in cairomodule.c. + * cairo/pycairo-private.h: Export PycairoPathiter_Type. + * cairo/cairomodule.c (init_cairo): Initialize + PycairoPathiter_Type.tp_iter. + 2006-08-21 Steve Chaplin * RELEASING: update step 8. Index: setup.py =================================================================== RCS file: /cvs/cairo/pycairo/setup.py,v retrieving revision 1.11 diff -u -r1.11 setup.py --- setup.py 21 Aug 2006 03:32:28 -0000 1.11 +++ setup.py 18 Sep 2006 10:00:06 -0000 @@ -31,10 +31,30 @@ pkg_config_version_check ('cairo', cairo_version_required) +if sys.platform == 'win32': + runtime_library_dirs = [] +else: + runtime_library_dirs = pkg_config_parse('--libs-only-L', 'cairo') + +pkgconfig_file='pycairo.pc' +print 'creating %s' % pkgconfig_file +fo = file (pkgconfig_file, 'w') +fo.write ("""\ +prefix=%s + +Name: Pycairo +Description: Python bindings for cairo +Version: %s +Requires: cairo +Cflags: -I${prefix}/include/pycairo +Libs: +""" % (sys.prefix, pycairo_version) + ) +fo.close() cairo = dic.Extension( name = 'cairo._cairo', - sources = ['cairo/cairomodule.c', + sources = ['cairo/cairomodule.c', 'cairo/pycairo-context.c', 'cairo/pycairo-font.c', 'cairo/pycairo-matrix.c', @@ -45,7 +65,7 @@ include_dirs = pkg_config_parse('--cflags-only-I', 'cairo'), library_dirs = pkg_config_parse('--libs-only-L', 'cairo'), libraries = pkg_config_parse('--libs-only-l', 'cairo'), - runtime_library_dirs = pkg_config_parse('--libs-only-L', 'cairo'), + runtime_library_dirs = runtime_library_dirs, ) dic.setup( @@ -54,25 +74,6 @@ description = "python interface for cairo", packages = ['cairo'], ext_modules = [cairo], + data_files=[('include/pycairo',['cairo/pycairo.h']), + ('lib/pkgconfig',[pkgconfig_file])], ) - -pkgconfig_dir = os.path.join (sys.prefix, 'lib', 'pkgconfig') -pkgconfig_file = os.path.join (pkgconfig_dir, 'pycairo.pc') -print 'creating %s' % pkgconfig_file -fo = file (pkgconfig_file, 'w') -fo.write ("""\ -prefix=%s - -Name: Pycairo -Description: Python bindings for cairo -Version: %s -Requires: cairo -Cflags: -I${prefix}/include/pycairo -Libs: -""" % (sys.prefix, pycairo_version) - ) -fo.close() - -includedir = os.path.join (sys.prefix, 'include', 'pycairo') -dut.mkpath (includedir, verbose=True) -fut.copy_file ('cairo/pycairo.h', includedir, verbose=True)