Bug 114343

Summary: After install of freetype 2.1.7-1, code using Xft not compile
Product: [Fedora] Fedora Reporter: Vladimir Kondratiev <vladimir.kondratiev>
Component: XFree86Assignee: Mike A. Harris <mharris>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: otaylor
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 4.3.0-58 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-19 12:25:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Kondratiev 2004-01-26 22:20:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Description of problem:
With freetype-2.1.7-1, one need to use

#include <ft2build.h>
#include FT_FREETYPE_H

instead of (currently used in /usr/X11R6/include/X11/Xft/Xft.h:41)

#include <freetype/freetype.h>

As result, programs that uses Xft do not compile. For example,
compilation of gtk2 (rpmbuild --rebuild gtk2-2.3.2-2.src.rpm) fails 
(see below)



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Install freetype-2.1.7-1
2.rpmbuild --rebuild gtk2-2.3.2-2.src.rpm
3.see error messages
    

Actual Results:   gcc -DHAVE_CONFIG_H -I. -I. -I../..
-DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk
-I../../gdk -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
-DGDK_DISABLE_DEPRECATED -DG_ENABLE_DEBUG -pthread
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/X11R6/include -I/usr/include/pango-1.0 -I/usr/include/freetype2
-O2 -g -pipe -march=i386 -mcpu=i686 -Wall -MT gdkasync.lo -MD -MP -MF
.deps/gdkasync.Tpo -c gdkasync.c  -fPIC -DPIC -o .libs/gdkasync.o
In file included from /usr/X11R6/include/X11/Xft/Xft.h:41,
                 from ../../gdk/x11/gdkdrawable-x11.h:35,
                 from ../../gdk/x11/gdkwindow-x11.h:30,
                 from gdkprivate-x11.h:36,
                 from gdkx.h:78,
                 from gdkasync.c:48:
/usr/include/freetype2/freetype/freetype.h:20:2: #error "`ft2build.h'
hasn't been included yet!"
/usr/include/freetype2/freetype/freetype.h:21:2: #error "Please always
use macros to include FreeType header files."
/usr/include/freetype2/freetype/freetype.h:22:2: #error "Example:"
/usr/include/freetype2/freetype/freetype.h:23:2: #error "  #include
<ft2build.h>"
/usr/include/freetype2/freetype/freetype.h:24:2: #error "  #include
FT_FREETYPE_H"
make[4]: *** [gdkasync.lo] Error 1
make[4]: Leaving directory
`/home/vkondra-l/rpm-top/BUILD/gtk+-2.3.2/gdk/x11'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/vkondra-l/rpm-top/BUILD/gtk+-2.3.2/gdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/vkondra-l/rpm-top/BUILD/gtk+-2.3.2/gdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vkondra-l/rpm-top/BUILD/gtk+-2.3.2'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.61388 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.61388 (%build)


Expected Results:  compilation finished OK

Additional info:

Comment 2 Vladimir Kondratiev 2004-01-27 07:15:08 UTC
By trivial fix:

change 

#include <freetype/freetype.h>

at /usr/X11R6/include/X11/Xft/Xft.h:41
to

#include <ft2build.h>
#include FT_FREETYPE_H

I get gtk2 rpm mentioned above successfully compiled.

Comment 3 Owen Taylor 2004-01-27 15:30:29 UTC
This needs to be changed in Xft (Vladimir's changes is correct)
... we can't work around this in freetype. The history is 
approximately:

 - FreeType-2.0.3 (early 2001) - FT_FREETYPE_H style added,
   documented as required
 - FreeType-2.1.5 - Header files moved around in a way
   that breaks code not using FT_FREETYPE_H
 - FreeType-2.1.6 - Using FT_FREETYPE_H enforced.

See:
 
http://www.freetype.org/pipermail/devel/2003-October/009752.html
http://www.freetype.org/pipermail/devel/2003-November/009757.html

and followups.

I think the new style works with all releases we support - 
AS2.1 had, I believe, FreeType-2.0.9.


Comment 4 Mike A. Harris 2004-01-28 12:08:51 UTC
Ok, thanks Owen, I wasn't aware of any of that.  Just hoped to
be able to avoid per-OS-release hacks in spec file, but it looks
like I can do so anyway with a simple patch, at least for RHL 9
and later, which is what we support.

I might need to whip up a simple hack for RHL 8.0 though, as the
rpm still is buildable on RHL 8.0.  ;o)

Next build should fix this.

Comment 5 Mike A. Harris 2004-02-19 12:25:38 UTC
Oops, forgot to close this bug after fixing it:

* Wed Jan 28 2004 Mike A. Harris <mharris> 4.3.0-45.0.1
- Temporary fork of 4.3.0-45 to add some patches for test builds,
until post
  4.3.0-45 (4.3.0-46 through 4.3.0-50) local-work-in-progress stuff is in
  clean enough shape for tree inclusion
- Added XFree86-4.3.0-fixes-for-freetype-2.1.7-v2.patch so that
XFree86 will
  build properly against freetype 2.1.7 (#114343)