Skip to content

Commit

Permalink
Linux: Add -lxkbcommon-x11 -lxkbcommon lflags
Browse files Browse the repository at this point in the history
These flags were determined from `pkg-config --libs xkbcommon-x11` on my
system.

This enables resolving the `xkb_x11_get_core_keyboard_device_id` symbol
and others. I think this commit will fix #268.

---

Before:

```
$ ldd build/Release/uiohook.so
	linux-vdso.so.1 =>  (0x00007ffc3efc9000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f5d1fb94000)
	libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f5d1f992000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5d1f775000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5d1f3ab000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f5d1f189000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5d1ef85000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5d200d7000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5d1ed81000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5d1eb7b000)
```

After, now with references to `libxkbcommon-x11.so` & `libxkbcommon.so`:

```
$ ldd build/Release/uiohook.so
	linux-vdso.so.1 =>  (0x00007ffc6fdd3000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa47cd5c000)
	libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fa47cb5a000)
	libxkbcommon-x11.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007fa47c952000)
	libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa47c713000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa47c4f6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa47c12c000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa47bf0a000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa47bd06000)
	libxcb-xkb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fa47baeb000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa47d29f000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa47b8e7000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa47b6e1000)
```
  • Loading branch information
zbanks committed Dec 29, 2020
1 parent 2f86116 commit 0f88b1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build_def/linux/uiohook.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"-Wl,-rpath,<!(node -e \"console.log('builds/' + process.env.gyp_iohook_runtime + '-v' + process.env.gyp_iohook_abi + '-' + process.env.gyp_iohook_platform + '-' + process.env.gyp_iohook_arch + '/build/Release')\")",
"-Wl,-rpath,<!(pwd)/build/Release/",
"-lX11",
"-lX11-xcb"
"-lX11-xcb",
"-lxkbcommon-x11",
"-lxkbcommon"
]
},
"defines": [
Expand Down
2 changes: 1 addition & 1 deletion docs/manual-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When you run `npm run build`, it will try to download a prebuilt for your platfo
:::

## Linux
- `sudo apt-get install -y libxkbcommon-x11-0 # Needed on WSL`
- `sudo apt-get install -y libx11-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev`
- `npm run build`

## macOS
Expand Down

0 comments on commit 0f88b1e

Please sign in to comment.