[Xcb] [PATCH 2/2] Update .pc file Requires lines to express full dependencies

Uli Schlachter psychon at znc.in
Wed Feb 12 12:44:06 PST 2014


On 12.02.2014 21:14, Keith Packard wrote:
> Some xcb libraries depend on others; make these dependencies explicit
> in the .pc files that are installed.
> 
> This change was generated automatically by running 'check-pc-requires -fix'
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  xcb-composite.pc.in | 2 +-
>  xcb-damage.pc.in    | 2 +-
>  xcb-present.pc.in   | 2 +-
>  xcb-randr.pc.in     | 2 +-
>  xcb-xinput.pc.in    | 2 +-
>  xcb-xvmc.pc.in      | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xcb-composite.pc.in b/xcb-composite.pc.in
> index 02d49b0..d266c7c 100644
> --- a/xcb-composite.pc.in
> +++ b/xcb-composite.pc.in
> @@ -6,6 +6,6 @@ includedir=@includedir@
>  Name: XCB Composite
>  Description: XCB Composite Extension
>  Version: @PACKAGE_VERSION@
> -Requires: xcb xcb-xfixes
> +Requires: xcb xcb-xfixes xcb-render xcb-shape
>  Libs: -L${libdir} -lxcb-composite
>  Cflags: -I${includedir}
[...]

First: Thanks a lot for looking into this!

However, I don't like the result. composite.xml "<import>"s only xproto and
xfixes. The dependency on render and shape occur because xfixes depends on
these. In other words, your tool is including transitive dependencies.

However, these aren't dependencies of xcb-composite itself and pkg-config is
smart enough to resolve transitive dependencies by itself:

$ pkg-config --libs xcb-composite
-L/usr/local/lib -lxcb-composite -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb

Since I don't see any reason for including transitive deps, I would vote for not
including them.

Hopefully this simplifies the .sh script since right now I have no idea what
exactly the different parts are doing. Also, for that script I'd like propose a
little help text at the end. Something like "Run `$0 -fix' to automatically fix
these issues" if any complaints were generated.

(Also, your tool will (silently) fail with out-of-tree builds, because either
the .pc.in or the src/*.h files can't be found. I guess automake runs tests in
the build dir, but I am not sure. And I don't care a lot about this issue since
the script is already complicated enough).

(Oh and stylistic nitpick: I prefer 'if "x$foo" = x ;' over the case-s, but
since this is personal taste, this can be ignored, too.)

Thanks!
Uli
-- 
No matter how much cats fight, there always seem to be plenty of kittens.


More information about the xorg-devel mailing list