guile-cairo for cairo 1.2.0

steve tell <[email protected]>
Newsgroups gmane.lisp.guile.gtk
Message-ID <[email protected]>
On Thu, 31 May 2007, Andy Wingo wrote:

> Hey Steve,
>
> Thanks for testing!
>
> On Thu, 2007-05-31 at 02:19 -0400, steve tell wrote:
>> guile-cairo requires cairo >= 1.4.0, but my system (fedora core 6; still
>> rather current) only has cairo 1.2.6.
>
> Send me a patch with #ifdefs around the parts of guile-cairo that don't
> compile for you; the intention is to make guile-cairo compile with all
> cairo >= 1.0, but I only had 1.4 when I made it. I'll then roll a new
> guile-cairo release.

Attached [guile-cairo-1.3.90-cairo1.2.0.patch] is a quick patch that 
should cover cairo releases back through 1.2.0, and of course leaves 
things unchanged for cairo 1.4.0.

This builds a working guile-cairo
(at least as far as the test suite goes :-) on FC6 with cairo-1.2.6.


But I run into lots of trouble when building guile-gnome-platform with 
this.  Compiling  cairo/gnome/gw/guile-gnome-gw-cairo.c fails because this 
file includes guile-cairo.h without first including cairo.h and 
cairo-svg.h

Since I wasn't sure how to add includes to the g-wrap-generated files (and 
was hacking guile-cairo anyway) I tried the other attached patch 
[guile-cairo-1.3.90-include.patch] to have guile-cairo include cairo.h.

But then building of guile-gnome-platform-2.15.92+unofficial (recent bzr)
fails down in pango:
make[4]: Entering directory 
`/usr/src/redhat/BUILD/guile-gnome-platform-2.15.92+unofficial
/pango/gnome/gw'
guile  -c \
           "(debug-set! stack 400000) \
            (use-modules (gnome-0)) \
            (use-modules (g-wrap)) \
            (use-modules (gnome gw pango-spec)) \
            (generate-wrapset 'guile 'gnome-pango 
\"guile-gnome-gw-pango\")"
WARNING: (g-wrap util): imported module (srfi srfi-34) overrides core 
binding `raise'
WARNING: (g-wrap): imported module (srfi srfi-34) overrides core binding 
`raise'
WARNING: (g-wrap rti): imported module (srfi srfi-34) overrides core 
binding `raise'
WARNING: (g-wrap c-types): imported module (srfi srfi-34) overrides core 
binding `raise'
WARNING: (gnome gw support g-wrap): `declarations-cg' imported from both 
(g-wrap c-codegen
) and (g-wrap scm-codegen)
WARNING: (gnome gw support defs): imported module (srfi srfi-34) overrides 
core binding `raise'
WARNING: (gnome gw glib-spec): imported module (srfi srfi-34) overrides 
core binding `raise'
C Enum  |GBookmarkFileError|GBookmarkFileError       |gnome-glib
...
GObject |PangoRenderer     |<pango-renderer>         |gnome-pango
......xxx..x.......................x.xxx........x.......x..............xxx.....xxxxxxxxxxx
xxxxx.x...xx.......................xxx........x...x...x.......x.....xxx.......x.xx.x.x....
......................................xxx.....x.x...............x..................x..xxx.
....x.....
A list of opaque types and bad method names has been written to 
gnome-pango.log.

