cairomm1 stable port information

Package: cairomm1
Version: 1.6.0
Revision: 3
GCC: 4.0
Depends: <<
%N-shlibs (= %v-%r)
<<
BuildDepends: <<
cairo (>= 1.6-1),
doxygen,
expat1,
fink (>= 0.24.12),
fontconfig2-dev,
freetype219,
glitz (>= 0.5.6-1),
libgl-dev,
libpng3,
pixman (>= 0.10.0-1),
pkgconfig (>= 0.21-1),
x11-dev,
xft2-dev
<<

Source: http://cairographics.org/releases/cairomm-%v.tar.gz
Source-MD5: 549b0c9eaa25d61c4dd92d2de1cb4a46
PatchFile: %n.patch
PatchFile-MD5: f8cd97516805216315bf5e8e22522a75
NoSetLDFLAGS: true
SetLDFLAGS: -L%p/lib/freetype219/lib -L%p/lib/fontconfig2/lib -L%p/lib
SetLIBS: -L/usr/X11R6/lib
NoSetCFLAGS: true
SetCFLAGS: -Os
NoSetCPPFLAGS: true
SetCPPFLAGS: -I%p/lib/freetype219/include -I%p/lib/freetype219/include/freetype2 -I%p/lib/fontconfig2/include -I%p/include -I/usr/X11R6/include -DENABLE_GCC_VISIBILITY=1
ConfigureParams: --mandir=%p/share/man --disable-dependency-tracking PKG_CONFIG_PATH="%p/lib/freetype219/lib/pkgconfig:%p/lib/fontconfig2/lib/pkgconfig:%p/lib/pkgconfig:$PKG_CONFIG_PATH"
InstallScript: <<
#!/bin/sh -ev

make -j1 install DESTDIR="%d"
install -d -m 755 %i/share/doc/%N
mv examples %i/share/doc/%N/
<<
SplitOff: <<
Package: %N-shlibs
Depends: cairo-shlibs (>= 1.6-1)
Files: lib/lib*.*.*.dylib
Shlibs: <<
%p/lib/libcairomm-1.0.1.dylib 4.0.0 %n (>= 1.6-2)
<<
DocFiles: COPYING
<<
DocFiles: AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS README
Description: C++ interface for the cairo library
License: LGPL
Maintainer: Benjamin Reed
Homepage: http://cairographics.org/

cairomm1 stable port .patch

From ac0923e24cb16a701f57f0defb64fb5b9b0713cd Mon Sep 17 00:00:00 2001
From: Benjamin Reed
Date: Fri, 25 Apr 2008 13:46:06 -0400
Subject: [PATCH] separate calls to possibly-conflicting surface calls

On Mac OS X, if you have both the xlib and quartz backends
enabled in cairo, cairomm fails to build with conflicting headers:

/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DPNG_NO_MMX_CODE -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/lib/fontconfig2/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/usr/X11/include -I/sw/lib/freetype219/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/fontconfig2/include -I/sw/include -I/usr/X11R6/include -g -O2 -c -o context.lo context.cc
g++ -DHAVE_CONFIG_H -I. -I.. -DPNG_NO_MMX_CODE -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/lib/fontconfig2/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/usr/X11/include -I/sw/lib/freetype219/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/fontconfig2/include -I/sw/include -I/usr/X11R6/include -g -O2 -c context.cc -fno-common -DPIC -o .libs/context.o
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: declaration does not declare anything
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:264: error: using typedef-name 'Cursor' after 'struct'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: using typedef-name 'Cursor' after 'struct'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: invalid type in declaration before ';' token
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: conflicting declaration 'typedef int Cursor'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration as 'typedef XID Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:296: error: using typedef-name 'Picture' after 'struct'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: using typedef-name 'Picture' after 'struct'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: invalid type in declaration before ';' token
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: conflicting declaration 'typedef int Picture'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration as 'typedef XID Picture'

