3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/libinput/default.nix

87 lines
2.4 KiB
Nix
Raw Normal View History

2021-08-03 09:53:10 +01:00
{ lib, stdenv, fetchurl, pkg-config, meson, ninja
, libevdev, mtdev, udev, libwacom
2021-08-05 15:49:10 +01:00
, documentationSupport ? false, doxygen, graphviz # Documentation
, eventGUISupport ? false, cairo, glib, gtk3 # GUI event viewer support
, testsSupport ? false, check, valgrind, python3
}:
2014-10-17 22:26:05 +01:00
let
mkFlag = optSet: flag: "-D${flag}=${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
stdenv.mkDerivation rec {
pname = "libinput";
2021-08-03 09:53:10 +01:00
version = "1.18.1";
src = fetchurl {
url = "https://www.freedesktop.org/software/libinput/libinput-${version}.tar.xz";
sha256 = "1jx7y48ym89grjz67jmn80h5j8c36qgwb0h5c703nln2zchl18cw";
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")
"--sysconfdir=/etc"
"--libexecdir=${placeholder "bin"}/libexec"
];
nativeBuildInputs = [ pkg-config meson ninja ]
2021-08-05 15:49:10 +01:00
++ lib.optionals documentationSupport [ doxygen graphviz sphinx-build ];
2014-10-17 22:26:05 +01:00
buildInputs = [
libevdev
mtdev
libwacom
(python3.withPackages (pp: with pp; [
pp.libevdev # already in scope
pyudev
pyyaml
setuptools
]))
2021-08-05 15:49:10 +01:00
] ++ lib.optionals eventGUISupport [ cairo glib gtk3 ];
checkInputs = [
check
valgrind
];
2017-09-18 11:34:10 +01:00
2016-04-08 21:11:46 +01:00
propagatedBuildInputs = [ udev ];
patches = [ ./udev-absolute-path.patch ];
postPatch = ''
2021-08-05 15:49:10 +01:00
patchShebangs \
tools/helper-copy-and-exec-from-tmp.sh \
test/symbols-leak-test \
test/check-leftover-udev-rules.sh \
test/helper-copy-and-exec-from-tmp.sh
2021-08-03 09:53:10 +01:00
# Don't create an empty /etc directory.
sed -i "/install_subdir('libinput', install_dir : dir_etc)/d" meson.build
'';
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
2021-08-05 15:49:10 +01:00
meta = with lib; {
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ codyopel ];
2014-10-17 22:26:05 +01:00
};
}