xcb-util-cursor broken

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xcb-util-cursor broken

David Coppa

Hi!

x11/i3 (and x11/awesome too) wants to use libxcb-cursor.
Back in the days I patched upstream code and reverted it to use libXcursor.
Now that we have xcb-util-cursor I want to remove those patches.
However, xcb-util-cursor is currently broken:

[i3] CC src/config_parser.c
cc -DI3_VERSION=\"'4.7.2 (2014-01-23, branch \"tags/4.7.2\")'\" -DMAJOR_VERSION=4 -DMINOR_VERSION=7 -DPATCH_VERSION=2 -DSYSCONFDIR=\"/etc\" -DI3__FILE__=__FILE__ -DPCRE_HAS_UCP=1 -DPANGO_SUPPORT=1   -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/X11R6/include/pixman-1 -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/pango-1.0 -I/usr/local/include/cairo -I/usr/X11R6/include/pixman-1 -I/usr/local/include/libpng16 -I/usr/X11R6/include -I/usr/local/include/harfbuzz -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/X11R6/include/freetype2 -I/usr/local/include/yajl -idirafter /usr/ports/pobj/i3-4.7.2/i3-4.7.2/yajl-fallbac!
 k  -I/usr/local/include -I/usr/local/include/startup-notification-1.0 -std=c99 -Wall -Wunused-value -Iinclude -I/usr/X11R6/include -I/usr/local/include -O2 -pipe -L/usr/X11R6/lib -L/usr/local/lib  -DTEST_PARSER -g -o test.config_parser src/config_parser.c -L/usr/ports/pobj/i3-4.7.2/i3-4.7.2 -li3 -lm -liconv -L/usr/X11R6/lib -lxcb -L/usr/X11R6/lib -lxcb-util -lxcb -L/usr/X11R6/lib -lxcb-util -lxcb -L/usr/X11R6/lib -lxcb-keysyms -lxcb -L/usr/X11R6/lib -lxcb-icccm -lxcb -L/usr/X11R6/lib -lxcb-xinerama -lxcb -L/usr/X11R6/lib -lxcb-randr -lxcb -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lxcb-cursor -lxcb -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -lcairo -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -L/usr/X11R6/lib -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lm -lgobject-2.0 -lglib-2.0 -lintl -lfreetype -lz -lfontconfig -L/usr/local/lib -lyajl -lev -L/usr/local/lib -lpcre -L/usr/local/lib -lstartup-notification-1 -lm
