Skip to content

Instantly share code, notes, and snippets.

@ixxie
Last active September 6, 2020 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ixxie/ddb2b8b3f1ec1f555e2c753879b5174c to your computer and use it in GitHub Desktop.
Save ixxie/ddb2b8b3f1ec1f555e2c753879b5174c to your computer and use it in GitHub Desktop.
{config, pkgs, fetchurl, ...}:
{
nixpkgs.overlays = [
(self: super: {
xf86_input_wacom = super.xf86_input_wacom.overrideAttrs rec {
name = "xf86-input-wacom-0.39.0";
src = fetchurl {
url = "mirror://sourceforge/linuxwacom/${name}.tar.bz2";
sha256 = "1xi39hl8ddgj9m7m2k2ll2r3wh0k0aq45fvrsv43651bhz9cbrza";
};
};
})
];
services.xserver = {
wacom.enable = true;
libinput.enable = false;
};
environment.systemPackages = with pkgs; [
wacomtablet
];
}
{ stdenv, fetchurl
, xorgproto, libX11, libXext, libXi, libXrandr, libXrender
, ncurses, pkgconfig, xorgserver, udev, libXinerama, pixman }:
stdenv.mkDerivation rec {
name = "xf86-input-wacom-0.36.0";
src = fetchurl {
url = "mirror://sourceforge/linuxwacom/${name}.tar.bz2";
sha256 = "1xi39hl8ddgj9m7m2k2ll2r3wh0k0aq45fvrsv43651bhz9cbrza";
};
buildInputs = [ xorgproto libX11 libXext libXi libXrandr libXrender
ncurses pkgconfig xorgserver udev libXinerama pixman ];
preConfigure = ''
mkdir -p $out/share/X11/xorg.conf.d
configureFlags="--with-xorg-module-dir=$out/lib/xorg/modules
--with-sdkdir=$out/include/xorg --with-xorg-conf-dir=$out/share/X11/xorg.conf.d"
'';
CFLAGS = "-I${pixman}/include/pixman-1";
meta = with stdenv.lib; {
maintainers = [ maintainers.goibhniu ];
description = "Wacom digitizer driver for X11";
homepage = "http://linuxwacom.sourceforge.net";
license = licenses.gpl2;
platforms = platforms.linux; # Probably, works with other unices as well
};
building '/nix/store/sxp2hfpq9lflmcqm981iyzfdls06n4k6-xf86-input-wacom-0.39.0.drv'...
unpacking sources
unpacking source archive /nix/store/z5nixvymnph0s3x7wsb00ira95ycs1bq-xf86-input-wacom-0.39.0.tar.gz
source root is xf86-input-wacom-xf86-input-wacom-0.39.0
setting SOURCE_DATE_EPOCH to timestamp 1576867351 of file xf86-input-wacom-xf86-input-wacom-0.39.0/xorg-wacom.pc.in
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
install flags: SHELL=/nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash install
make: *** No rule to make target 'install'. Stop.
builder for '/nix/store/sxp2hfpq9lflmcqm981iyzfdls06n4k6-xf86-input-wacom-0.39.0.drv' failed with exit code 2
cannot build derivation '/nix/store/0dmpggaaj4wzb8vd6j99p8g3y45jkgkg-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s6agrnjbb5cvi6qlm5cgg0qrzf7mybaq-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rqz3dhffg6x9yivcbby4fwjc1p64237l-nixos-system-meso-20.09pre221706.b61999e4ad6.drv': 1 dependencies couldn't be built
error: build of '/nix/store/rqz3dhffg6x9yivcbby4fwjc1p64237l-nixos-system-meso-20.09pre221706.b61999e4ad6.drv' failed

[Instructions copied from the project's wiki]

Building from Source

See also: Dependencies

There is also the option of building and installing the driver from source. Before doing so, you'll need to install a number of build dependencies. Use the appropriate command below:

Distro Commands
Fedora, Red Hat, Mageia sudo yum install gcc xorg-x11-util-macros xorg-x11-server-devel libXext-devel libXi-devel libXrandr-devel libXinerama-devel libudev-devel
Ubuntu, Mint, Debian sudo apt-get install autoconf pkg-config make xutils-dev libtool xserver-xorg-dev$(dpkg -S $(which Xorg) | grep -Eo -- "-hwe-[^:]*") libx11-dev libxi-dev libxrandr-dev libxinerama-dev libudev-dev
Arch Linux, Manjaro sudo pacman -S --needed --asdeps base-devel xorg-server-devel xorg-util-macros xorgproto libxinerama libxrandr libxi

To build a development version of the driver (e.g. if a developer has instructed you to test a version of the code), you will also need to install your distribution's "git", "automake", and "autoconf" packages.

With all the build dependencies installed, you should now obtain a copy of the source code. Unless you are building a development version, you should download the latest xf86-input-wacom release and extract it to a convenient location. To build a development version, please instead use the specific "git clone" command provided by the developer.

At this point you should open a terminal, navigate to the extracted or cloned directory, and copy/paste the following commands to build and install the driver:

set -- --prefix="/usr" --libdir="$(readlink -e $(ls -d /usr/lib*/xorg/modules/input/../../../ | head -n1))"
if test -x ./autogen.sh; then ./autogen.sh "$@"; else ./configure "$@"; fi && make && sudo make install || echo "Build Failed"

Unless the above commands printed out a "Build Failed" message, the driver was successfully installed. You can continue to the post-install steps below. Otherwise, please contact the linuxwacom developers for support.

Post-Install

In order to begin using the driver, you will need to log out so that the Xorg server can restart. In addition, it may be necessary to configure X before you can use your tablet; see the [[configuring X]] page for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment