Skip to content
Peter Hutterer edited this page Dec 8, 2020 · 30 revisions

libwacom is a library to help implement Wacom tablet settings. It is intended to be used by client-programs that need model identification beyond what the kernel provides. It is being used by GNOME's mutter and the GNOME Control Center Wacom tablet applet as well as libinput.

Purpose

Libwacom supplies metadata about Wacom tablets that is not available from the device itself. This includes information about which styli are supported, whether the tablet can be rotated, whether it's integrated into a screen, etc. This information can then be used to control the tablet itself. For example the Wacom tablet configuration in GNOME uses the information exported by libwacom to

  • map the tablet to a screen if whether the tablet is built-in (Cintiq or tablet PC)
  • allow the tablet to change to left-handed if it is reversible
  • have a per-stylus configuration on all supported styli

Note that the libwacom itself does not control the behavior of the device, it merely provides information about this device (usually based on a vendor and product ID lookup).

Git Repository and Tar Files

To clone the git repository use:

git clone https://github.com/linuxwacom/libwacom.git

Maintainer

Peter Hutterer is the current libwacom maintainer.

Please do not send email regarding bugs or feature requests to the maintainer. Use the issue tracker instead.

Dependencies

Before building from git with ./autogen.sh, install the dependencies:

On Ubuntu:

First open the "Software & Updates" program and ensure the "Source code" box is enabled in the "Ubuntu Software" tab. Close the window and tell it to reload the software list if prompted. Next, install the dependencies by running:

sudo apt-get install build-essential && sudo apt-get build-dep libwacom

If the above command does not work, you may attempt to manually install the build dependencies instead:

sudo apt-get install build-essential libgudev-1.0-dev libxml++2.6-dev

On Fedora or CentOS:

sudo dnf builddep libwacom

Building

libwacom currently supports autotools and the more modern meson build system. As user it doesn't really matter which one of the two you pick.

Building with meson

Meson requires a build directory to be specified, here we use builddir. This directory can be removed at any time, it merely contains all the build artifacts. Navigate into the libwacom source directory and run the following commands:

meson builddir --prefix=/usr
ninja -C builddir
sudo ninja -C builddir install

To re-build simply run the ninja commands above. Removing the builddir is safe but you'll have to run meson to re-generate it.

Building with autotools

Depending on your system, you may find it necessary to use this procedure instead of the meson instructions above. Navigate into the libwacom source directory and run the following commands:

On Fedora, RHEL, CentOS, etc:

./autogen.sh --prefix=/usr --libdir=/lib64
make
sudo make install

On Ubuntu, Debian, Mint, etc:

./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu/
make
sudo make install

On Arch, Manjaro, etc:

./autogen.sh --prefix=/usr
make
sudo make install

If you are building on Ubuntu and run into the following error, run sudo apt-get install libtool and then reattempt the build.

Makefile.am: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:   its definition is in aclocal's search path.

Data Files

During make install, the data files are installed into the supplied prefix, usually /usr/share/libwacom. If data files have already been installed by a distribution-supplied package, there may be duplicates that prevent libwacom from working properly. To check if duplicates exist and are causing problems, run the following and ensure it does not print out an error about a "duplicate match":

libwacom-list-local-devices

If a duplicate match is found, you will need to read the Troubleshooting article's section on duplicate matches.

For local testing of new data files, you can just copy the data file(s) directly into the directory and check for duplicates as described above.

sudo cp -r /home/<path>/libwacom/data/* /usr/share/libwacom/