declarations-cg/gw-rti-wrapset
initializations-cg/rti-wrapset
mv guile-gnome-gw-pango.scm pango.scm
make[4]: *** No rule to make target `guile-gnome-gw-pangocairo.c', needed by `all'.  Stop.
make[4]: Leaving directory 
`/usr/src/redhat/BUILD/guile-gnome-platform-2.15.92+unofficial/pango/gnome/gw'
make[3]: *** [all-recursive] Error 1


Somehow, pangocairo-spec.scm had gone missing from pango/gnome/gw ?


I see what happened: I had updated from bzr, configured, and done a "make 
dist" back when I didn't have a working guile-cairo. Now that I have a 
usable guile-cairo, HAVE_CAIRO has a different value.

I'm not sure that you really want "EXTRA_DIST += pangocairo-spec.scm" 
inside the "if HAVE_CAIRO" in the Makefile.am?
Shouldn't it be possible to sync and "make dist" without having all of the 
build prerequesites installed?

Now to figure how to make bzr revert my previous hackery in my 
guile-gnome-platform workspace....

Steve

_______________________________________________
guile-gtk-general mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-gtk-general
guile-cairo-1.3.90-cairo1.2.0.patch (text/plain, 8.7 KB)
*** guile-cairo-1.3.90/guile-cairo/guile-cairo-enum-types.c.orig	Thu May 31 22:18:14 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo-enum-types.c	Thu May 31 23:41:17 2007
***************
*** 96,103 ****
--- 96,105 ----
      {CAIRO_STATUS_FILE_NOT_FOUND, "file-not-found"},
      {CAIRO_STATUS_INVALID_DASH, "invalid-dash"},
      {CAIRO_STATUS_INVALID_DSC_COMMENT, "invalid-dsc-comment"},
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
      {CAIRO_STATUS_INVALID_INDEX, "invalid-index"},
      {CAIRO_STATUS_CLIP_NOT_REPRESENTABLE, "clip-not-representable"},
+ #endif
      {0, NULL}
  };
  
***************
*** 220,226 ****
--- 222,230 ----
      {CAIRO_SURFACE_TYPE_BEOS, "beos"},
      {CAIRO_SURFACE_TYPE_DIRECTFB, "directfb"},
      {CAIRO_SURFACE_TYPE_SVG, "svg"},
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
      {CAIRO_SURFACE_TYPE_OS2, "os2"},
+ #endif
      {0, NULL}
  };
  
*** guile-cairo-1.3.90/guile-cairo/guile-cairo-vector-types.h.orig	Thu May 31 22:05:56 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo-vector-types.h	Thu May 31 23:39:49 2007
***************
*** 31,38 ****
--- 31,40 ----
  SCM scm_from_cairo_matrix (cairo_matrix_t *matrix);
  void scm_fill_cairo_matrix (SCM scm, cairo_matrix_t *matrix);
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM scm_from_cairo_rectangle (cairo_rectangle_t *rect);
  void scm_fill_cairo_rectangle (SCM scm, cairo_rectangle_t *rect);
+ #endif
  
  SCM scm_from_cairo_glyph (cairo_glyph_t *glyph);
  void scm_fill_cairo_glyph (SCM scm, cairo_glyph_t *glyph);
*** guile-cairo-1.3.90/guile-cairo/guile-cairo.c.orig	Thu May 31 22:07:16 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo.c	Thu May 31 23:41:06 2007
***************
*** 163,168 ****
--- 163,169 ----
      CCONSRET (cairo_create (scm_to_cairo_surface (surf)));
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  #ifdef DEBUG_GUILE_CAIRO
  SCM_DEFINE_PUBLIC (scm_cairo_get_reference_count, "cairo-get-reference-count", 1, 0, 0,
  	    (SCM ctx),
***************
*** 171,176 ****
--- 172,178 ----
      CCHKRET (ctx, scm_from_uint (cairo_get_reference_count (scm_to_cairo (ctx))));
  }
  #endif
+ #endif
  
  /* not wrapping the user_data because I need to mail the guile list,
   * possibility of calling gc_unprotect during gc */
***************
*** 772,777 ****
--- 774,780 ----
      CCHKRET (ctx, SCM_UNSPECIFIED);
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM_DEFINE_PUBLIC (scm_cairo_clip_extents, "cairo-clip-extents", 1, 0, 0,
  	    (SCM ctx),
  	    "")
***************
*** 805,810 ****
--- 808,814 ----
  
      return ret;
  }
+ #endif /* HAVE_CAIRO_140_API */
  
  SCM_DEFINE_PUBLIC (scm_cairo_font_options_create, "cairo-font-options-create", 0, 0, 0,
  	    (void),
***************
*** 1008,1013 ****
--- 1012,1018 ----
      CCHKRET (ctx, SCM_UNSPECIFIED);
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM_DEFINE_PUBLIC (scm_cairo_get_scaled_font, "cairo-get-scaled-font", 1, 0, 0,
  	    (SCM ctx),
  	    "")
***************
*** 1015,1020 ****
--- 1020,1026 ----
      SCM ret = scm_from_cairo_scaled_font (cairo_get_scaled_font (scm_to_cairo (ctx)));
      SFCHKRET (ret, ret);
  }
+ #endif
  
  SCM_DEFINE_PUBLIC (scm_cairo_show_text, "cairo-show-text", 2, 0, 0,
  	    (SCM ctx, SCM val),
***************
*** 1160,1165 ****
--- 1166,1172 ----
      CCHKRET (ctx, ret);
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  #ifdef DEBUG_GUILE_CAIRO
  SCM_DEFINE_PUBLIC (scm_cairo_font_face_get_reference_count, "cairo-font-face-get-reference-count", 1, 0, 0,
  	    (SCM face),
***************
*** 1168,1173 ****
--- 1175,1181 ----
      return scm_from_uint (cairo_font_face_get_reference_count (scm_to_cairo_font_face (face)));
  }
  #endif
+ #endif
  
  SCM_DEFINE_PUBLIC (scm_cairo_font_face_get_type, "cairo-font-face-get-type", 1, 0, 0,
  	    (SCM face),
***************
*** 1390,1395 ****
--- 1398,1404 ----
               scm_from_double (cairo_get_miter_limit (scm_to_cairo (ctx))));
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM_DEFINE_PUBLIC (scm_cairo_get_dash_count, "cairo-get-dash-count", 1, 0, 0,
  	    (SCM ctx),
  	    "")
***************
*** 1417,1422 ****
--- 1426,1432 ----
               scm_values (scm_list_2 (data ? scm_take_f64vector(data, ndoubles) : SCM_BOOL_F,
                                       scm_from_double (offset))));
  }
+ #endif /* HAVE_CAIRO_140_API */
  
  SCM_DEFINE_PUBLIC (scm_cairo_get_matrix, "cairo-get-matrix", 1, 0, 0,
  	    (SCM ctx),
***************
*** 1525,1530 ****
--- 1535,1541 ----
      return SCM_UNSPECIFIED;
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  #ifdef DEBUG_GUILE_CAIRO
  SCM_DEFINE_PUBLIC (scm_cairo_surface_get_reference_count, "cairo-surface-get-reference-count", 1, 0, 0,
  	    (SCM surf),
***************
*** 1533,1538 ****
--- 1544,1550 ----
      return scm_from_uint (cairo_surface_get_reference_count (scm_to_cairo_surface (surf)));
  }
  #endif
+ #endif
  
  SCM_DEFINE_PUBLIC (scm_cairo_surface_get_type, "cairo-surface-get-type", 1, 0, 0,
  	    (SCM surf),
***************
*** 1779,1784 ****
--- 1791,1797 ----
                                               scm_to_double (r1)));
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  #ifdef DEBUG_GUILE_CAIRO
  SCM_DEFINE_PUBLIC (scm_cairo_pattern_get_reference_count, "cairo-pattern-get-reference-count", 1, 0, 0,
  	    (SCM pat),
***************
*** 1787,1792 ****
--- 1800,1806 ----
      return scm_from_uint (cairo_pattern_get_reference_count (scm_to_cairo_pattern (pat)));
  }
  #endif
+ #endif
  
  SCM_DEFINE_PUBLIC (scm_cairo_pattern_get_type, "cairo-pattern-get-type", 1, 0, 0,
  	    (SCM pat),
***************
*** 1879,1884 ****
--- 1893,1899 ----
                 scm_from_cairo_filter (cairo_pattern_get_filter (scm_to_cairo_pattern (pat))));
  }
  
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM_DEFINE_PUBLIC (scm_cairo_pattern_get_rgba, "cairo-pattern-get-rgba", 1, 0, 0,
  	    (SCM pat),
  	    "")
***************
*** 1952,1957 ****
--- 1967,1973 ----
                                         scm_from_double (r1),
                                         SCM_UNDEFINED)));
  }
+ #endif /* HAVE_CAIRO_140_API */
  
  SCM_DEFINE_PUBLIC (scm_cairo_make_matrix, "cairo-make-matrix", 6, 0, 0,
                     (SCM xx, SCM yx, SCM xy, SCM yy, SCM x0, SCM y0),
*** guile-cairo-1.3.90/guile-cairo/guile-cairo-vector-types.c.orig	Thu May 31 22:20:45 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo-vector-types.c	Thu May 31 23:39:40 2007
***************
*** 97,103 ****
  /**********************************************************************
   * cairo_rectangle_t
   **********************************************************************/
! 
  SCM
  scm_from_cairo_rectangle (cairo_rectangle_t *rect)
  {
--- 97,103 ----
  /**********************************************************************
   * cairo_rectangle_t
   **********************************************************************/
! #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,4,0)
  SCM
  scm_from_cairo_rectangle (cairo_rectangle_t *rect)
  {
***************
*** 120,125 ****
--- 120,126 ----
      rect->height = GET (scm, 3);
  #undef GET
  }
+ #endif 
  
  /**********************************************************************
   * cairo_glyph_t
*** guile-cairo-1.3.90/README.orig	Thu May 31 22:28:11 2007
--- guile-cairo-1.3.90/README	Thu May 31 22:29:39 2007
***************
*** 120,126 ****
  
  * Guile 1.8.0 or newer
    http://www.gnu.org/software/guile/
! * Cairo 1.4.0 or newer
    http://cairographics.org/
  
  
--- 120,126 ----
  
  * Guile 1.8.0 or newer
    http://www.gnu.org/software/guile/
! * Cairo 1.2.0 or newer
    http://cairographics.org/
  
  
*** guile-cairo-1.3.90/configure.ac.orig	Thu May 31 22:27:12 2007
--- guile-cairo-1.3.90/configure.ac	Thu May 31 23:41:34 2007
***************
*** 1,9 ****
  AC_PREREQ(2.52)
  AC_INIT(HACKING)
  AM_CONFIG_HEADER(config.h)
! AM_INIT_AUTOMAKE(guile-cairo, 1.3.90)
  
! AC_SUBST(VERSION,1.3.90)
  
  AM_MAINTAINER_MODE
  AC_DISABLE_STATIC
--- 1,9 ----
  AC_PREREQ(2.52)
  AC_INIT(HACKING)
  AM_CONFIG_HEADER(config.h)
! AM_INIT_AUTOMAKE(guile-cairo, 1.3.91sgt)
  
! AC_SUBST(VERSION,1.3.91sgt)
  
  AM_MAINTAINER_MODE
  AC_DISABLE_STATIC
***************
*** 59,65 ****
  AC_SUBST(GUILE_LIBS)
  AC_MSG_RESULT(yes)
  
! PKG_CHECK_MODULES(CAIRO, cairo >= 1.4.0)
  AC_SUBST(CAIRO_LIBS)
  AC_SUBST(CAIRO_CFLAGS)
  
--- 59,65 ----
  AC_SUBST(GUILE_LIBS)
  AC_MSG_RESULT(yes)
  
! PKG_CHECK_MODULES(CAIRO, cairo >= 1.2.0)
  AC_SUBST(CAIRO_LIBS)
  AC_SUBST(CAIRO_CFLAGS)
guile-cairo-1.3.90-include.patch (text/plain, 847 B)
*** guile-cairo-1.3.90/guile-cairo/guile-cairo-enum-types.h.orig	Fri May 18 12:52:45 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo-enum-types.h	Fri Jun  1 00:15:11 2007
***************
*** 24,29 ****
--- 24,33 ----
  #ifndef __GUILE_CAIRO_ENUM_TYPES_H__
  #define __GUILE_CAIRO_ENUM_TYPES_H__
  
+ #if CAIRO_HAS_SVG_SURFACE
+ #include <cairo-svg.h>
+ #endif
+ 
  
  
  SCM scm_from_cairo_status (cairo_status_t cval);
*** guile-cairo-1.3.90/guile-cairo/guile-cairo.h.orig	Fri May 18 12:52:45 2007
--- guile-cairo-1.3.90/guile-cairo/guile-cairo.h	Fri Jun  1 00:02:00 2007
***************
*** 24,29 ****
--- 24,30 ----
  #ifndef __GUILE_CAIRO_H__
  #define __GUILE_CAIRO_H__
  
+ #include <cairo.h>
  #include <guile-cairo-smob-types.h>
  #include <guile-cairo-enum-types.h>
  #include <guile-cairo-vector-types.h>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.