Subject: pkg/33647: mozilla doesn't build against freetype2.2.1
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <mlelstv@serpens.de>
List: pkgsrc-bugs
Date: 06/05/2006 12:25:00
>Number:         33647
>Category:       pkg
>Synopsis:       mozilla doesn't build against freetype2.2.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 05 12:25:00 +0000 2006
>Originator:     Michael van Elst
>Release:        NetBSD 3.0_STABLE
>Organization:
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
>Environment:
	
	
System: NetBSD henery 3.0_STABLE NetBSD 3.0_STABLE (HENERY) #19: Fri May 26 14:00:38 CEST 2006 src@henery:/usr/obj/home/src/sys/arch/i386/compile/HENERY i386
Architecture: i386
Machine: i386
>Description:
www/mozilla doesn't build on current pkgsrc because freetype2
changed its API.

c++ -o nsType1.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" -DHAVE_DEPENDENT_LIBS -I../.. -I./.. -I../../../dist/include/xpcom -I../../../dist/include/string -I../../../dist/include/widget -I../../../dist/include/pref -I../../../dist/incl ude/caps -I../../../dist/include/locale -I../../../dist/include/uconv -I../../.. /dist/include/view -I../../../dist/include/necko -I../../../dist/include/imglib2 -I../../../dist/include/unicharutil -I../../../dist/include/gfx -I../../../dist /include -I/pkg_comp/obj/pkgsrc/www/mozilla/build_pkgs/mozilla/dist/include/nspr -I/usr/pkg/include -I/usr/pkg/include -I. -I/usr/pkg/include/freetype2 -I/usr /pkg/include -I/usr/pkg/xorg/include  -fPIC -DPIC -I/usr/pkg/include -I/usr/pkg/include/gdk-pixbuf-1.0 -I/usr/include -I/usr/pkg/include/freetype2 -I/usr/pkg/xorg/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -O2 -I/usr/pkg!
 /include -I/usr/pkg/include/gdk-pixbuf-1.0 -I/usr/include -I/usr/pkg/include/freetype2 -Dunix -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -O2 -I/usr/pkg/include/gtk-1.2 -I/usr/pkg/include/glib/glib-1.2 -I/usr/pkg/lib/glib/include -I/usr/pkg/xorg/include  -I/usr/pkg/include -I/usr/pkg/include/gdk-pixbuf-1.0 -I/usr/include -I/usr/pkg/include/freetype2  -I/usr/pkg/xorg/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/nsType1.pp nsType1.cpp
nsType1.cpp:371: error: invalid conversion from `int (*)(FT_Vector*, void*)' to `int (*)(const FT_Vector*, void*)'
nsType1.cpp:371: error: invalid conversion from `int (*)(FT_Vector*, void*)' to `int (*)(const FT_Vector*, void*)'
nsType1.cpp:371: error: invalid conversion from `int (*)(FT_Vector*, FT_Vector*, void*)' to `int (*)(const FT_Vector*, const FT_Vector*, void*)'
nsType1.cpp:371: error: invalid conversion from `int (*)(FT_Vector*, FT_Vector*, FT_Vector*, void*)' to `int (*)(const FT_Vector*, const FT_Vector*, const FT_Vector*, void*)'
make[4]: *** [nsType1.o] Error 1


>How-To-Repeat:
build www/mozilla

>Fix:
Here is a patch that cares for the constified functions in freetype2.2.

--- gfx/src/ps/nsType1.cpp.orig	2006-06-05 11:29:08.000000000 +0000
+++ gfx/src/ps/nsType1.cpp	2006-06-05 12:05:36.000000000 +0000
@@ -67,6 +67,12 @@
 
 #include "nsType1.h"
 
+#if FREETYPE_MAJOR > 2 || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 1)
+#define constFT_Vector const FT_Vector
+#else
+#define constFT_Vector FT_Vector
+#endif
+
 static const PRUint16 type1_encryption_c1 = TYPE1_ENCRYPTION_C1;
 static const PRUint16 type1_encryption_c2 = TYPE1_ENCRYPTION_C2;
 
@@ -81,8 +87,8 @@
   int            wmode;
 } FT2PT1_info;
 
-static int cubicto(FT_Vector *aControlPt1, FT_Vector *aControlPt2, 
-                   FT_Vector *aEndPt, void *aClosure);
+static int cubicto(constFT_Vector *aControlPt1, constFT_Vector *aControlPt2, 
+                   constFT_Vector *aEndPt, void *aClosure);
 static int Type1CharStringCommand(unsigned char **aBufPtrPtr, int aCmd);
 static int Type1EncodeCharStringInt(unsigned char **aBufPtrPtr, int aValue);
 
@@ -173,7 +179,7 @@
 }
 
 static PRBool
-sideWidthAndBearing(FT_Vector *aEndPt, FT2PT1_info *aFti)
+sideWidthAndBearing(constFT_Vector *aEndPt, FT2PT1_info *aFti)
 {
   int aw = 0;
   int ah = 0;
@@ -216,7 +222,7 @@
 }
 
 static int
-moveto(FT_Vector *aEndPt, void *aClosure)
+moveto(constFT_Vector *aEndPt, void *aClosure)
 {
   FT2PT1_info *fti = (FT2PT1_info *)aClosure;
   FT_UShort upm = fti->face->units_per_EM;
@@ -253,7 +259,7 @@
 }
 
 static int
-lineto(FT_Vector *aEndPt, void *aClosure)
+lineto(constFT_Vector *aEndPt, void *aClosure)
 {
   FT2PT1_info *fti = (FT2PT1_info *)aClosure;
   FT_UShort upm = fti->face->units_per_EM;
@@ -279,7 +285,7 @@
 }
 
 static int
-conicto(FT_Vector *aControlPt, FT_Vector *aEndPt, void *aClosure)
+conicto(constFT_Vector *aControlPt, constFT_Vector *aEndPt, void *aClosure)
 {
   FT2PT1_info *ftinfo = (FT2PT1_info *)aClosure;
   FT_UShort upm = ftinfo->face->units_per_EM;
@@ -311,7 +317,7 @@
 }
 
 static int
-cubicto(FT_Vector *aControlPt1, FT_Vector *aControlPt2, FT_Vector *aEndPt,
+cubicto(constFT_Vector *aControlPt1, constFT_Vector *aControlPt2, constFT_Vector *aEndPt,
         void *aClosure)
 {
   FT2PT1_info *ftinfo = (FT2PT1_info *)aClosure;

>Unformatted: