Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2011 12:56:32 GMT
From:      bob frazier <bobf@mrp3.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/163447: pulseaudio fails to build with latest x11 'xcb' ports
Message-ID:  <201112191256.pBJCuW9l000966@red.freebsd.org>
Resent-Message-ID: <201112191300.pBJD0MRJ016845@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         163447
>Category:       ports
>Synopsis:       pulseaudio fails to build with latest x11 'xcb' ports
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 19 13:00:22 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     bob frazier
>Release:        7.4-STABLE
>Organization:
S.F.T. Inc.
>Environment:
FreeBSD BSDSilver.SFT.local 7.4-STABLE FreeBSD 7.4-STABLE #15: Thu Dec 15 19:14:22 PST 2011     root@BSDSilver.SFT.local:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
a recent update to x11/libxcb (and related ports) changes the API for xcb atom requests.  web search reveals this is not unique to freebsd, either.  The problem centers around the elimination of the 'xcb_atom_get' function and the renaming of an atom identifier 'STRING' to 'XCB_ENUM_STRING'.  Patching the appropriate file appears to correct the build issues, and the changes are consistent with recommended methods for reading an atom as per documentation:

  http://xcb.freedesktop.org/tutorial/

however, thorough testing SHOULD be done before putting the patch into the port, and changes should be made to the code to reflect this new library (rather than simply patching it so that it works).

marked serious+high priority due to LOTS OF GNOME PORTS DEPENDING ON THIS and the upcoming release of 9.0 (so you want to have a good ports tree for the new distro)

>How-To-Repeat:
attempt to build audio/pulseaudio using the latest ports collection (after upgrades to libxcb and related ports).  Note build failure of src/pulsecore/x11prop.c


>Fix:
place attached patch file 'as-is' into audio/pulseaudio/files, clean (to force re-extract + re-patch), and 'make'



Patch attached with submission follows:

--- src/pulsecore/x11prop.c.orig	2010-11-25 16:45:23.000000000 -0800
+++ src/pulsecore/x11prop.c	2011-12-19 04:46:27.000000000 -0800
@@ -55,12 +55,32 @@
     pa_assert(xcb);
     pa_assert(name);
     pa_assert(data);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        a = xcb_atom_get(xcb, name);
-        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
+/*        a = xcb_atom_get(xcb, name);
+   xcb_atom_get no longer supported - this is from xcb.freedesktop.org/tutorial
+*/
+        xcb_intern_atom_cookie_t ak;
+        xcb_intern_atom_reply_t *ar;
+
+        ak = xcb_intern_atom(xcb, 0, strlen(name), name);
+        ar = xcb_intern_atom_reply(xcb, ak, NULL);
+        if(ar)
+        {
+          a = ar->atom;
+          free(ar);
+        }
+        else
+        {
+          a = 0; // not sure if this is correct
+        }
+
+/*        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
+  STRING no longer defined, equivalent definition is now in an enumeration
+*/
+        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
     }
 }
 
 void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
     xcb_screen_t *xs;
@@ -68,11 +88,29 @@
 
     pa_assert(xcb);
     pa_assert(name);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        a = xcb_atom_get(xcb, name);
+/*        a = xcb_atom_get(xcb, name);
+   xcb_atom_get no longer supported - this is from xcb.freedesktop.org/tutorial
+*/
+        xcb_intern_atom_cookie_t ak;
+        xcb_intern_atom_reply_t *ar;
+
+        ak = xcb_intern_atom(xcb, 0, strlen(name), name);
+        ar = xcb_intern_atom_reply(xcb, ak, NULL);
+
+        if(ar)
+        {
+          a = ar->atom;
+          free(ar);
+        }
+        else
+        {
+          a = 0; // not sure if this is correct
+        }
+
         xcb_delete_property(xcb, xs->root, a);
     }
 }
 
 char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char *p, size_t l) {
@@ -97,13 +135,34 @@
      */
     if (!xs && 0 != screen)
         xs = screen_of_display(xcb, 0);
 
     if (xs) {
-        a = xcb_atom_get(xcb, name);
+/*        a = xcb_atom_get(xcb, name);
+   xcb_atom_get no longer supported - this is from xcb.freedesktop.org/tutorial
+*/
+          xcb_intern_atom_cookie_t ak;
+          xcb_intern_atom_reply_t *ar;
+
+          ak = xcb_intern_atom(xcb, 0, strlen(name), name);
+          ar = xcb_intern_atom_reply(xcb, ak, NULL);
+
+          if(ar)
+          {
+            a = ar->atom;
+            free(ar);
+          }
+          else
+          {
+            a = 0; // not sure if this is correct
+          }
+
+/*        req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1));
+   STRING no longer defined, equivalent definition is now in an enumeration
+*/
+        req = xcb_get_property(xcb, 0, xs->root, a, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
 
-        req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1));
         prop = xcb_get_property_reply(xcb, req, NULL);
 
         if (!prop)
             goto finish;
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112191256.pBJCuW9l000966>