2022-02-10 20:34:41 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, pkg-config
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
|
|
|
|
, libevdev
|
|
|
|
|
, mtdev
|
|
|
|
|
, udev
|
|
|
|
|
, libwacom
|
|
|
|
|
, documentationSupport ? false
|
|
|
|
|
, doxygen
|
|
|
|
|
, graphviz
|
|
|
|
|
, runCommand
|
|
|
|
|
, eventGUISupport ? false
|
|
|
|
|
, cairo
|
|
|
|
|
, glib
|
|
|
|
|
, gtk3
|
|
|
|
|
, testsSupport ? false
|
|
|
|
|
, check
|
|
|
|
|
, valgrind
|
|
|
|
|
, python3
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
|
mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
sphinx-build =
|
|
|
|
|
let
|
|
|
|
|
env = python3.withPackages (pp: with pp; [
|
|
|
|
|
sphinx
|
|
|
|
|
recommonmark
|
|
|
|
|
sphinx_rtd_theme
|
|
|
|
|
]);
|
|
|
|
|
in
|
|
|
|
|
# Expose only the sphinx-build binary to avoid contaminating
|
|
|
|
|
# everything with Sphinx’s Python environment.
|
|
|
|
|
runCommand "sphinx-build" { } ''
|
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
|
ln -s "${env}/bin/sphinx-build" "$out/bin"
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libinput";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
version = "1.19.3";
|
|
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://www.freedesktop.org/software/libinput/libinput-${version}.tar.xz";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
sha256 = "sha256-PK54zN4Z19Dzh+WLxzTU0Xq19kJvVKnotyjJCxe6oGg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
patches = [
|
|
|
|
|
./udev-absolute-path.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
pkg-config
|
|
|
|
|
meson
|
|
|
|
|
ninja
|
|
|
|
|
] ++ lib.optionals documentationSupport [
|
|
|
|
|
doxygen
|
|
|
|
|
graphviz
|
|
|
|
|
sphinx-build
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
libevdev
|
|
|
|
|
mtdev
|
|
|
|
|
libwacom
|
|
|
|
|
(python3.withPackages (pp: with pp; [
|
|
|
|
|
pp.libevdev # already in scope
|
|
|
|
|
pyudev
|
|
|
|
|
pyyaml
|
|
|
|
|
setuptools
|
|
|
|
|
]))
|
2022-02-10 20:34:41 +00:00
|
|
|
|
] ++ lib.optionals eventGUISupport [
|
|
|
|
|
# GUI event viewer
|
|
|
|
|
cairo
|
|
|
|
|
glib
|
|
|
|
|
gtk3
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
udev
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
checkInputs = [
|
|
|
|
|
check
|
|
|
|
|
valgrind
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
mesonFlags = [
|
|
|
|
|
(mkFlag documentationSupport "documentation")
|
|
|
|
|
(mkFlag eventGUISupport "debug-gui")
|
|
|
|
|
(mkFlag testsSupport "tests")
|
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
|
"--libexecdir=${placeholder "bin"}/libexec"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
|
patchShebangs \
|
|
|
|
|
test/symbols-leak-test \
|
|
|
|
|
test/check-leftover-udev-rules.sh \
|
|
|
|
|
test/helper-copy-and-exec-from-tmp.sh
|
|
|
|
|
|
|
|
|
|
# Don't create an empty /etc directory.
|
|
|
|
|
sed -i "/install_subdir('libinput', install_dir : dir_etc)/d" meson.build
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
|
passthru.tests = {
|
|
|
|
|
libinput-module = nixosTests.libinput;
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
|
|
|
|
|
license = licenses.mit;
|
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
maintainers = with maintainers; [ codyopel ] ++ teams.freedesktop.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|