This patch fixes this by separating out the calls in the get_surface_wrapper
call to individual .cc files which are then compiled with only the headers
they need.
---
cairomm/Makefile.am | 4 +-
cairomm/context.cc | 12 +++++-----
cairomm/context.h | 4 +++
cairomm/context_private.h | 41 ++++++++++++++++++++++++++++++++++++
cairomm/context_surface_quartz.cc | 42 +++++++++++++++++++++++++++++++++++++
cairomm/context_surface_win32.cc | 42 +++++++++++++++++++++++++++++++++++++
cairomm/context_surface_xlib.cc | 42 +++++++++++++++++++++++++++++++++++++
8 files changed, 183 insertions(+), 8 deletions(-)
create mode 100644 cairomm/context_private.h
create mode 100644 cairomm/context_surface_quartz.cc
create mode 100644 cairomm/context_surface_win32.cc
create mode 100644 cairomm/context_surface_xlib.cc

diff --git a/cairomm/Makefile.am b/cairomm/Makefile.am
index ad2b535..04d8779 100644
--- a/cairomm/Makefile.am
+++ b/cairomm/Makefile.am
@@ -3,8 +3,8 @@ SUBDIRS =
INCLUDES = -I$(top_srcdir) @CAIROMM_CFLAGS@

h_sources_public = cairomm.h context.h enums.h fontface.h fontoptions.h path.h pattern.h quartz_surface.h surface.h xlib_surface.h win32_surface.h exception.h refptr.h scaledfont.h cairommconfig.h
-h_sources_private = private.h
-cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc
+h_sources_private = private.h context_private.h
+cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc context_surface_quartz.cc context_surface_win32.cc context_surface_xlib.cc
cc_sources_private = private.cc

# Support for DLL on cygwin/mingw using libtool > 1.4
diff --git a/cairomm/context.cc b/cairomm/context.cc
index 8964dd5..f5f17f6 100644
--- a/cairomm/context.cc
+++ b/cairomm/context.cc
@@ -18,11 +18,9 @@

#include
#include
+#include
#include
#include
-#include
-#include
-#include

/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
#if defined(_MSC_VER)
@@ -34,6 +32,8 @@
# include
#endif

+using namespace Cairo::Private;
+
namespace Cairo
{

@@ -684,7 +684,7 @@ RefPtr get_surface_wrapper (cairo_surface_t* surface)
#endif
#if CAIRO_HAS_XLIB_SURFACE
case CAIRO_SURFACE_TYPE_XLIB:
- return RefPtr(new XlibSurface(surface, false /* does not have reference */));
+ return wrap_surface_xlib(surface);
break;
#endif
#if CAIRO_HAS_GLITZ_SURFACE
@@ -694,12 +694,12 @@ RefPtr get_surface_wrapper (cairo_surface_t* surface)
#endif
#if CAIRO_HAS_QUARTZ_SURFACE
case CAIRO_SURFACE_TYPE_QUARTZ:
- return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
+ return wrap_surface_quartz(surface);
break;
#endif
#if CAIRO_HAS_WIN32_SURFACE
case CAIRO_SURFACE_TYPE_WIN32:
- return RefPtr(new Win32Surface(surface, false /* does not have reference */));
+ return wrap_surface_win32(surface);
break;
#endif
#if CAIRO_HAS_SVG_SURFACE
diff --git a/cairomm/context.h b/cairomm/context.h
index 711309e..ceac161 100644
--- a/cairomm/context.h
+++ b/cairomm/context.h
@@ -1003,6 +1003,10 @@ protected:
cobject* m_cobject;
};

+ RefPtr get_surface_quartz(cairo_surface_t*);
+ RefPtr get_surface_win32(cairo_surface_t*);
+ RefPtr get_surface_xlib(cairo_surface_t*);
+
} // namespace Cairo

