Closed mistydemeo closed 8 years ago
Oh cool, finally clock_gettime!
I'm working on a patch.
Ok I've got master building on OSX 10.11 (el capitan?). I had to brew install homebrew/x11/libxkbcommon
because at some point in the last few years we needed libxkbcommon.
Can you check master and let me know if make
is successful on macOS Sierra? In theory, the new cflags.sh
should detect you're on a newer OSX and will skip injecting a custom clock_gettime.
Can confirm - works fine!
Woohoo!
I'll work on a new release (it's been a while...) and publish it as soon as I can.
Thanks! A new release would be helpful; the patch didn't apply cleanly to the last release and it'd be more convenient to just have a new release to upgrade to.
Release: https://github.com/jordansissel/xdotool/releases/tag/v3.20160804.1
Tarball: https://github.com/jordansissel/xdotool/archive/v3.20160804.1.tar.gz
The test suite passes for me, and some manual testing makes things seem OK on Linux.
Thanks! Have a PR up for the new release at Homebrew: https://github.com/Homebrew/homebrew-x11/pull/223
Couple things I noticed:
-lX11
is being stripped. Not sure if that's our fault or the Makefile's fault.rpath
fix is on by default, which breaks the build on Darwin since Apple's ld
doesn't support the flag with an =
. (ld: unknown option: -rpath=/usr/local/Cellar/xdotool/3.20160804.1/lib
)hmm... I'll spin up my mac and test. I confess I only tested this on Linux (Fedora 23).
Oh, right. I didn't have the Makefile detect and set WITHOUT_RPATH_FIX anywhere.
For now, make WITHOUT_RPATH_FIX=1
as you have in your patch makes sense to me.
As for the missing -lX11, I see it OK on my OSX 10.11 laptop. The Makefile hopes to use pkg-config
to ask about library needs, but if that fails, it falls back to this:
DEFAULT_LIBS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama -lxkbcommon
pkg-config --libs x11
fails for me under OSX saying Package x11 was not found in the pkg-config search path
, so when I do make
I see the use of DEFAULT_LIBS.
Can you attach the output of make libxdo.dylib
?
$ make libxdo.dylib
sh version.sh --header > xdo_version.h
clang -pipe -O2 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -Wno-missing-field-initializers -g -DMISSING_CLOCK_GETTIME -std=c99 -I/usr/local/Cellar/libxkbcommon/0.5.0/include -I/opt/X11/include -fPIC -c xdo_search.c
clang -pipe -O2 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -Wno-missing-field-initializers -g -DMISSING_CLOCK_GETTIME -std=c99 -I/usr/local/Cellar/libxkbcommon/0.5.0/include -I/opt/X11/include -fPIC -c xdo.c
clang -dynamiclib -Wl,-install_name,/usr/local/lib/libxdo.3.dylib xdo.o xdo_search.o -o libxdo.dylib -L/usr/local/Cellar/libxkbcommon/0.5.0/lib -L/opt/X11/lib -lXtst -lXinerama -lxkbcommon
Undefined symbols for architecture x86_64:
"_XAllocClassHint", referenced from:
_xdo_set_window_class in xdo.o
"_XAllocWMHints", referenced from:
_xdo_set_window_urgency in xdo.o
"_XAllowEvents", referenced from:
_xdo_select_window_with_click in xdo.o
"_XChangeKeyboardMapping", referenced from:
_xdo_send_keysequence_window_list_do in xdo.o
"_XChangeProperty", referenced from:
_xdo_set_window_property in xdo.o
"_XChangeWindowAttributes", referenced from:
_xdo_set_window_override_redirect in xdo.o
"_XCloseDisplay", referenced from:
_xdo_free in xdo.o
"_XConfigureWindow", referenced from:
_xdo_move_window in xdo.o
_xdo_set_window_size in xdo.o
"_XCreateFontCursor", referenced from:
_xdo_select_window_with_click in xdo.o
"_XDefaultRootWindow", referenced from:
_xdo_get_active_window in xdo.o
__xdo_ewmh_is_supported in xdo.o
_xdo_get_number_of_desktops in xdo.o
_xdo_get_current_desktop in xdo.o
"_XDestroyWindow", referenced from:
_xdo_close_window in xdo.o
"_XDisplayKeycodes", referenced from:
_xdo_new_with_opened_display in xdo.o
"_XFlush", referenced from:
_xdo_map_window in xdo.o
_xdo_unmap_window in xdo.o
_xdo_reparent_window in xdo.o
_xdo_set_window_size in xdo.o
_xdo_focus_window in xdo.o
_xdo_raise_window in xdo.o
_xdo_move_mouse in xdo.o
...
"_XFree", referenced from:
_xdo_new_with_opened_display in xdo.o
_xdo_get_window_location in xdo.o
_xdo_set_window_class in xdo.o
_xdo_set_window_urgency in xdo.o
_xdo_find_window_client in xdo.o
_xdo_send_keysequence_window_list_do in xdo.o
_xdo_get_viewport_dimensions in xdo.o
...
"_XFreeCursor", referenced from:
_xdo_select_window_with_click in xdo.o
"_XFreeModifiermap", referenced from:
_xdo_new_with_opened_display in xdo.o
_xdo_send_keysequence_window_list_do in xdo.o
_xdo_get_active_modifiers in xdo.o
"_XFreeStringList", referenced from:
__xdo_match_window_name in xdo_search.o
"_XGetAtomName", referenced from:
_xdo_get_desktop_viewport in xdo.o
"_XGetClassHint", referenced from:
_xdo_set_window_class in xdo.o
_check_window_match in xdo_search.o
"_XGetInputFocus", referenced from:
_xdo_get_focused_window in xdo.o
"_XGetKeyboardMapping", referenced from:
_xdo_new_with_opened_display in xdo.o
_xdo_send_keysequence_window_list_do in xdo.o
"_XGetModifierMapping", referenced from:
_xdo_new_with_opened_display in xdo.o
_xdo_send_keysequence_window_list_do in xdo.o
_xdo_get_active_modifiers in xdo.o
"_XGetWMHints", referenced from:
_xdo_set_window_urgency in xdo.o
"_XGetWMName", referenced from:
__xdo_match_window_name in xdo_search.o
"_XGetWMNormalHints", referenced from:
_xdo_translate_window_with_sizehint in xdo.o
"_XGetWindowAttributes", referenced from:
_xdo_wait_for_window_map_state in xdo.o
_xdo_get_window_location in xdo.o
_xdo_get_window_size in xdo.o
_xdo_activate_window in xdo.o
_xdo_set_desktop_for_window in xdo.o
_xdo_move_mouse_relative_to_window in xdo.o
_xdo_minimize_window in xdo.o
...
"_XGetWindowProperty", referenced from:
_xdo_get_window_property_by_atom in xdo.o
"_XGrabPointer", referenced from:
_xdo_select_window_with_click in xdo.o
"_XIconifyWindow", referenced from:
_xdo_minimize_window in xdo.o
"_XInternAtom", referenced from:
_xdo_set_window_property in xdo.o
_xdo_get_active_window in xdo.o
_xdo_activate_window in xdo.o
__xdo_ewmh_is_supported in xdo.o
_xdo_get_desktop_for_window in xdo.o
_xdo_set_current_desktop in xdo.o
_xdo_set_number_of_desktops in xdo.o
...
"_XKeysymToString", referenced from:
_xdo_enter_text_window in xdo.o
"_XKillClient", referenced from:
_xdo_kill_window in xdo.o
"_XMapWindow", referenced from:
_xdo_map_window in xdo.o
"_XOpenDisplay", referenced from:
_xdo_new in xdo.o
"_XQueryKeymap", referenced from:
_xdo_get_active_modifiers in xdo.o
"_XQueryPointer", referenced from:
_xdo_get_mouse_location2 in xdo.o
_xdo_get_input_state in xdo.o
"_XQueryTree", referenced from:
_xdo_get_window_location in xdo.o
_xdo_find_window_client in xdo.o
_find_matching_windows in xdo_search.o
"_XRaiseWindow", referenced from:
_xdo_raise_window in xdo.o
"_XReparentWindow", referenced from:
_xdo_reparent_window in xdo.o
"_XScreenNumberOfScreen", referenced from:
_xdo_move_mouse_relative_to_window in xdo.o
_xdo_minimize_window in xdo.o
"_XSendEvent", referenced from:
_xdo_activate_window in xdo.o
_xdo_set_current_desktop in xdo.o
_xdo_set_number_of_desktops in xdo.o
_xdo_set_desktop_for_window in xdo.o
__xdo_mousebutton in xdo.o
_xdo_send_keysequence_window_list_do in xdo.o
_xdo_set_desktop_viewport in xdo.o
...
"_XSetClassHint", referenced from:
_xdo_set_window_class in xdo.o
"_XSetInputFocus", referenced from:
_xdo_focus_window in xdo.o
"_XSetWMHints", referenced from:
_xdo_set_window_urgency in xdo.o
"_XStringToKeysym", referenced from:
__xdo_send_keysequence_window_do in xdo.o
"_XSync", referenced from:
_xdo_send_keysequence_window_list_do in xdo.o
_xdo_clear_active_modifiers in xdo.o
_xdo_set_active_modifiers in xdo.o
"_XTranslateCoordinates", referenced from:
_xdo_get_window_location in xdo.o
_xdo_move_mouse_relative_to_window in xdo.o
__xdo_mousebutton in xdo.o
"_XUngrabPointer", referenced from:
_xdo_select_window_with_click in xdo.o
"_XUnmapWindow", referenced from:
_xdo_unmap_window in xdo.o
"_XWarpPointer", referenced from:
_xdo_move_mouse in xdo.o
"_XWindowEvent", referenced from:
_xdo_select_window_with_click in xdo.o
"_XkbFreeClientMap", referenced from:
_xdo_new_with_opened_display in xdo.o
"_XkbGetMap", referenced from:
_xdo_new_with_opened_display in xdo.o
"_XkbGetState", referenced from:
_xdo_send_keysequence_window_list_do in xdo.o
"_XkbKeycodeToKeysym", referenced from:
_xdo_new_with_opened_display in xdo.o
"_XkbLockGroup", referenced from:
_xdo_send_keysequence_window_list_do in xdo.o
"_Xutf8TextPropertyToTextList", referenced from:
__xdo_match_window_name in xdo_search.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libxdo.dylib] Error 1
pkg-config --libs x11 fails for me under OSX saying Package x11 was not found in the pkg-config search path, so when I do make I see the use of DEFAULT_LIBS.
Since we specify an X11 dependency, we call pkg-config with PKG_CONFIG_LIBDIR
set which causes it to find x11. However, it returns sensible flags:
-L/opt/X11/lib -lX11
Oh, it looks like the flags are LIBXDO_LIBS
, which uses pkg-config --libs xtst xinerama xkbcommon
and doesn't include pkg-config --libs x11
.
hmm.. I think I might know what's going on here... speculating.
Can you try this patch?
diff --git a/Makefile b/Makefile
index 85bf0de..cb763db 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ DEFAULT_LIBS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama -lxkbcomm
DEFAULT_INC=-I/usr/X11R6/include -I/usr/local/include
XDOTOOL_LIBS=$(shell pkg-config --libs x11 2> /dev/null || echo "$(DEFAULT_LIBS)") $(shell sh platform.sh extralibs)
-LIBXDO_LIBS=$(shell pkg-config --libs xtst xinerama xkbcommon 2> /dev/null || echo "$(DEFAULT_LIBS)")
+LIBXDO_LIBS=$(shell pkg-config --libs x11 xtst xinerama xkbcommon 2> /dev/null || echo "$(DEFAULT_LIBS)")
INC=$(shell pkg-config --cflags x11 xtst xinerama xkbcommon 2> /dev/null || echo "$(DEFAULT_INC)")
CFLAGS+=-std=c99 $(INC)
Haha, yep! We both had the same thought. That looks to be it.
@mistydemeo yeah I think you are right. On Fedora 23 building libxdo.so looks like this:
cc -shared -Wl,-soname=libxdo.so.3 xdo.o xdo_search.o -o libxdo.so -lXtst -lXinerama -lxkbcommon
No libX11, but ldd
shows it was linked anyway:
% ldd ./libxdo.so | grep X11
libX11.so.6 => /lib64/libX11.so.6 (0x00007f23a0f7e000)
I think the linker on fedora has some kind of dependency management where I can have libxdo.so depend on libXinerama, and libXinerama itself needs libX11, and ldd
is like "ok cool, we have libX11".... the fact that this works seems like a bug. Good catch!
Thanks for the quick merges! I'll apply these patches to the Homebrew formula (unless you're planning a bugfix release).
I'll push a new patch release
Tested on Fedora 23 and OSX 10.11. Fingers crossed that we've got it right this time ;)
Hm, cflags.sh
seems to be missing from the generated tarball for me.
Oh, rather, the generated tarball has it but the releases
tarball you linked doesn't.
Hmm, weird that the tarball tests worked. I will fix this tomorrow morning.
On Thursday, August 4, 2016, Misty De Meo notifications@github.com wrote:
Oh, rather, the generated tarball has it but the releases tarball you linked doesn't.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jordansissel/xdotool/issues/138#issuecomment-237763992, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIC6ifNUJ639l3Euge4FkU_c5wj1OZ9ks5qctLIgaJpZM4JaS1G .
I fixed the release tests (make test-package-build
) and they pass on both OSX 10.11 and Fedora 23 for me.
Maybe the 3rd time will work, haha:
https://github.com/jordansissel/xdotool/releases/download/v3.20160805.1/xdotool-3.20160805.1.tar.gz
Yep, looks fine now!
9bc31403b95826d9fd8d6540c459ee862b2ac127 added a definition of
clock_gettime
for OS X. However, OS X 10.12 now includes a nativeclock_gettime
, and so the redefinition causes the build to fail.Originally reported in Homebrew here: https://github.com/Homebrew/homebrew-x11/issues/219