nixpkgs/pkgs/development/libraries/libinput/default.nix

74 lines
2.5 KiB
Nix
Raw Normal View History

2017-09-18 11:34:10 +01:00
{ stdenv, fetchurl, pkgconfig, meson, ninja
, libevdev, mtdev, udev, libwacom
, documentationSupport ? false, doxygen ? null, graphviz ? null # Documentation
, eventGUISupport ? false, cairo ? null, glib ? null, gtk3 ? null # GUI event viewer support
, testsSupport ? false, check ? null, valgrind ? null, python3 ? null
}:
2014-10-17 22:26:05 +01:00
assert documentationSupport -> doxygen != null && graphviz != null && python3 != null;
assert eventGUISupport -> cairo != null && glib != null && gtk3 != null;
assert testsSupport -> check != null && valgrind != null && python3 != null;
let
2017-09-18 11:34:10 +01:00
mkFlag = optSet: flag: "-D${flag}=${stdenv.lib.boolToString optSet}";
sphinx-build = if documentationSupport then
python3.pkgs.sphinx.overrideAttrs (super: {
propagatedBuildInputs = super.propagatedBuildInputs ++ (with python3.pkgs; [ recommonmark sphinx_rtd_theme ]);
postFixup = super.postFixup or "" + ''
# Do not propagate Python
rm $out/nix-support/propagated-build-inputs
'';
})
else null;
in
with stdenv.lib;
stdenv.mkDerivation rec {
2016-09-18 18:01:01 +01:00
name = "libinput-${version}";
version = "1.13.2";
2014-10-17 22:26:05 +01:00
src = fetchurl {
url = "https://www.freedesktop.org/software/libinput/${name}.tar.xz";
sha256 = "0vbapc90m49n0z8w8w4v0qf1iiwaixw9h79jfmps9pj8hdls17qx";
2014-10-17 22:26:05 +01:00
};
outputs = [ "bin" "out" "dev" ];
2016-04-25 12:51:41 +01:00
2017-09-18 11:34:10 +01:00
mesonFlags = [
(mkFlag documentationSupport "documentation")
2017-09-18 11:34:10 +01:00
(mkFlag eventGUISupport "debug-gui")
(mkFlag testsSupport "tests")
"--libexecdir=${placeholder "bin"}/libexec"
];
nativeBuildInputs = [ pkgconfig meson ninja ]
++ optionals documentationSupport [ doxygen graphviz sphinx-build ]
++ optionals testsSupport [ valgrind ];
2014-10-17 22:26:05 +01:00
buildInputs = [ libevdev mtdev libwacom (python3.withPackages (pkgs: with pkgs; [ evdev ])) ]
++ optionals eventGUISupport [ cairo glib gtk3 ]
++ optionals testsSupport [ check ];
2017-09-18 11:34:10 +01:00
2016-04-08 21:11:46 +01:00
propagatedBuildInputs = [ udev ];
patches = [ ./udev-absolute-path.patch ];
postPatch = ''
patchShebangs tools/helper-copy-and-exec-from-tmp.sh
patchShebangs test/symbols-leak-test
patchShebangs test/check-leftover-udev-rules.sh
'';
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
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 ];
2014-10-17 22:26:05 +01:00
};
}