src/config_parser.c:162: warning: type qualifiers ignored on function return type
/usr/local/lib/libglib-2.0.so.4000.0: warning: vsprintf() is often misused, please use vsnprintf()
/usr/local/lib/libglib-2.0.so.4000.0: warning: stpcpy() is dangerous GNU crap; don't use it
/tmp//ccBo5VvY.o(.text+0x1a21): In function `parse_config':
src/config_parser.c:498: warning: strcpy() is almost always misused, please use strlcpy()
/usr/local/lib/libcairo.so.12.2: warning: rand() isn't random; consider using arc4random()
/usr/X11R6/lib/libX11.so.16.0: warning: strcat() is almost always misused, please use strlcat()
/usr/X11R6/lib/libX11.so.16.0: warning: sprintf() is often misused, please use snprintf()
/usr/X11R6/lib/libxcb-cursor.so.0.0: undefined reference to `le32toh'
collect2: ld returned 1 exit status
src/i3.mk:55: recipe for target 'src/config_parser.o' failed
gmake: *** [src/config_parser.o] Error 1

If I got it right, letoh32 is equivalent to linux' le32toh.
The following diff works for me.

OK?

Index: cursor/parse_cursor_file.c
===================================================================
RCS file: /cvs/xenocara/lib/xcb-util-cursor/cursor/parse_cursor_file.c,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 parse_cursor_file.c
--- cursor/parse_cursor_file.c 14 Apr 2014 19:28:48 -0000 1.1.1.1
+++ cursor/parse_cursor_file.c 15 Apr 2014 08:50:12 -0000
@@ -42,6 +42,9 @@
 #endif
 #ifdef HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
+# ifndef HAVE_LE32TOH
+#  define le32toh(x) letoh32(x)
+# endif
 #endif
 #ifdef HAVE_SYS_BYTEORDER_H
 #include <sys/byteorder.h>

Reply | Threaded
Open this post in threaded view
|

Re: xcb-util-cursor broken

Matthieu Herrb
On Tue, Apr 15, 2014 at 10:52:25AM +0200, David Coppa wrote:

>
> Hi!
>
> x11/i3 (and x11/awesome too) wants to use libxcb-cursor.
> Back in the days I patched upstream code and reverted it to use libXcursor.
> Now that we have xcb-util-cursor I want to remove those patches.
> However, xcb-util-cursor is currently broken:
>
> [i3] CC src/config_parser.c
> cc -DI3_VERSION=\"'4.7.2 (2014-01-23, branch \"tags/4.7.2\")'\" -DMAJOR_VERSION=4 -DMINOR_VERSION=7 -DPATCH_VERSION=2 -DSYSCONFDIR=\"/etc\" -DI3__FILE__=__FILE__ -DPCRE_HAS_UCP=1 -DPANGO_SUPPORT=1   -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/X11R6/include/pixman-1 -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/pango-1.0 -I/usr/local/include/cairo -I/usr/X11R6/include/pixman-1 -I/usr/local/include/libpng16 -I/usr/X11R6/include -I/usr/local/include/harfbuzz -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/X11R6/include/freetype2 -I/usr/local/include/yajl -idirafter /usr/ports/pobj/i3-4.7.2/i3-4.7.2/yajl-fallb!
 ack  -I/usr/local/include -I/usr/local/include/startup-notification-1.0 -std=c99 -Wall -Wunused-value -Iinclude -I/usr/X11R6/include -I/usr/local/include -O2 -pipe -L/usr/X11R6/lib -L/usr/local/lib  -DTEST_PARSER -g -o test.config_parser src/config_parser.c -L/usr/ports/pobj/i3-4.7.2/i3-4.7.2 -li3 -lm -liconv -L/usr/X11R6/lib -lxcb -L/usr/X11R6/lib -lxcb-util -lxcb -L/usr/X11R6/lib -lxcb-util -lxcb -L/usr/X11R6/lib -lxcb-keysyms -lxcb -L/usr/X11R6/lib -lxcb-icccm -lxcb -L/usr/X11R6/lib -lxcb-xinerama -lxcb -L/usr/X11R6/lib -lxcb-randr -lxcb -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lxcb-cursor -lxcb -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -lcairo -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -L/usr/X11R6/lib -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lm -lgobject-2.0 -lglib-2.0 -lintl -lfreetype -lz -lfontconfig -L/usr/local/lib -lyajl -lev -L/usr/local/lib -lpcre -L/usr/local/lib -lstartup-notification-1 -lm

> src/config_parser.c:162: warning: type qualifiers ignored on function return type
> /usr/local/lib/libglib-2.0.so.4000.0: warning: vsprintf() is often misused, please use vsnprintf()
> /usr/local/lib/libglib-2.0.so.4000.0: warning: stpcpy() is dangerous GNU crap; don't use it
> /tmp//ccBo5VvY.o(.text+0x1a21): In function `parse_config':
> src/config_parser.c:498: warning: strcpy() is almost always misused, please use strlcpy()
> /usr/local/lib/libcairo.so.12.2: warning: rand() isn't random; consider using arc4random()
> /usr/X11R6/lib/libX11.so.16.0: warning: strcat() is almost always misused, please use strlcat()
> /usr/X11R6/lib/libX11.so.16.0: warning: sprintf() is often misused, please use snprintf()
> /usr/X11R6/lib/libxcb-cursor.so.0.0: undefined reference to `le32toh'
> collect2: ld returned 1 exit status
> src/i3.mk:55: recipe for target 'src/config_parser.o' failed
> gmake: *** [src/config_parser.o] Error 1
>
> If I got it right, letoh32 is equivalent to linux' le32toh.
> The following diff works for me.
>
> OK?
>
> Index: cursor/parse_cursor_file.c
> ===================================================================
> RCS file: /cvs/xenocara/lib/xcb-util-cursor/cursor/parse_cursor_file.c,v
> retrieving revision 1.1.1.1
> diff -u -p -u -p -r1.1.1.1 parse_cursor_file.c
> --- cursor/parse_cursor_file.c 14 Apr 2014 19:28:48 -0000 1.1.1.1
> +++ cursor/parse_cursor_file.c 15 Apr 2014 08:50:12 -0000
> @@ -42,6 +42,9 @@
>  #endif
>  #ifdef HAVE_SYS_ENDIAN_H
>  #include <sys/endian.h>
> +# ifndef HAVE_LE32TOH
> +#  define le32toh(x) letoh32(x)
> +# endif
>  #endif
>  #ifdef HAVE_SYS_BYTEORDER_H
>  #include <sys/byteorder.h>
>

Yes.
--
Matthieu Herrb