File U_Check-for-either-xfont.pc-or-xfont2.pc.patch of Package xf86-video-qxl
From e13d28ee5d8724fc4b22f26bce01a7d36355f272 Mon Sep 17 00:00:00 2001
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Date: Fri, 26 Aug 2016 11:44:55 -0400
Subject: [PATCH] Check for either xfont.pc or xfont2.pc
More recent versions of Xfont have a different API (with namespacing
for libXfont functions.) Check for xfont2.pc and if found, use that, and
use the new API. The rational for preferring libXfont2 is that as a recent
change the xserver module looks for and requires libXfont2, and it's better
not to have both versions of the library in process.
---
configure.ac | 8 +++++++-
src/uxa/uxa-damage.c | 10 +++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
Index: xf86-video-qxl-0.1.4/configure.ac
===================================================================
--- xf86-video-qxl-0.1.4.orig/configure.ac
+++ xf86-video-qxl-0.1.4/configure.ac
@@ -60,8 +60,14 @@ XORG_DRIVER_CHECK_EXT(RENDER, renderprot
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto)
+# We can use either version 1 or version 2 of libXfont
+PKG_CHECK_EXISTS(xfont2,
+ [xfont_pc=xfont2
+ AC_DEFINE(HAVE_XFONT2,1,[Version 2 of the libXfont library])],
+ [xfont_pc=xfont])
+
# Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto xfont $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto fontsproto $xfont_pc $REQUIRED_MODULES)
save_CFLAGS="$CFLAGS"
Index: xf86-video-qxl-0.1.4/src/uxa/uxa-damage.c
===================================================================
--- xf86-video-qxl-0.1.4.orig/src/uxa/uxa-damage.c
+++ xf86-video-qxl-0.1.4/src/uxa/uxa-damage.c
@@ -32,7 +32,11 @@
#include "windowstr.h"
#include <X11/fonts/font.h>
#include <X11/fonts/fontstruct.h>
+#ifdef HAVE_XFONT2
+#include <X11/fonts/libxfont2.h>
+#else
#include <X11/fonts/fontutil.h>
+#endif
#include "dixfontstr.h"
#include "gcstruct.h"
#include "picturestr.h"
@@ -946,8 +950,12 @@ uxa_damage_chars (RegionPtr region,
{
ExtentInfoRec extents;
BoxRec box;
-
+
+#ifdef HAVE_XFONT2
+ xfont2_query_glyph_extents(font, charinfo, n, &extents);
+#else
QueryGlyphExtents(font, charinfo, n, &extents);
+#endif
if (imageblt)
{
if (extents.overallWidth > extents.overallRight)