Bug 31267 - xft.pc does not specify all packages required to #include <X11/Xft/Xft.h>
Summary: xft.pc does not specify all packages required to #include <X11/Xft/Xft.h>
Status: RESOLVED WORKSFORME
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xft (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 31933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-31 15:35 UTC by Dmitry V. Levin
Modified: 2010-11-26 11:13 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dmitry V. Levin 2010-10-31 15:35:52 UTC
$ pkg-config xft --modversion   
2.2.0
$ pkg-config xft --print-requires
xproto
$ echo '#include <X11/Xft/Xft.h>' | gcc -xc -c -o/dev/null $(pkg-config xft) - 2>&1 | fgrep 'No such file or directory'
/usr/include/X11/Xft/Xft.h:39:22: error: ft2build.h: No such file or directory
/usr/include/X11/Xft/Xft.h:41:35: error: fontconfig/fontconfig.h: No such file or directory
/usr/include/X11/Xft/Xft.h:42:36: error: X11/extensions/Xrender.h: No such file or directory

Note that there is no static linking attempt at all, xft.pc just doesn't specify all necessary requirements.
I believe this is a regression introduced by commit libXft-2.1.14-16-g8751e34 which stripped Requires in favour of Requires.private.
Comment 1 Alan Coopersmith 2010-10-31 16:02:58 UTC
(In reply to comment #0)
> $ echo '#include <X11/Xft/Xft.h>' | gcc -xc -c -o/dev/null $(pkg-config xft) -

Doesn't that need to be "pkg-config --cflags xft"?
Comment 2 Dmitry V. Levin 2010-10-31 16:10:49 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > $ echo '#include <X11/Xft/Xft.h>' | gcc -xc -c -o/dev/null $(pkg-config xft) -
> 
> Doesn't that need to be "pkg-config --cflags xft"?

It actually was "pkg-config --cflags xft" (without any difference, though, because its output is an empty string):

$ pkg-config --cflags xft

$ 

The problem here is that some headers required by X11/Xft/Xft.h are not installed because they are not required via xft.pc.
Comment 3 Dmitry V. Levin 2010-10-31 17:11:36 UTC
Similar issue arose in libXt recently, and it was resolved in
https://bugs.freedesktop.org/show_bug.cgi?id=26943#c3
as a non-issue.

Is there any legal way now for libXft callers to find out what packages have to be installed to #include <X11/Xft/Xft.h>?
Comment 4 Alan Coopersmith 2010-10-31 17:38:07 UTC
(In reply to comment #3)
> Is there any legal way now for libXft callers to find out what packages have to
> be installed to #include <X11/Xft/Xft.h>?

Use a non-broken version of pkg-config, as the correct behavior according to
the FAQ is to include -I flags for Requires.private, and at least the version
on my system correctly does that: 

% grep Requires /usr/X11R7/lib/pkgconfig/xft.pc 
Requires: xproto
Requires.private: xrender, fontconfig, freetype2
% env PKG_CONFIG_PATH=/usr/X11R7/lib/pkgconfig pkg-config --cflags xft
-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -I/usr/X11R7/include -I/usr/include/freetype2  
% pkg-config --version
0.23

If you want to hold a discussion, please use the mailing list - bugzilla
is not a very interactive forum, and questions raised here won't be seen
by most developers.
Comment 5 Dmitry V. Levin 2010-10-31 19:24:37 UTC
(In reply to comment #4)
> % grep Requires /usr/X11R7/lib/pkgconfig/xft.pc 
> Requires: xproto
> Requires.private: xrender, fontconfig, freetype2

$ grep '^#include <X11/' /usr/include/X11/Xft/Xft.h
#include <X11/extensions/Xrender.h>
#include <X11/Xfuncproto.h>
#include <X11/Xft/XftCompat.h>

This is exactly the problem: according to X11/Xft/Xft.h, there is no difference between xproto and xrender -- both libraries are equally necessary to compile with libXft, so I'm sure both must be in Requires list.

> If you want to hold a discussion, please use the mailing list - bugzilla
> is not a very interactive forum, and questions raised here won't be seen
> by most developers.

What mailing list is more appropriate for this issue?
Comment 6 Julien Cristau 2010-11-01 08:08:53 UTC
> --- Comment #5 from Dmitry V. Levin <ldv@altlinux.org> 2010-10-31 19:24:37 PDT ---
> What mailing list is more appropriate for this issue?
> 
http://lists.freedesktop.org/mailman/listinfo/pkg-config
Comment 7 Alan Coopersmith 2010-11-26 11:13:04 UTC
*** Bug 31933 has been marked as a duplicate of this bug. ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.