#endif //__CAIROMM_CONTEXT_H
diff --git a/cairomm/context_private.h b/cairomm/context_private.h
new file mode 100644
index 0000000..3081dca
--- /dev/null
+++ b/cairomm/context_private.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef __CAIROMM_CONTEXT_PRIVATE_H
+#define __CAIROMM_CONTEXT_PRIVATE_H
+
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_quartz(cairo_surface_t*);
+RefPtr wrap_surface_win32(cairo_surface_t*);
+RefPtr wrap_surface_xlib(cairo_surface_t*);
+
+} // namespace Private
+
+} // namespace Cairo
+
+#endif // __CAIROMM_CONTEXT_PRIVATE_H
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_quartz.cc b/cairomm/context_surface_quartz.cc
new file mode 100644
index 0000000..540dca3
--- /dev/null
+++ b/cairomm/context_surface_quartz.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_quartz(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_QUARTZ_SURFACE
+ return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_win32.cc b/cairomm/context_surface_win32.cc
new file mode 100644
index 0000000..61837bd
--- /dev/null
+++ b/cairomm/context_surface_win32.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_win32(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_WIN32_SURFACE
+ return RefPtr(new Win32Surface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_xlib.cc b/cairomm/context_surface_xlib.cc
new file mode 100644
index 0000000..0f57bc7
--- /dev/null
+++ b/cairomm/context_surface_xlib.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_xlib(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_WIN32_SURFACE
+ return RefPtr(new XlibSurface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
--
1.5.3.7

From a1521be58897173fb5608b7d53118add1969a9c3 Mon Sep 17 00:00:00 2001
From: Benjamin Reed
Date: Fri, 25 Apr 2008 14:06:42 -0400
Subject: [PATCH] enable hidden visiblity of the wrap_* functions

This patch enables setting the "hidden" attribute on the
new wrap_* functions if -DENABLE_GCC_VISIBILITY is set
when compiling.

This will avoid adding new public symbols to the library
so it should be safe as far as remaining binary-compatible.

On the other hand, the rest of cairomm is not
visibility-aware, so I enabled this as a hack you need
to manually define for now. I'm not sure how best to
go about properly testing for "real" visibility support
and changing the rest of cairomm to take advantage of it.
---
cairomm/context_private.h | 12 +++++++++---
cairomm/context_surface_quartz.cc | 2 +-
cairomm/context_surface_win32.cc | 2 +-
cairomm/context_surface_xlib.cc | 2 +-
4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/cairomm/context_private.h b/cairomm/context_private.h
index 3081dca..9118d8f 100644
--- a/cairomm/context_private.h
+++ b/cairomm/context_private.h
@@ -19,6 +19,12 @@
#ifndef __CAIROMM_CONTEXT_PRIVATE_H
#define __CAIROMM_CONTEXT_PRIVATE_H

+#ifdef ENABLE_GCC_VISIBILITY
+ #define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
+#else
+ #define VISIBILITY_HIDDEN
+#endif
+
#include
#include

@@ -28,9 +34,9 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_quartz(cairo_surface_t*);
-RefPtr wrap_surface_win32(cairo_surface_t*);
-RefPtr wrap_surface_xlib(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_quartz(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_win32(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_xlib(cairo_surface_t*);

} // namespace Private

diff --git a/cairomm/context_surface_quartz.cc b/cairomm/context_surface_quartz.cc
index 540dca3..49de634 100644
--- a/cairomm/context_surface_quartz.cc
+++ b/cairomm/context_surface_quartz.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_quartz(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_quartz(cairo_surface_t* surface)
{
#if CAIRO_HAS_QUARTZ_SURFACE
return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
diff --git a/cairomm/context_surface_win32.cc b/cairomm/context_surface_win32.cc
index 61837bd..13d13e7 100644
--- a/cairomm/context_surface_win32.cc
+++ b/cairomm/context_surface_win32.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_win32(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_win32(cairo_surface_t* surface)
{
#if CAIRO_HAS_WIN32_SURFACE
return RefPtr(new Win32Surface(surface, false /* does not have reference */));
diff --git a/cairomm/context_surface_xlib.cc b/cairomm/context_surface_xlib.cc
index 0f57bc7..a77e945 100644
--- a/cairomm/context_surface_xlib.cc
+++ b/cairomm/context_surface_xlib.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_xlib(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_xlib(cairo_surface_t* surface)
{
#if CAIRO_HAS_WIN32_SURFACE
return RefPtr(new XlibSurface(surface, false /* does not have reference */));
--
1.5.3.7

--- cairomm-1.6.0/cairomm/Makefile.in 2008-04-11 12:27:34.000000000 -0400
+++ cairomm-1.6.0-new/cairomm/Makefile.in 2008-04-25 14:14:03.000000000 -0400
@@ -58,7 +58,8 @@
libcairomm_1_0_la_DEPENDENCIES =
am__objects_1 = context.lo fontface.lo fontoptions.lo path.lo \
pattern.lo quartz_surface.lo surface.lo xlib_surface.lo \
- win32_surface.lo exception.lo scaledfont.lo
+ win32_surface.lo exception.lo scaledfont.lo context_surface_quartz.lo \
+ context_surface_win32.lo context_surface_xlib.lo
am__objects_2 =
am__objects_3 = private.lo
am_libcairomm_1_0_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
@@ -230,9 +231,9 @@
SUBDIRS =
INCLUDES = -I$(top_srcdir) @CAIROMM_CFLAGS@
h_sources_public = cairomm.h context.h enums.h fontface.h fontoptions.h path.h pattern.h quartz_surface.h surface.h xlib_surface.h win32_surface.h exception.h refptr.h scaledfont.h cairommconfig.h
-h_sources_private = private.h
+h_sources_private = private.h context_private.h
cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc
-cc_sources_private = private.cc
+cc_sources_private = private.cc context_surface_quartz.cc context_surface_win32.cc context_surface_xlib.cc
@PLATFORM_WIN32_FALSE@win32_dlls_ldflags =

# Support for DLL on cygwin/mingw using libtool > 1.4
@@ -334,6 +335,9 @@
-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_quartz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_win32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_xlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontface.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontoptions.Plo@am__quote@

cairomm1 _unstable_ port information

Package: cairomm1
Version: 1.6.4
Revision: 1
GCC: 4.0
Depends: <<
%N-shlibs (= %v-%r)
<<
BuildDepends: <<
cairo (>= 1.8-1),
doxygen,
expat1,
fink (>= 0.24.12),
fontconfig2-dev,
freetype219 (>= 2.3.7-4),
glitz (>= 0.5.6-1),
libgl-dev,
libpng3,
pixman (>= 0.10.0-1),
pkgconfig (>= 0.23),
x11-dev,
xft2-dev
<<
BuildDependsOnly: true
Source: http://cairographics.org/releases/cairomm-%v.tar.gz
Source-MD5: 63561c62536173a98f03005dfe55c90e
#PatchFile: %n.patch
#PatchFile-MD5: f8cd97516805216315bf5e8e22522a75
SetLDFLAGS: -L%p/lib/fontconfig2/lib
NoSetCFLAGS: true
SetCFLAGS: -Os
SetCPPFLAGS: -I%p/lib/fontconfig2/include -DENABLE_GCC_VISIBILITY=1
ConfigureParams: --mandir=%p/share/man --disable-dependency-tracking PKG_CONFIG_PATH="%p/lib/fontconfig2/lib/pkgconfig:$PKG_CONFIG_PATH"
InstallScript: <<
#!/bin/sh -ev

make -j1 install DESTDIR="%d"
install -d -m 755 %i/share/doc/%N
mv examples %i/share/doc/%N/
<<
SplitOff: <<
Package: %N-shlibs
Depends: cairo-shlibs (>= 1.8-1)
Files: lib/lib*.*.*.dylib
Shlibs: <<
%p/lib/libcairomm-1.0.1.dylib 4.0.0 %n (>= 1.6.4-1)
<<
DocFiles: COPYING
<<
DocFiles: AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS README
Description: C++ interface for the cairo library
License: LGPL
Maintainer: Benjamin Reed
Homepage: http://cairographics.org/

cairomm1 _unstable_ port .patch

From ac0923e24cb16a701f57f0defb64fb5b9b0713cd Mon Sep 17 00:00:00 2001
From: Benjamin Reed
Date: Fri, 25 Apr 2008 13:46:06 -0400
Subject: [PATCH] separate calls to possibly-conflicting surface calls

On Mac OS X, if you have both the xlib and quartz backends
enabled in cairo, cairomm fails to build with conflicting headers:

/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DPNG_NO_MMX_CODE -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/lib/fontconfig2/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/usr/X11/include -I/sw/lib/freetype219/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/fontconfig2/include -I/sw/include -I/usr/X11R6/include -g -O2 -c -o context.lo context.cc
g++ -DHAVE_CONFIG_H -I. -I.. -DPNG_NO_MMX_CODE -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/lib/fontconfig2/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/usr/X11/include -I/sw/lib/freetype219/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/fontconfig2/include -I/sw/include -I/usr/X11R6/include -g -O2 -c context.cc -fno-common -DPIC -o .libs/context.o
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: declaration does not declare anything
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:264: error: using typedef-name 'Cursor' after 'struct'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: using typedef-name 'Cursor' after 'struct'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: invalid type in declaration before ';' token
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: conflicting declaration 'typedef int Cursor'
/usr/X11R6/include/X11/X.h:108: error: 'Cursor' has a previous declaration as 'typedef XID Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:296: error: using typedef-name 'Picture' after 'struct'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: using typedef-name 'Picture' after 'struct'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration here
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: invalid type in declaration before ';' token
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:300: error: conflicting declaration 'typedef int Picture'
/usr/X11R6/include/X11/extensions/render.h:31: error: 'Picture' has a previous declaration as 'typedef XID Picture'

This patch fixes this by separating out the calls in the get_surface_wrapper
call to individual .cc files which are then compiled with only the headers
they need.
---
cairomm/Makefile.am | 4 +-
cairomm/context.cc | 12 +++++-----
cairomm/context.h | 4 +++
cairomm/context_private.h | 41 ++++++++++++++++++++++++++++++++++++
cairomm/context_surface_quartz.cc | 42 +++++++++++++++++++++++++++++++++++++
cairomm/context_surface_win32.cc | 42 +++++++++++++++++++++++++++++++++++++
cairomm/context_surface_xlib.cc | 42 +++++++++++++++++++++++++++++++++++++
8 files changed, 183 insertions(+), 8 deletions(-)
create mode 100644 cairomm/context_private.h
create mode 100644 cairomm/context_surface_quartz.cc
create mode 100644 cairomm/context_surface_win32.cc
create mode 100644 cairomm/context_surface_xlib.cc

diff --git a/cairomm/Makefile.am b/cairomm/Makefile.am
index ad2b535..04d8779 100644
--- a/cairomm/Makefile.am
+++ b/cairomm/Makefile.am
@@ -3,8 +3,8 @@ SUBDIRS =
INCLUDES = -I$(top_srcdir) @CAIROMM_CFLAGS@

h_sources_public = cairomm.h context.h enums.h fontface.h fontoptions.h path.h pattern.h quartz_surface.h surface.h xlib_surface.h win32_surface.h exception.h refptr.h scaledfont.h cairommconfig.h
-h_sources_private = private.h
-cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc
+h_sources_private = private.h context_private.h
+cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc context_surface_quartz.cc context_surface_win32.cc context_surface_xlib.cc
cc_sources_private = private.cc

# Support for DLL on cygwin/mingw using libtool > 1.4
diff --git a/cairomm/context.cc b/cairomm/context.cc
index 8964dd5..f5f17f6 100644
--- a/cairomm/context.cc
+++ b/cairomm/context.cc
@@ -18,11 +18,9 @@

#include
#include
+#include
#include
#include
-#include
-#include
-#include

/* M_PI is defined in math.h in the case of Microsoft Visual C++ */
#if defined(_MSC_VER)
@@ -34,6 +32,8 @@
# include
#endif

+using namespace Cairo::Private;
+
namespace Cairo
{

@@ -684,7 +684,7 @@ RefPtr get_surface_wrapper (cairo_surface_t* surface)
#endif
#if CAIRO_HAS_XLIB_SURFACE
case CAIRO_SURFACE_TYPE_XLIB:
- return RefPtr(new XlibSurface(surface, false /* does not have reference */));
+ return wrap_surface_xlib(surface);
break;
#endif
#if CAIRO_HAS_GLITZ_SURFACE
@@ -694,12 +694,12 @@ RefPtr get_surface_wrapper (cairo_surface_t* surface)
#endif
#if CAIRO_HAS_QUARTZ_SURFACE
case CAIRO_SURFACE_TYPE_QUARTZ:
- return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
+ return wrap_surface_quartz(surface);
break;
#endif
#if CAIRO_HAS_WIN32_SURFACE
case CAIRO_SURFACE_TYPE_WIN32:
- return RefPtr(new Win32Surface(surface, false /* does not have reference */));
+ return wrap_surface_win32(surface);
break;
#endif
#if CAIRO_HAS_SVG_SURFACE
diff --git a/cairomm/context.h b/cairomm/context.h
index 711309e..ceac161 100644
--- a/cairomm/context.h
+++ b/cairomm/context.h
@@ -1003,6 +1003,10 @@ protected:
cobject* m_cobject;
};

+ RefPtr get_surface_quartz(cairo_surface_t*);
+ RefPtr get_surface_win32(cairo_surface_t*);
+ RefPtr get_surface_xlib(cairo_surface_t*);
+
} // namespace Cairo

#endif //__CAIROMM_CONTEXT_H
diff --git a/cairomm/context_private.h b/cairomm/context_private.h
new file mode 100644
index 0000000..3081dca
--- /dev/null
+++ b/cairomm/context_private.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef __CAIROMM_CONTEXT_PRIVATE_H
+#define __CAIROMM_CONTEXT_PRIVATE_H
+
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_quartz(cairo_surface_t*);
+RefPtr wrap_surface_win32(cairo_surface_t*);
+RefPtr wrap_surface_xlib(cairo_surface_t*);
+
+} // namespace Private
+
+} // namespace Cairo
+
+#endif // __CAIROMM_CONTEXT_PRIVATE_H
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_quartz.cc b/cairomm/context_surface_quartz.cc
new file mode 100644
index 0000000..540dca3
--- /dev/null
+++ b/cairomm/context_surface_quartz.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_quartz(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_QUARTZ_SURFACE
+ return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_win32.cc b/cairomm/context_surface_win32.cc
new file mode 100644
index 0000000..61837bd
--- /dev/null
+++ b/cairomm/context_surface_win32.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_win32(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_WIN32_SURFACE
+ return RefPtr(new Win32Surface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
diff --git a/cairomm/context_surface_xlib.cc b/cairomm/context_surface_xlib.cc
new file mode 100644
index 0000000..0f57bc7
--- /dev/null
+++ b/cairomm/context_surface_xlib.cc
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 The cairomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+
+namespace Cairo
+{
+
+namespace Private
+{
+
+RefPtr wrap_surface_xlib(cairo_surface_t* surface)
+{
+#if CAIRO_HAS_WIN32_SURFACE
+ return RefPtr(new XlibSurface(surface, false /* does not have reference */));
+#else
+ return RefPtr(new Surface(surface, false /* does not have reference */));
+#endif
+}
+
+} // namespace Private
+
+} // namespace Cairo
+
+// vim: ts=2 sw=2 et
--
1.5.3.7

From a1521be58897173fb5608b7d53118add1969a9c3 Mon Sep 17 00:00:00 2001
From: Benjamin Reed
Date: Fri, 25 Apr 2008 14:06:42 -0400
Subject: [PATCH] enable hidden visiblity of the wrap_* functions

This patch enables setting the "hidden" attribute on the
new wrap_* functions if -DENABLE_GCC_VISIBILITY is set
when compiling.

This will avoid adding new public symbols to the library
so it should be safe as far as remaining binary-compatible.

On the other hand, the rest of cairomm is not
visibility-aware, so I enabled this as a hack you need
to manually define for now. I'm not sure how best to
go about properly testing for "real" visibility support
and changing the rest of cairomm to take advantage of it.
---
cairomm/context_private.h | 12 +++++++++---
cairomm/context_surface_quartz.cc | 2 +-
cairomm/context_surface_win32.cc | 2 +-
cairomm/context_surface_xlib.cc | 2 +-
4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/cairomm/context_private.h b/cairomm/context_private.h
index 3081dca..9118d8f 100644
--- a/cairomm/context_private.h
+++ b/cairomm/context_private.h
@@ -19,6 +19,12 @@
#ifndef __CAIROMM_CONTEXT_PRIVATE_H
#define __CAIROMM_CONTEXT_PRIVATE_H

+#ifdef ENABLE_GCC_VISIBILITY
+ #define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
+#else
+ #define VISIBILITY_HIDDEN
+#endif
+
#include
#include

@@ -28,9 +34,9 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_quartz(cairo_surface_t*);
-RefPtr wrap_surface_win32(cairo_surface_t*);
-RefPtr wrap_surface_xlib(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_quartz(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_win32(cairo_surface_t*);
+VISIBILITY_HIDDEN RefPtr wrap_surface_xlib(cairo_surface_t*);

} // namespace Private

diff --git a/cairomm/context_surface_quartz.cc b/cairomm/context_surface_quartz.cc
index 540dca3..49de634 100644
--- a/cairomm/context_surface_quartz.cc
+++ b/cairomm/context_surface_quartz.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_quartz(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_quartz(cairo_surface_t* surface)
{
#if CAIRO_HAS_QUARTZ_SURFACE
return RefPtr(new QuartzSurface(surface, false /* does not have reference */));
diff --git a/cairomm/context_surface_win32.cc b/cairomm/context_surface_win32.cc
index 61837bd..13d13e7 100644
--- a/cairomm/context_surface_win32.cc
+++ b/cairomm/context_surface_win32.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_win32(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_win32(cairo_surface_t* surface)
{
#if CAIRO_HAS_WIN32_SURFACE
return RefPtr(new Win32Surface(surface, false /* does not have reference */));
diff --git a/cairomm/context_surface_xlib.cc b/cairomm/context_surface_xlib.cc
index 0f57bc7..a77e945 100644
--- a/cairomm/context_surface_xlib.cc
+++ b/cairomm/context_surface_xlib.cc
@@ -26,7 +26,7 @@ namespace Cairo
namespace Private
{

-RefPtr wrap_surface_xlib(cairo_surface_t* surface)
+VISIBILITY_HIDDEN RefPtr wrap_surface_xlib(cairo_surface_t* surface)
{
#if CAIRO_HAS_WIN32_SURFACE
return RefPtr(new XlibSurface(surface, false /* does not have reference */));
--
1.5.3.7

--- cairomm-1.6.0/cairomm/Makefile.in 2008-04-11 12:27:34.000000000 -0400
+++ cairomm-1.6.0-new/cairomm/Makefile.in 2008-04-25 14:14:03.000000000 -0400
@@ -58,7 +58,8 @@
libcairomm_1_0_la_DEPENDENCIES =
am__objects_1 = context.lo fontface.lo fontoptions.lo path.lo \
pattern.lo quartz_surface.lo surface.lo xlib_surface.lo \
- win32_surface.lo exception.lo scaledfont.lo
+ win32_surface.lo exception.lo scaledfont.lo context_surface_quartz.lo \
+ context_surface_win32.lo context_surface_xlib.lo
am__objects_2 =
am__objects_3 = private.lo
am_libcairomm_1_0_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
@@ -230,9 +231,9 @@
SUBDIRS =
INCLUDES = -I$(top_srcdir) @CAIROMM_CFLAGS@
h_sources_public = cairomm.h context.h enums.h fontface.h fontoptions.h path.h pattern.h quartz_surface.h surface.h xlib_surface.h win32_surface.h exception.h refptr.h scaledfont.h cairommconfig.h
-h_sources_private = private.h
+h_sources_private = private.h context_private.h
cc_sources = context.cc fontface.cc fontoptions.cc path.cc pattern.cc quartz_surface.cc surface.cc xlib_surface.cc win32_surface.cc exception.cc scaledfont.cc
-cc_sources_private = private.cc
+cc_sources_private = private.cc context_surface_quartz.cc context_surface_win32.cc context_surface_xlib.cc
@PLATFORM_WIN32_FALSE@win32_dlls_ldflags =

# Support for DLL on cygwin/mingw using libtool > 1.4
@@ -334,6 +335,9 @@
-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_quartz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_win32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context_surface_xlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontface.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontoptions.Plo@am__quote@