[Xcb-commit] libxcb: 3 commits - check-pc-requires Makefile.am src xcb-present.pc.in xcb-randr.pc.in xcb-xinput.pc.in

Uli Schlachter psychon at kemper.freedesktop.org
Sat Mar 22 06:47:43 PDT 2014


 Makefile.am       |    8 +++++-
 check-pc-requires |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/c_client.py   |    2 -
 xcb-present.pc.in |    2 -
 xcb-randr.pc.in   |    2 -
 xcb-xinput.pc.in  |    2 -
 6 files changed, 81 insertions(+), 5 deletions(-)

New commits:
commit e2813e1cde893f384fa620ff3c13493beebabe0c
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 12 14:15:46 2014 -0800

    Update .pc file Requires lines to express full dependencies
    
    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>
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/xcb-present.pc.in b/xcb-present.pc.in
index 848ac02..e2eccc4 100644
--- a/xcb-present.pc.in
+++ b/xcb-present.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: XCB Present
 Description: XCB Present Extension
 Version: @PACKAGE_VERSION@
-Requires: xcb
+Requires: xcb xcb-randr xcb-xfixes xcb-sync
 Libs: -L${libdir} -lxcb-present
 Cflags: -I${includedir}
diff --git a/xcb-randr.pc.in b/xcb-randr.pc.in
index ac7f35d..09c3d12 100644
--- a/xcb-randr.pc.in
+++ b/xcb-randr.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: XCB RandR
 Description: XCB RandR Extension
 Version: @PACKAGE_VERSION@
-Requires: xcb
+Requires: xcb xcb-render
 Libs: -L${libdir} -lxcb-randr
 Cflags: -I${includedir}
diff --git a/xcb-xinput.pc.in b/xcb-xinput.pc.in
index ec31229..ff34ab4 100644
--- a/xcb-xinput.pc.in
+++ b/xcb-xinput.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: XCB XInput
 Description: XCB XInput Extension (EXPERIMENTAL)
 Version: @PACKAGE_VERSION@
-Requires: xcb
+Requires: xcb xcb-xfixes
 Libs: -L${libdir} -lxcb-xinput
 Cflags: -I${includedir}
commit 32de4c4213a49c61127c6957ea05fef3e5355291
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 12 14:15:45 2014 -0800

    Validate .pc file Requires lines
    
    This walks through the .pc.in files and makes sure all of the Requires
    lines express sufficient dependency information.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/Makefile.am b/Makefile.am
index 387c2f2..e912489 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -86,8 +86,14 @@ pkgconfig_DATA += xcb-xvmc.pc
 endif
 
 
+AM_TESTS_ENVIRONMENT = \
+	AM_SRCDIR=${srcdir}
+
+TESTS=check-pc-requires
+
 EXTRA_DIST = \
 tools/README \
 tools/api_conv.pl \
 tools/constants \
-autogen.sh
+autogen.sh \
+$(TESTS)
diff --git a/check-pc-requires b/check-pc-requires
new file mode 100755
index 0000000..0fd9c65
--- /dev/null
+++ b/check-pc-requires
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+case "$AM_SRCDIR" in
+"")
+	AM_SRCDIR="."
+	;;
+*)
+	;;
+esac
+
+fix=n
+status=0
+case "$1" in
+"-fix")
+	fix=y
+	;;
+esac
+
+for inc in src/*.h; do
+	package=xcb-`basename $inc .h`
+	pcin="$AM_SRCDIR"/$package.pc.in
+	if [ -f $pcin ]; then
+		included=`grep '# *include' $inc |
+			sed -e 's/[^<"]*[<"]//' -e 's/[>"]//' |
+			grep -v 'xcb.h\|xproto.h'`
+		requires=`grep '^Requires:' $pcin`
+		missing=""
+		for i in $included; do
+			ibase=`basename $i .h`
+			r="xcb-$ibase"
+			rpcin="$AM_SRCDIR"/$r.pc.in
+			if [ -f $rpcin ]; then
+				m="$r"
+				for has in $requires; do
+					if [ $has = $r ]; then
+						m=""
+					fi
+				done
+				case "$m" in
+				"")
+					;;
+				*)
+					case "$missing" in
+					"")
+						missing=$m
+						;;
+					*)
+						missing="$missing $m"
+						;;
+					esac
+					;;
+				esac
+			fi
+		done
+		case "$missing" in
+		"")
+			;;
+		*)
+			if [ "$fix" = "y" ]; then
+			    echo $package adding dependency on $missing
+			    sed -i '/^Requires:/s/$/ '"$missing"'/' $pcin
+			else
+			    echo $package missing $missing
+			    status=1
+			fi
+			;;
+		esac
+	fi
+done
+exit $status
commit 1f6cd9f1fcd3c07d323b678292c9cb00ae1f7504
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 12 14:15:44 2014 -0800

    Only #include directly referenced module header files
    
    This avoids having the nested header files also included at the top
    level, which is more efficient.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/c_client.py b/src/c_client.py
index aaaab2e..c94a9e6 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -190,7 +190,7 @@ def c_open(self):
     _c('#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)')
 
     if _ns.is_ext:
-        for (n, h) in self.imports:
+        for (n, h) in self.direct_imports:
             _hc('#include "%s.h"', h)
 
     _h('')


More information about the xcb-commit mailing list