about summary refs log tree commit diff
path: root/pkgs/development/libraries/libwacom/default.nix
blob: 8e9840325bb961aa80049b18b121914dd1f511db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ stdenv
, lib
, fetchFromGitHub
, meson
, ninja
, glib
, pkg-config
, udev
, libevdev
, libgudev
, libxml2
, python3
, valgrind
}:

stdenv.mkDerivation rec {
  pname = "libwacom";
  version = "2.10.0";

  outputs = [ "out" "dev" ];

  src = fetchFromGitHub {
    owner = "linuxwacom";
    repo = "libwacom";
    rev = "libwacom-${version}";
    hash = "sha256-mH0aBDXeaz0tZLwNPSWUepHu52DnlvPyQFw3EByIwys=";
  };

  postPatch = ''
    patchShebangs test/check-files-in-git.sh
  '';

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    python3
  ];

  buildInputs = [
    glib
    udev
    libevdev
    libgudev
  ];

  doCheck = stdenv.hostPlatform == stdenv.buildPlatform
            && lib.meta.availableOn stdenv.hostPlatform valgrind
            && !stdenv.hostPlatform.isPower  # one test times out
  ;

  mesonFlags = [
    "-Dtests=${if doCheck then "enabled" else "disabled"}"
  ];

  checkInputs = [
    libxml2
  ];

  nativeCheckInputs = [
    valgrind
    (python3.withPackages (ps: with ps; [
      ps.libevdev
      pytest
      pyudev
    ]))
  ];

  meta = with lib; {
    platforms = platforms.linux;
    homepage = "https://linuxwacom.github.io/";
    changelog = "https://github.com/linuxwacom/libwacom/blob/${src.rev}/NEWS";
    description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
    maintainers = teams.freedesktop.members;
    license = licenses.hpnd;
  };
}