2017-09-18 12:34:10 +02:00
|
|
|
{ stdenv, fetchurl, pkgconfig, meson, ninja
|
2017-10-16 11:55:40 +02:00
|
|
|
, libevdev, mtdev, udev, libwacom
|
2015-08-13 20:39:12 +02:00
|
|
|
, documentationSupport ? false, doxygen ? null, graphviz ? null # Documentation
|
2015-02-24 08:32:49 +01:00
|
|
|
, eventGUISupport ? false, cairo ? null, glib ? null, gtk3 ? null # GUI event viewer support
|
2017-11-04 19:27:40 +01:00
|
|
|
, testsSupport ? false, check ? null, valgrind ? null, python3Packages ? null
|
2017-10-16 11:55:40 +02:00
|
|
|
}:
|
2014-10-17 23:26:05 +02:00
|
|
|
|
2015-02-24 08:32:49 +01:00
|
|
|
assert documentationSupport -> doxygen != null && graphviz != null;
|
|
|
|
assert eventGUISupport -> cairo != null && glib != null && gtk3 != null;
|
2017-11-04 19:27:40 +01:00
|
|
|
assert testsSupport -> check != null && valgrind != null && python3Packages != null;
|
2015-02-24 08:32:49 +01:00
|
|
|
|
2017-10-16 11:55:40 +02:00
|
|
|
let
|
2017-09-18 12:34:10 +02:00
|
|
|
mkFlag = optSet: flag: "-D${flag}=${stdenv.lib.boolToString optSet}";
|
2017-10-16 11:55:40 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-18 19:01:01 +02:00
|
|
|
name = "libinput-${version}";
|
2018-02-27 05:40:00 +01:00
|
|
|
version = "1.10.0";
|
2014-10-17 23:26:05 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-10-16 11:55:40 +02:00
|
|
|
url = "http://www.freedesktop.org/software/libinput/${name}.tar.xz";
|
2018-02-27 05:40:00 +01:00
|
|
|
sha256 = "0mrzsf0349d1g68lizkzxw7vaw459fl8xhl7v0s8njb31hp2riy2";
|
2014-10-17 23:26:05 +02:00
|
|
|
};
|
|
|
|
|
2016-08-29 02:30:01 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
2016-04-25 13:51:41 +02:00
|
|
|
|
2017-09-18 12:34:10 +02:00
|
|
|
mesonFlags = [
|
2015-06-01 21:29:47 +02:00
|
|
|
(mkFlag documentationSupport "documentation")
|
2017-09-18 12:34:10 +02:00
|
|
|
(mkFlag eventGUISupport "debug-gui")
|
2015-06-01 21:29:47 +02:00
|
|
|
(mkFlag testsSupport "tests")
|
2015-02-24 08:32:49 +01:00
|
|
|
];
|
|
|
|
|
2017-09-18 12:34:10 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig meson ninja ]
|
2015-02-24 08:32:49 +01:00
|
|
|
++ optionals documentationSupport [ doxygen graphviz ]
|
2017-11-04 19:27:40 +01:00
|
|
|
++ optionals testsSupport [ check valgrind python3Packages.pyparsing ];
|
2014-10-17 23:26:05 +02:00
|
|
|
|
2017-09-18 12:34:10 +02:00
|
|
|
buildInputs = [ libevdev mtdev libwacom ]
|
|
|
|
++ optionals eventGUISupport [ cairo glib gtk3 ];
|
|
|
|
|
2016-04-08 22:11:46 +02:00
|
|
|
propagatedBuildInputs = [ udev ];
|
|
|
|
|
2017-10-16 11:55:40 +02:00
|
|
|
patches = [ ./udev-absolute-path.patch ];
|
|
|
|
|
2017-11-04 19:27:40 +01:00
|
|
|
preBuild = ''
|
|
|
|
# meson setup-hook changes the directory so the files are located one level up
|
|
|
|
patchShebangs ../udev/parse_hwdb.py
|
|
|
|
patchShebangs ../test/symbols-leak-test.in
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = testsSupport;
|
|
|
|
|
2015-02-24 08:32:49 +01:00
|
|
|
meta = {
|
|
|
|
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/libinput;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ codyopel wkennington ];
|
2014-10-17 23:26:05 +02:00
|
|
|
};
|
|
|
|
}
|