Skip to content
Ping Cheng edited this page Jul 23, 2024 · 7 revisions

Git Repository and tarballs

To clone the git repository use:

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

Released versions of libwacom are available here: https://github.com/linuxwacom/libwacom/releases

Dependencies

Before building from the source, you need to 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

On Fedora or CentOS:

sudo dnf builddep libwacom pytest
pip install libevdev

On other distributions:

Check the CI script for a list of build dependencies. Package names are usually similar across distributions, install those packages with your package manager and then proceed to build libwacom itself.

Uninstall Existing libwacom Packages on Your System

Your system most likely has a libwacom installed out of box. Since the data format and file names may change between versions, installing on top of an existing libwacom would corrupt or duplicate the tablet's data files. Please uninstall the libwacom packages on your system before moving to the next step.

On Ubuntu:

Find the installed libwacom packages and uninstall them:

apt list --installed | grep libwacom
sudo apt remove "add the packages listed from above command"

On Fedora or CentOS:

yum list installed | grep libwacom
sudo yum remove "add the packages listed from above command"

Building

libwacom uses the meson build system. 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 setup builddir --prefix=/usr
meson compile -C builddir
sudo meson install -C builddir

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

To uninstall, run sudo ninja -C builddir uninstall and re-install the distribution-provided libwacom package to ensure all files are in place.

Data Files

During 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 with a different name, 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 `/etc/libwacom/ directory and check for duplicates as described above.

mkdir -p /etc/libwacom
sudo cp -r /home/<path>/libwacom/data/<the data file>.tablet /etc/libwacom/