2022-01-28 18:20:16 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, libevdev
|
|
|
|
, mtdev
|
|
|
|
, udev
|
|
|
|
, libwacom
|
|
|
|
, documentationSupport ? false
|
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, eventGUISupport ? false
|
|
|
|
, cairo
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, testsSupport ? false
|
|
|
|
, check
|
|
|
|
, valgrind
|
|
|
|
, python3
|
2021-11-15 11:46:20 +00:00
|
|
|
, nixosTests
|
2017-10-16 09:55:40 +00:00
|
|
|
}:
|
2014-10-17 21:26:05 +00:00
|
|
|
|
2017-10-16 09:55:40 +00:00
|
|
|
let
|
2021-01-21 17:00:13 +00:00
|
|
|
mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}";
|
2018-12-01 01:08:04 +00:00
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
sphinx-build =
|
|
|
|
python3.pkgs.sphinx.overrideAttrs (attrs: {
|
|
|
|
propagatedBuildInputs =
|
|
|
|
attrs.propagatedBuildInputs
|
|
|
|
++ (with python3.pkgs; [
|
|
|
|
recommonmark
|
|
|
|
sphinx_rtd_theme
|
|
|
|
]);
|
2018-12-01 01:08:04 +00:00
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
postFixup = attrs.postFixup or "" + ''
|
2018-12-01 01:08:04 +00:00
|
|
|
# Do not propagate Python
|
|
|
|
rm $out/nix-support/propagated-build-inputs
|
|
|
|
'';
|
2022-01-28 18:20:16 +00:00
|
|
|
});
|
2017-10-16 09:55:40 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libinput";
|
2021-12-10 09:10:29 +00:00
|
|
|
version = "1.19.3";
|
2021-08-03 08:53:10 +00:00
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
2021-08-03 08:53:10 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.freedesktop.org/software/libinput/libinput-${version}.tar.xz";
|
2021-12-10 09:10:29 +00:00
|
|
|
sha256 = "sha256-PK54zN4Z19Dzh+WLxzTU0Xq19kJvVKnotyjJCxe6oGg=";
|
2014-10-17 21:26:05 +00:00
|
|
|
};
|
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
patches = [
|
|
|
|
./udev-absolute-path.patch
|
2015-02-24 07:32:49 +00:00
|
|
|
];
|
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
] ++ lib.optionals documentationSupport [
|
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
sphinx-build
|
|
|
|
];
|
2014-10-17 21:26:05 +00:00
|
|
|
|
2020-07-08 13:06:33 +00:00
|
|
|
buildInputs = [
|
|
|
|
libevdev
|
|
|
|
mtdev
|
|
|
|
libwacom
|
|
|
|
(python3.withPackages (pp: with pp; [
|
|
|
|
pp.libevdev # already in scope
|
|
|
|
pyudev
|
|
|
|
pyyaml
|
|
|
|
setuptools
|
|
|
|
]))
|
2022-01-28 18:20:16 +00:00
|
|
|
] ++ lib.optionals eventGUISupport [
|
|
|
|
# GUI event viewer
|
|
|
|
cairo
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
udev
|
|
|
|
];
|
2020-02-25 01:03:40 +00:00
|
|
|
|
2020-07-08 13:06:33 +00:00
|
|
|
checkInputs = [
|
|
|
|
check
|
|
|
|
valgrind
|
|
|
|
];
|
2017-09-18 10:34:10 +00:00
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
mesonFlags = [
|
|
|
|
(mkFlag documentationSupport "documentation")
|
|
|
|
(mkFlag eventGUISupport "debug-gui")
|
|
|
|
(mkFlag testsSupport "tests")
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--libexecdir=${placeholder "bin"}/libexec"
|
|
|
|
];
|
2016-04-08 20:11:46 +00:00
|
|
|
|
2022-01-28 18:20:16 +00:00
|
|
|
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
|
2017-10-16 09:55:40 +00:00
|
|
|
|
2018-12-01 01:08:04 +00:00
|
|
|
postPatch = ''
|
2021-08-05 14:49:10 +00:00
|
|
|
patchShebangs \
|
|
|
|
test/symbols-leak-test \
|
|
|
|
test/check-leftover-udev-rules.sh \
|
|
|
|
test/helper-copy-and-exec-from-tmp.sh
|
2021-08-03 08:53:10 +00:00
|
|
|
|
|
|
|
# Don't create an empty /etc directory.
|
|
|
|
sed -i "/install_subdir('libinput', install_dir : dir_etc)/d" meson.build
|
2018-12-01 01:08:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-11-15 11:46:20 +00:00
|
|
|
passthru.tests = {
|
|
|
|
libinput-module = nixosTests.libinput;
|
|
|
|
};
|
|
|
|
|
2021-08-05 14:49:10 +00:00
|
|
|
meta = with lib; {
|
2015-02-24 07:32:49 +00:00
|
|
|
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
2022-01-28 18:20:16 +00:00
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
2022-01-28 18:22:53 +00:00
|
|
|
maintainers = with maintainers; [ codyopel ] ++ teams.freedesktop.members;
|
2014-10-17 21:26:05 +00:00
|
|
|
};
|
|
|
|
}
|